48 return (*(
reinterpret_cast<Rcpp::Environment*
>(self.
envir)));
71double rnorm(
const double mean,
const double sd,
const double lower,
74 for(
int i=0; i < 50; ++i) {
75 x = R::rnorm(mean,sd);
76 if(x >= lower && x <= upper)
return(x);
78 Rcpp::stop(
"Could not simulate normal variate within specified bounds");
98double rlognorm(
const double mean,
const double sd,
const double lower,
101 for(
int i=0; i < 50; ++i) {
102 x = exp(R::rnorm(mean,sd));
103 if(x >= lower && x <= upper) {
107 Rcpp::stop(
"Could not simulate log normal variate within specified bounds");
135template<
typename _T___>
166template<
typename _T___>
169 env.assign(x, value);
186template<
typename _T___>
187_T___
get(
const std::string name) {
188 Rcpp::Environment env = Rcpp::Environment::global_env();
218template<
typename _T___>
219_T___
get(
const std::string package,
const std::string name) {
220 Rcpp::Environment env = Rcpp::Environment::namespace_env(package);
221 _T___ ans = env[name];
249template<
typename _T___>
286 Rcpp::Environment env = Rcpp::Environment::namespace_env(
"mrgsolve");
287 Rcpp::Function ans = env[
"mrgx_mt_fun"];
member functions mevent and tad come in via housemodel; see inst/base/databox.cpp
Definition mrgsolv.h:96
void * envir
model environment
Definition mrgsolv.h:115
double rnorm(const double mean, const double sd, const double lower, const double upper)
Definition mrgx.h:71
void assign(const std::string x, const _T___ &value, const databox &self)
Definition mrgx.h:167
_T___ readRDS(const std::string filename)
Definition mrgx.h:250
double rlognorm(const double mean, const double sd, const double lower, const double upper)
Definition mrgx.h:98
Rcpp::Function mt_fun()
Definition mrgx.h:284
Rcpp::Environment get_envir(const databox &self)
Return the model environment.
Definition mrgx.h:47
_T___ get(const std::string name, const databox &self)
Definition mrgx.h:136