// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <RcppArmadillo.h>
#include "../inst/include/rxode2.h"
#include <RcppEigen.h>
#include <Rcpp.h>
#include <string>
#include <set>

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// rinvchisq
NumericVector rinvchisq(const int n, const double& nu, const double& scale);
RcppExport SEXP _rxode2_rinvchisq(SEXP nSEXP, SEXP nuSEXP, SEXP scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n(nSEXP);
    Rcpp::traits::input_parameter< const double& >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< const double& >::type scale(scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(rinvchisq(n, nu, scale));
    return rcpp_result_gen;
END_RCPP
}
// rLKJ1
arma::mat rLKJ1(int d, double eta, bool cholesky);
RcppExport SEXP _rxode2_rLKJ1(SEXP dSEXP, SEXP etaSEXP, SEXP choleskySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type d(dSEXP);
    Rcpp::traits::input_parameter< double >::type eta(etaSEXP);
    Rcpp::traits::input_parameter< bool >::type cholesky(choleskySEXP);
    rcpp_result_gen = Rcpp::wrap(rLKJ1(d, eta, cholesky));
    return rcpp_result_gen;
END_RCPP
}
// rLKJcv1
arma::mat rLKJcv1(arma::vec sd, double eta);
RcppExport SEXP _rxode2_rLKJcv1(SEXP sdSEXP, SEXP etaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type sd(sdSEXP);
    Rcpp::traits::input_parameter< double >::type eta(etaSEXP);
    rcpp_result_gen = Rcpp::wrap(rLKJcv1(sd, eta));
    return rcpp_result_gen;
END_RCPP
}
// rLKJcvLsd1
arma::mat rLKJcvLsd1(arma::vec logSd, arma::vec logSdSD, double eta);
RcppExport SEXP _rxode2_rLKJcvLsd1(SEXP logSdSEXP, SEXP logSdSDSEXP, SEXP etaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type logSd(logSdSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type logSdSD(logSdSDSEXP);
    Rcpp::traits::input_parameter< double >::type eta(etaSEXP);
    rcpp_result_gen = Rcpp::wrap(rLKJcvLsd1(logSd, logSdSD, eta));
    return rcpp_result_gen;
END_RCPP
}
// invWR1d
arma::mat invWR1d(int d, double nu, bool omegaIsChol);
RcppExport SEXP _rxode2_invWR1d(SEXP dSEXP, SEXP nuSEXP, SEXP omegaIsCholSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type d(dSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< bool >::type omegaIsChol(omegaIsCholSEXP);
    rcpp_result_gen = Rcpp::wrap(invWR1d(d, nu, omegaIsChol));
    return rcpp_result_gen;
END_RCPP
}
// rcvC1
arma::mat rcvC1(arma::vec sdEst, double nu, int diagXformType, int rType, bool returnChol);
RcppExport SEXP _rxode2_rcvC1(SEXP sdEstSEXP, SEXP nuSEXP, SEXP diagXformTypeSEXP, SEXP rTypeSEXP, SEXP returnCholSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type sdEst(sdEstSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< int >::type diagXformType(diagXformTypeSEXP);
    Rcpp::traits::input_parameter< int >::type rType(rTypeSEXP);
    Rcpp::traits::input_parameter< bool >::type returnChol(returnCholSEXP);
    rcpp_result_gen = Rcpp::wrap(rcvC1(sdEst, nu, diagXformType, rType, returnChol));
    return rcpp_result_gen;
END_RCPP
}
// cvPost_
SEXP cvPost_(SEXP nuS, SEXP omegaS, SEXP nS, SEXP omegaIsCholS, SEXP returnCholS, SEXP typeS, SEXP diagXformTypeS);
RcppExport SEXP _rxode2_cvPost_(SEXP nuSSEXP, SEXP omegaSSEXP, SEXP nSSEXP, SEXP omegaIsCholSSEXP, SEXP returnCholSSEXP, SEXP typeSSEXP, SEXP diagXformTypeSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type nuS(nuSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type omegaS(omegaSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type nS(nSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type omegaIsCholS(omegaIsCholSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type returnCholS(returnCholSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type typeS(typeSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type diagXformTypeS(diagXformTypeSSEXP);
    rcpp_result_gen = Rcpp::wrap(cvPost_(nuS, omegaS, nS, omegaIsCholS, returnCholS, typeS, diagXformTypeS));
    return rcpp_result_gen;
END_RCPP
}
// expandTheta_
SEXP expandTheta_(SEXP thetaS, SEXP thetaMatS, SEXP thetaLowerS, SEXP thetaUpperS, SEXP nStudS, SEXP nCoresRVS);
RcppExport SEXP _rxode2_expandTheta_(SEXP thetaSSEXP, SEXP thetaMatSSEXP, SEXP thetaLowerSSEXP, SEXP thetaUpperSSEXP, SEXP nStudSSEXP, SEXP nCoresRVSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type thetaS(thetaSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type thetaMatS(thetaMatSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type thetaLowerS(thetaLowerSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type thetaUpperS(thetaUpperSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type nStudS(nStudSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type nCoresRVS(nCoresRVSSEXP);
    rcpp_result_gen = Rcpp::wrap(expandTheta_(thetaS, thetaMatS, thetaLowerS, thetaUpperS, nStudS, nCoresRVS));
    return rcpp_result_gen;
END_RCPP
}
// expandPars_
SEXP expandPars_(SEXP objectS, SEXP paramsS, SEXP eventsS, SEXP controlS);
RcppExport SEXP _rxode2_expandPars_(SEXP objectSSEXP, SEXP paramsSSEXP, SEXP eventsSSEXP, SEXP controlSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type objectS(objectSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type paramsS(paramsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type eventsS(eventsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type controlS(controlSSEXP);
    rcpp_result_gen = Rcpp::wrap(expandPars_(objectS, paramsS, eventsS, controlS));
    return rcpp_result_gen;
END_RCPP
}
// nestingInfo_
SEXP nestingInfo_(SEXP omega, List data);
RcppExport SEXP _rxode2_nestingInfo_(SEXP omegaSEXP, SEXP dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type omega(omegaSEXP);
    Rcpp::traits::input_parameter< List >::type data(dataSEXP);
    rcpp_result_gen = Rcpp::wrap(nestingInfo_(omega, data));
    return rcpp_result_gen;
END_RCPP
}
// swapMatListWithCube_
RObject swapMatListWithCube_(RObject inO);
RcppExport SEXP _rxode2_swapMatListWithCube_(SEXP inOSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type inO(inOSEXP);
    rcpp_result_gen = Rcpp::wrap(swapMatListWithCube_(inO));
    return rcpp_result_gen;
END_RCPP
}
// omegaListRse
Rcpp::List omegaListRse(RObject omegaIn);
RcppExport SEXP _rxode2_omegaListRse(SEXP omegaInSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type omegaIn(omegaInSEXP);
    rcpp_result_gen = Rcpp::wrap(omegaListRse(omegaIn));
    return rcpp_result_gen;
END_RCPP
}
// setCvodeLinearSolver
void setCvodeLinearSolver(int type);
RcppExport SEXP _rxode2_setCvodeLinearSolver(SEXP typeSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type type(typeSEXP);
    setCvodeLinearSolver(type);
    return R_NilValue;
END_RCPP
}
// getLinInfo_
IntegerVector getLinInfo_(List mv);
RcppExport SEXP _rxode2_getLinInfo_(SEXP mvSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type mv(mvSEXP);
    rcpp_result_gen = Rcpp::wrap(getLinInfo_(mv));
    return rcpp_result_gen;
END_RCPP
}
// getCmtNum_
IntegerVector getCmtNum_(IntegerVector cmt, List mv, bool sens);
RcppExport SEXP _rxode2_getCmtNum_(SEXP cmtSEXP, SEXP mvSEXP, SEXP sensSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type cmt(cmtSEXP);
    Rcpp::traits::input_parameter< List >::type mv(mvSEXP);
    Rcpp::traits::input_parameter< bool >::type sens(sensSEXP);
    rcpp_result_gen = Rcpp::wrap(getCmtNum_(cmt, mv, sens));
    return rcpp_result_gen;
END_RCPP
}
// rxSetIni0
bool rxSetIni0(bool ini0);
RcppExport SEXP _rxode2_rxSetIni0(SEXP ini0SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< bool >::type ini0(ini0SEXP);
    rcpp_result_gen = Rcpp::wrap(rxSetIni0(ini0));
    return rcpp_result_gen;
END_RCPP
}
// etTransEvidIsObs
RObject etTransEvidIsObs(SEXP isObsSexp);
RcppExport SEXP _rxode2_etTransEvidIsObs(SEXP isObsSexpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type isObsSexp(isObsSexpSEXP);
    rcpp_result_gen = Rcpp::wrap(etTransEvidIsObs(isObsSexp));
    return rcpp_result_gen;
END_RCPP
}
// cmtSupportsInfusion_
LogicalVector cmtSupportsInfusion_(IntegerVector cmt, List mv);
RcppExport SEXP _rxode2_cmtSupportsInfusion_(SEXP cmtSEXP, SEXP mvSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type cmt(cmtSEXP);
    Rcpp::traits::input_parameter< List >::type mv(mvSEXP);
    rcpp_result_gen = Rcpp::wrap(cmtSupportsInfusion_(cmt, mv));
    return rcpp_result_gen;
END_RCPP
}
// cmtSupportsOff_
LogicalVector cmtSupportsOff_(IntegerVector cmt, List mv);
RcppExport SEXP _rxode2_cmtSupportsOff_(SEXP cmtSEXP, SEXP mvSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type cmt(cmtSEXP);
    Rcpp::traits::input_parameter< List >::type mv(mvSEXP);
    rcpp_result_gen = Rcpp::wrap(cmtSupportsOff_(cmt, mv));
    return rcpp_result_gen;
END_RCPP
}
// etTrans
List etTrans(List inData, const RObject& obj, bool addCmt, bool dropUnits, bool allTimeVar, bool keepDosingOnly, Nullable<LogicalVector> combineDvid, CharacterVector keep, bool addlKeepsCov, bool addlDropSs, bool ssAtDoseTime, Nullable<List> iCov);
RcppExport SEXP _rxode2_etTrans(SEXP inDataSEXP, SEXP objSEXP, SEXP addCmtSEXP, SEXP dropUnitsSEXP, SEXP allTimeVarSEXP, SEXP keepDosingOnlySEXP, SEXP combineDvidSEXP, SEXP keepSEXP, SEXP addlKeepsCovSEXP, SEXP addlDropSsSEXP, SEXP ssAtDoseTimeSEXP, SEXP iCovSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type inData(inDataSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< bool >::type addCmt(addCmtSEXP);
    Rcpp::traits::input_parameter< bool >::type dropUnits(dropUnitsSEXP);
    Rcpp::traits::input_parameter< bool >::type allTimeVar(allTimeVarSEXP);
    Rcpp::traits::input_parameter< bool >::type keepDosingOnly(keepDosingOnlySEXP);
    Rcpp::traits::input_parameter< Nullable<LogicalVector> >::type combineDvid(combineDvidSEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< bool >::type addlKeepsCov(addlKeepsCovSEXP);
    Rcpp::traits::input_parameter< bool >::type addlDropSs(addlDropSsSEXP);
    Rcpp::traits::input_parameter< bool >::type ssAtDoseTime(ssAtDoseTimeSEXP);
    Rcpp::traits::input_parameter< Nullable<List> >::type iCov(iCovSEXP);
    rcpp_result_gen = Rcpp::wrap(etTrans(inData, obj, addCmt, dropUnits, allTimeVar, keepDosingOnly, combineDvid, keep, addlKeepsCov, addlDropSs, ssAtDoseTime, iCov));
    return rcpp_result_gen;
END_RCPP
}
// rxEtTransAsDataFrame_
List rxEtTransAsDataFrame_(List inData1);
RcppExport SEXP _rxode2_rxEtTransAsDataFrame_(SEXP inData1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type inData1(inData1SEXP);
    rcpp_result_gen = Rcpp::wrap(rxEtTransAsDataFrame_(inData1));
    return rcpp_result_gen;
END_RCPP
}
// rxExpandGrid_
List rxExpandGrid_(RObject& c1, RObject& c2, RObject& type);
static SEXP _rxode2_rxExpandGrid__try(SEXP c1SEXP, SEXP c2SEXP, SEXP typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject& >::type c1(c1SEXP);
    Rcpp::traits::input_parameter< RObject& >::type c2(c2SEXP);
    Rcpp::traits::input_parameter< RObject& >::type type(typeSEXP);
    rcpp_result_gen = Rcpp::wrap(rxExpandGrid_(c1, c2, type));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxExpandGrid_(SEXP c1SEXP, SEXP c2SEXP, SEXP typeSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxExpandGrid__try(c1SEXP, c2SEXP, typeSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxExpandSens_
List rxExpandSens_(CharacterVector state, CharacterVector calcSens);
static SEXP _rxode2_rxExpandSens__try(SEXP stateSEXP, SEXP calcSensSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< CharacterVector >::type state(stateSEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type calcSens(calcSensSEXP);
    rcpp_result_gen = Rcpp::wrap(rxExpandSens_(state, calcSens));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxExpandSens_(SEXP stateSEXP, SEXP calcSensSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxExpandSens__try(stateSEXP, calcSensSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxExpandSens2_
List rxExpandSens2_(CharacterVector state, CharacterVector s1, CharacterVector s2);
static SEXP _rxode2_rxExpandSens2__try(SEXP stateSEXP, SEXP s1SEXP, SEXP s2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< CharacterVector >::type state(stateSEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type s1(s1SEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type s2(s2SEXP);
    rcpp_result_gen = Rcpp::wrap(rxExpandSens2_(state, s1, s2));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxExpandSens2_(SEXP stateSEXP, SEXP s1SEXP, SEXP s2SEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxExpandSens2__try(stateSEXP, s1SEXP, s2SEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxExpandSens3_
List rxExpandSens3_(CharacterVector state, CharacterVector s1, CharacterVector s2, CharacterVector s3);
static SEXP _rxode2_rxExpandSens3__try(SEXP stateSEXP, SEXP s1SEXP, SEXP s2SEXP, SEXP s3SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< CharacterVector >::type state(stateSEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type s1(s1SEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type s2(s2SEXP);
    Rcpp::traits::input_parameter< CharacterVector >::type s3(s3SEXP);
    rcpp_result_gen = Rcpp::wrap(rxExpandSens3_(state, s1, s2, s3));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxExpandSens3_(SEXP stateSEXP, SEXP s1SEXP, SEXP s2SEXP, SEXP s3SEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxExpandSens3__try(stateSEXP, s1SEXP, s2SEXP, s3SEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxExpandFEta_
List rxExpandFEta_(CharacterVector state, int neta, int pred, bool isTheta);
static SEXP _rxode2_rxExpandFEta__try(SEXP stateSEXP, SEXP netaSEXP, SEXP predSEXP, SEXP isThetaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< CharacterVector >::type state(stateSEXP);
    Rcpp::traits::input_parameter< int >::type neta(netaSEXP);
    Rcpp::traits::input_parameter< int >::type pred(predSEXP);
    Rcpp::traits::input_parameter< bool >::type isTheta(isThetaSEXP);
    rcpp_result_gen = Rcpp::wrap(rxExpandFEta_(state, neta, pred, isTheta));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxExpandFEta_(SEXP stateSEXP, SEXP netaSEXP, SEXP predSEXP, SEXP isThetaSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxExpandFEta__try(stateSEXP, netaSEXP, predSEXP, isThetaSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxRepR0_
std::string rxRepR0_(int neta);
static SEXP _rxode2_rxRepR0__try(SEXP netaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< int >::type neta(netaSEXP);
    rcpp_result_gen = Rcpp::wrap(rxRepR0_(neta));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxRepR0_(SEXP netaSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxRepR0__try(netaSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxExpandNesting
List rxExpandNesting(const RObject& obj, List& nestingInfo, bool compile);
static SEXP _rxode2_rxExpandNesting_try(SEXP objSEXP, SEXP nestingInfoSEXP, SEXP compileSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< List& >::type nestingInfo(nestingInfoSEXP);
    Rcpp::traits::input_parameter< bool >::type compile(compileSEXP);
    rcpp_result_gen = Rcpp::wrap(rxExpandNesting(obj, nestingInfo, compile));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxExpandNesting(SEXP objSEXP, SEXP nestingInfoSEXP, SEXP compileSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxExpandNesting_try(objSEXP, nestingInfoSEXP, compileSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxIndLin_
std::string rxIndLin_(CharacterVector states);
RcppExport SEXP _rxode2_rxIndLin_(SEXP statesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< CharacterVector >::type states(statesSEXP);
    rcpp_result_gen = Rcpp::wrap(rxIndLin_(states));
    return rcpp_result_gen;
END_RCPP
}
// convertId_
SEXP convertId_(SEXP x);
RcppExport SEXP _rxode2_convertId_(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(convertId_(x));
    return rcpp_result_gen;
END_RCPP
}
// linCmtModelDouble
RObject linCmtModelDouble(double dt, double p1, double v1, double p2, double p3, double p4, double p5, double ka, NumericVector alastNV, NumericVector rateNV, const int ncmt, const int oral0, const int trans, bool deriv, int type, double tau, double tinf, double amt, int bolusCmt, int ndiff, int sensType, double sensH);
RcppExport SEXP _rxode2_linCmtModelDouble(SEXP dtSEXP, SEXP p1SEXP, SEXP v1SEXP, SEXP p2SEXP, SEXP p3SEXP, SEXP p4SEXP, SEXP p5SEXP, SEXP kaSEXP, SEXP alastNVSEXP, SEXP rateNVSEXP, SEXP ncmtSEXP, SEXP oral0SEXP, SEXP transSEXP, SEXP derivSEXP, SEXP typeSEXP, SEXP tauSEXP, SEXP tinfSEXP, SEXP amtSEXP, SEXP bolusCmtSEXP, SEXP ndiffSEXP, SEXP sensTypeSEXP, SEXP sensHSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type dt(dtSEXP);
    Rcpp::traits::input_parameter< double >::type p1(p1SEXP);
    Rcpp::traits::input_parameter< double >::type v1(v1SEXP);
    Rcpp::traits::input_parameter< double >::type p2(p2SEXP);
    Rcpp::traits::input_parameter< double >::type p3(p3SEXP);
    Rcpp::traits::input_parameter< double >::type p4(p4SEXP);
    Rcpp::traits::input_parameter< double >::type p5(p5SEXP);
    Rcpp::traits::input_parameter< double >::type ka(kaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type alastNV(alastNVSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type rateNV(rateNVSEXP);
    Rcpp::traits::input_parameter< const int >::type ncmt(ncmtSEXP);
    Rcpp::traits::input_parameter< const int >::type oral0(oral0SEXP);
    Rcpp::traits::input_parameter< const int >::type trans(transSEXP);
    Rcpp::traits::input_parameter< bool >::type deriv(derivSEXP);
    Rcpp::traits::input_parameter< int >::type type(typeSEXP);
    Rcpp::traits::input_parameter< double >::type tau(tauSEXP);
    Rcpp::traits::input_parameter< double >::type tinf(tinfSEXP);
    Rcpp::traits::input_parameter< double >::type amt(amtSEXP);
    Rcpp::traits::input_parameter< int >::type bolusCmt(bolusCmtSEXP);
    Rcpp::traits::input_parameter< int >::type ndiff(ndiffSEXP);
    Rcpp::traits::input_parameter< int >::type sensType(sensTypeSEXP);
    Rcpp::traits::input_parameter< double >::type sensH(sensHSEXP);
    rcpp_result_gen = Rcpp::wrap(linCmtModelDouble(dt, p1, v1, p2, p3, p4, p5, ka, alastNV, rateNV, ncmt, oral0, trans, deriv, type, tau, tinf, amt, bolusCmt, ndiff, sensType, sensH));
    return rcpp_result_gen;
END_RCPP
}
// rxOmegaVarCovDeriv_
List rxOmegaVarCovDeriv_(arma::mat omega, int order);
RcppExport SEXP _rxode2_rxOmegaVarCovDeriv_(SEXP omegaSEXP, SEXP orderSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type omega(omegaSEXP);
    Rcpp::traits::input_parameter< int >::type order(orderSEXP);
    rcpp_result_gen = Rcpp::wrap(rxOmegaVarCovDeriv_(omega, order));
    return rcpp_result_gen;
END_RCPP
}
// rxQs
SEXP rxQs(SEXP const x);
RcppExport SEXP _rxode2_rxQs(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP const >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rxQs(x));
    return rcpp_result_gen;
END_RCPP
}
// rxQr
SEXP rxQr(SEXP const y);
RcppExport SEXP _rxode2_rxQr(SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP const >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(rxQr(y));
    return rcpp_result_gen;
END_RCPP
}
// rxode2parseSetRstudio
SEXP rxode2parseSetRstudio(bool isRstudio);
RcppExport SEXP _rxode2_rxode2parseSetRstudio(SEXP isRstudioSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< bool >::type isRstudio(isRstudioSEXP);
    rcpp_result_gen = Rcpp::wrap(rxode2parseSetRstudio(isRstudio));
    return rcpp_result_gen;
END_RCPP
}
// rxParseSetSilentErr
bool rxParseSetSilentErr(int silent);
RcppExport SEXP _rxode2_rxParseSetSilentErr(SEXP silentSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type silent(silentSEXP);
    rcpp_result_gen = Rcpp::wrap(rxParseSetSilentErr(silent));
    return rcpp_result_gen;
END_RCPP
}
// rxGetSerialType_
Rcpp::CharacterVector rxGetSerialType_(SEXP raw);
RcppExport SEXP _rxode2_rxGetSerialType_(SEXP rawSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type raw(rawSEXP);
    rcpp_result_gen = Rcpp::wrap(rxGetSerialType_(raw));
    return rcpp_result_gen;
END_RCPP
}
// rxIs
bool rxIs(const RObject& obj, std::string cls);
static SEXP _rxode2_rxIs_try(SEXP objSEXP, SEXP clsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< std::string >::type cls(clsSEXP);
    rcpp_result_gen = Rcpp::wrap(rxIs(obj, cls));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxIs(SEXP objSEXP, SEXP clsSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxIs_try(objSEXP, clsSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// dynLoad
SEXP dynLoad(std::string dll);
static SEXP _rxode2_dynLoad_try(SEXP dllSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< std::string >::type dll(dllSEXP);
    rcpp_result_gen = Rcpp::wrap(dynLoad(dll));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_dynLoad(SEXP dllSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_dynLoad_try(dllSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxModelVars_
List rxModelVars_(const RObject& obj);
static SEXP _rxode2_rxModelVars__try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxModelVars_(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxModelVars_(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxModelVars__try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxState
RObject rxState(const RObject& obj, RObject state);
static SEXP _rxode2_rxState_try(SEXP objSEXP, SEXP stateSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< RObject >::type state(stateSEXP);
    rcpp_result_gen = Rcpp::wrap(rxState(obj, state));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxState(SEXP objSEXP, SEXP stateSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxState_try(objSEXP, stateSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxParams_
CharacterVector rxParams_(const RObject& obj);
static SEXP _rxode2_rxParams__try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxParams_(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxParams_(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxParams__try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxDfdy
CharacterVector rxDfdy(const RObject& obj);
static SEXP _rxode2_rxDfdy_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxDfdy(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxDfdy(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxDfdy_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxLhs
CharacterVector rxLhs(const RObject& obj);
static SEXP _rxode2_rxLhs_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxLhs(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxLhs(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxLhs_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxInits
SEXP rxInits(const RObject& obj, RObject vec, Nullable<CharacterVector> req, double defaultValue, bool noerror, bool noini, bool rxLines);
static SEXP _rxode2_rxInits_try(SEXP objSEXP, SEXP vecSEXP, SEXP reqSEXP, SEXP defaultValueSEXP, SEXP noerrorSEXP, SEXP noiniSEXP, SEXP rxLinesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< RObject >::type vec(vecSEXP);
    Rcpp::traits::input_parameter< Nullable<CharacterVector> >::type req(reqSEXP);
    Rcpp::traits::input_parameter< double >::type defaultValue(defaultValueSEXP);
    Rcpp::traits::input_parameter< bool >::type noerror(noerrorSEXP);
    Rcpp::traits::input_parameter< bool >::type noini(noiniSEXP);
    Rcpp::traits::input_parameter< bool >::type rxLines(rxLinesSEXP);
    rcpp_result_gen = Rcpp::wrap(rxInits(obj, vec, req, defaultValue, noerror, noini, rxLines));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxInits(SEXP objSEXP, SEXP vecSEXP, SEXP reqSEXP, SEXP defaultValueSEXP, SEXP noerrorSEXP, SEXP noiniSEXP, SEXP rxLinesSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxInits_try(objSEXP, vecSEXP, reqSEXP, defaultValueSEXP, noerrorSEXP, noiniSEXP, rxLinesSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSetupIni
NumericVector rxSetupIni(const RObject& obj, RObject inits);
static SEXP _rxode2_rxSetupIni_try(SEXP objSEXP, SEXP initsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< RObject >::type inits(initsSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSetupIni(obj, inits));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSetupIni(SEXP objSEXP, SEXP initsSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSetupIni_try(objSEXP, initsSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSetupScale
NumericVector rxSetupScale(const RObject& obj, RObject scale, Nullable<List> extraArgs);
static SEXP _rxode2_rxSetupScale_try(SEXP objSEXP, SEXP scaleSEXP, SEXP extraArgsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< RObject >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< Nullable<List> >::type extraArgs(extraArgsSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSetupScale(obj, scale, extraArgs));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSetupScale(SEXP objSEXP, SEXP scaleSEXP, SEXP extraArgsSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSetupScale_try(objSEXP, scaleSEXP, extraArgsSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// atolRtolFactor_
void atolRtolFactor_(double factor);
static SEXP _rxode2_atolRtolFactor__try(SEXP factorSEXP) {
BEGIN_RCPP
    Rcpp::traits::input_parameter< double >::type factor(factorSEXP);
    atolRtolFactor_(factor);
    return R_NilValue;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_atolRtolFactor_(SEXP factorSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_atolRtolFactor__try(factorSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSimThetaOmega
List rxSimThetaOmega(const Nullable<NumericVector>& params, const RObject& omega, const Nullable<NumericVector>& omegaDf, const NumericVector& omegaLower, const NumericVector& omegaUpper, const bool& omegaIsChol, std::string omegaSeparation, const int omegaXform, int nSub, const Nullable<NumericMatrix>& thetaMat, const NumericVector& thetaLower, const NumericVector& thetaUpper, const Nullable<NumericVector>& thetaDf, const bool& thetaIsChol, int nStud, const RObject sigma, const NumericVector& sigmaLower, const NumericVector& sigmaUpper, const Nullable<NumericVector>& sigmaDf, const bool& sigmaIsChol, std::string sigmaSeparation, const int sigmaXform, int nCoresRV, int nObs, double dfSub, double dfObs, bool simSubjects, const LogicalVector& simVariability);
static SEXP _rxode2_rxSimThetaOmega_try(SEXP paramsSEXP, SEXP omegaSEXP, SEXP omegaDfSEXP, SEXP omegaLowerSEXP, SEXP omegaUpperSEXP, SEXP omegaIsCholSEXP, SEXP omegaSeparationSEXP, SEXP omegaXformSEXP, SEXP nSubSEXP, SEXP thetaMatSEXP, SEXP thetaLowerSEXP, SEXP thetaUpperSEXP, SEXP thetaDfSEXP, SEXP thetaIsCholSEXP, SEXP nStudSEXP, SEXP sigmaSEXP, SEXP sigmaLowerSEXP, SEXP sigmaUpperSEXP, SEXP sigmaDfSEXP, SEXP sigmaIsCholSEXP, SEXP sigmaSeparationSEXP, SEXP sigmaXformSEXP, SEXP nCoresRVSEXP, SEXP nObsSEXP, SEXP dfSubSEXP, SEXP dfObsSEXP, SEXP simSubjectsSEXP, SEXP simVariabilitySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const Nullable<NumericVector>& >::type params(paramsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type omega(omegaSEXP);
    Rcpp::traits::input_parameter< const Nullable<NumericVector>& >::type omegaDf(omegaDfSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type omegaLower(omegaLowerSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type omegaUpper(omegaUpperSEXP);
    Rcpp::traits::input_parameter< const bool& >::type omegaIsChol(omegaIsCholSEXP);
    Rcpp::traits::input_parameter< std::string >::type omegaSeparation(omegaSeparationSEXP);
    Rcpp::traits::input_parameter< const int >::type omegaXform(omegaXformSEXP);
    Rcpp::traits::input_parameter< int >::type nSub(nSubSEXP);
    Rcpp::traits::input_parameter< const Nullable<NumericMatrix>& >::type thetaMat(thetaMatSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type thetaLower(thetaLowerSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type thetaUpper(thetaUpperSEXP);
    Rcpp::traits::input_parameter< const Nullable<NumericVector>& >::type thetaDf(thetaDfSEXP);
    Rcpp::traits::input_parameter< const bool& >::type thetaIsChol(thetaIsCholSEXP);
    Rcpp::traits::input_parameter< int >::type nStud(nStudSEXP);
    Rcpp::traits::input_parameter< const RObject >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type sigmaLower(sigmaLowerSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type sigmaUpper(sigmaUpperSEXP);
    Rcpp::traits::input_parameter< const Nullable<NumericVector>& >::type sigmaDf(sigmaDfSEXP);
    Rcpp::traits::input_parameter< const bool& >::type sigmaIsChol(sigmaIsCholSEXP);
    Rcpp::traits::input_parameter< std::string >::type sigmaSeparation(sigmaSeparationSEXP);
    Rcpp::traits::input_parameter< const int >::type sigmaXform(sigmaXformSEXP);
    Rcpp::traits::input_parameter< int >::type nCoresRV(nCoresRVSEXP);
    Rcpp::traits::input_parameter< int >::type nObs(nObsSEXP);
    Rcpp::traits::input_parameter< double >::type dfSub(dfSubSEXP);
    Rcpp::traits::input_parameter< double >::type dfObs(dfObsSEXP);
    Rcpp::traits::input_parameter< bool >::type simSubjects(simSubjectsSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type simVariability(simVariabilitySEXP);
    rcpp_result_gen = Rcpp::wrap(rxSimThetaOmega(params, omega, omegaDf, omegaLower, omegaUpper, omegaIsChol, omegaSeparation, omegaXform, nSub, thetaMat, thetaLower, thetaUpper, thetaDf, thetaIsChol, nStud, sigma, sigmaLower, sigmaUpper, sigmaDf, sigmaIsChol, sigmaSeparation, sigmaXform, nCoresRV, nObs, dfSub, dfObs, simSubjects, simVariability));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSimThetaOmega(SEXP paramsSEXP, SEXP omegaSEXP, SEXP omegaDfSEXP, SEXP omegaLowerSEXP, SEXP omegaUpperSEXP, SEXP omegaIsCholSEXP, SEXP omegaSeparationSEXP, SEXP omegaXformSEXP, SEXP nSubSEXP, SEXP thetaMatSEXP, SEXP thetaLowerSEXP, SEXP thetaUpperSEXP, SEXP thetaDfSEXP, SEXP thetaIsCholSEXP, SEXP nStudSEXP, SEXP sigmaSEXP, SEXP sigmaLowerSEXP, SEXP sigmaUpperSEXP, SEXP sigmaDfSEXP, SEXP sigmaIsCholSEXP, SEXP sigmaSeparationSEXP, SEXP sigmaXformSEXP, SEXP nCoresRVSEXP, SEXP nObsSEXP, SEXP dfSubSEXP, SEXP dfObsSEXP, SEXP simSubjectsSEXP, SEXP simVariabilitySEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSimThetaOmega_try(paramsSEXP, omegaSEXP, omegaDfSEXP, omegaLowerSEXP, omegaUpperSEXP, omegaIsCholSEXP, omegaSeparationSEXP, omegaXformSEXP, nSubSEXP, thetaMatSEXP, thetaLowerSEXP, thetaUpperSEXP, thetaDfSEXP, thetaIsCholSEXP, nStudSEXP, sigmaSEXP, sigmaLowerSEXP, sigmaUpperSEXP, sigmaDfSEXP, sigmaIsCholSEXP, sigmaSeparationSEXP, sigmaXformSEXP, nCoresRVSEXP, nObsSEXP, dfSubSEXP, dfObsSEXP, simSubjectsSEXP, simVariabilitySEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveSetCurObj_
void rxSolveSetCurObj_(SEXP obj);
static SEXP _rxode2_rxSolveSetCurObj__try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::traits::input_parameter< SEXP >::type obj(objSEXP);
    rxSolveSetCurObj_(obj);
    return R_NilValue;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveSetCurObj_(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveSetCurObj__try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveFree
LogicalVector rxSolveFree();
static SEXP _rxode2_rxSolveFree_try() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    rcpp_result_gen = Rcpp::wrap(rxSolveFree());
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveFree() {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveFree_try());
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveSetup
LogicalVector rxSolveSetup();
static SEXP _rxode2_rxSolveSetup_try() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    rcpp_result_gen = Rcpp::wrap(rxSolveSetup());
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveSetup() {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveSetup_try());
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveFromRaw_
SEXP rxSolveFromRaw_(const RObject& obj, const RObject& rawObj, const RObject& solveState, const List& rxControl, const Nullable<CharacterVector>& specParams, const Nullable<List>& extraArgs, const RObject& params, const RObject& events, const RObject& inits);
static SEXP _rxode2_rxSolveFromRaw__try(SEXP objSEXP, SEXP rawObjSEXP, SEXP solveStateSEXP, SEXP rxControlSEXP, SEXP specParamsSEXP, SEXP extraArgsSEXP, SEXP paramsSEXP, SEXP eventsSEXP, SEXP initsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type rawObj(rawObjSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type solveState(solveStateSEXP);
    Rcpp::traits::input_parameter< const List& >::type rxControl(rxControlSEXP);
    Rcpp::traits::input_parameter< const Nullable<CharacterVector>& >::type specParams(specParamsSEXP);
    Rcpp::traits::input_parameter< const Nullable<List>& >::type extraArgs(extraArgsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type params(paramsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type events(eventsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type inits(initsSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSolveFromRaw_(obj, rawObj, solveState, rxControl, specParams, extraArgs, params, events, inits));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveFromRaw_(SEXP objSEXP, SEXP rawObjSEXP, SEXP solveStateSEXP, SEXP rxControlSEXP, SEXP specParamsSEXP, SEXP extraArgsSEXP, SEXP paramsSEXP, SEXP eventsSEXP, SEXP initsSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveFromRaw__try(objSEXP, rawObjSEXP, solveStateSEXP, rxControlSEXP, specParamsSEXP, extraArgsSEXP, paramsSEXP, eventsSEXP, initsSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolve_
SEXP rxSolve_(const RObject& obj, const List& rxControl, const Nullable<CharacterVector>& specParams, const Nullable<List>& extraArgs, const RObject& params, const RObject& events, const RObject& inits, const int setupOnly);
static SEXP _rxode2_rxSolve__try(SEXP objSEXP, SEXP rxControlSEXP, SEXP specParamsSEXP, SEXP extraArgsSEXP, SEXP paramsSEXP, SEXP eventsSEXP, SEXP initsSEXP, SEXP setupOnlySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< const RObject& >::type obj(objSEXP);
    Rcpp::traits::input_parameter< const List& >::type rxControl(rxControlSEXP);
    Rcpp::traits::input_parameter< const Nullable<CharacterVector>& >::type specParams(specParamsSEXP);
    Rcpp::traits::input_parameter< const Nullable<List>& >::type extraArgs(extraArgsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type params(paramsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type events(eventsSEXP);
    Rcpp::traits::input_parameter< const RObject& >::type inits(initsSEXP);
    Rcpp::traits::input_parameter< const int >::type setupOnly(setupOnlySEXP);
    rcpp_result_gen = Rcpp::wrap(rxSolve_(obj, rxControl, specParams, extraArgs, params, events, inits, setupOnly));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolve_(SEXP objSEXP, SEXP rxControlSEXP, SEXP specParamsSEXP, SEXP extraArgsSEXP, SEXP paramsSEXP, SEXP eventsSEXP, SEXP initsSEXP, SEXP setupOnlySEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolve__try(objSEXP, rxControlSEXP, specParamsSEXP, extraArgsSEXP, paramsSEXP, eventsSEXP, initsSEXP, setupOnlySEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveDollarNames
CharacterVector rxSolveDollarNames(RObject obj);
static SEXP _rxode2_rxSolveDollarNames_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSolveDollarNames(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveDollarNames(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveDollarNames_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveGet
RObject rxSolveGet(RObject obj, RObject arg, LogicalVector exact);
static SEXP _rxode2_rxSolveGet_try(SEXP objSEXP, SEXP argSEXP, SEXP exactSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    Rcpp::traits::input_parameter< RObject >::type arg(argSEXP);
    Rcpp::traits::input_parameter< LogicalVector >::type exact(exactSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSolveGet(obj, arg, exact));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveGet(SEXP objSEXP, SEXP argSEXP, SEXP exactSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveGet_try(objSEXP, argSEXP, exactSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveUpdate
RObject rxSolveUpdate(RObject obj, RObject arg, RObject value);
static SEXP _rxode2_rxSolveUpdate_try(SEXP objSEXP, SEXP argSEXP, SEXP valueSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    Rcpp::traits::input_parameter< RObject >::type arg(argSEXP);
    Rcpp::traits::input_parameter< RObject >::type value(valueSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSolveUpdate(obj, arg, value));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveUpdate(SEXP objSEXP, SEXP argSEXP, SEXP valueSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveUpdate_try(objSEXP, argSEXP, valueSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSolveSEXP
SEXP rxSolveSEXP(SEXP objS, SEXP rxControlS, SEXP specParamsS, SEXP extraArgsS, SEXP paramsS, SEXP eventsS, SEXP initsS, SEXP setupOnlyS);
static SEXP _rxode2_rxSolveSEXP_try(SEXP objSSEXP, SEXP rxControlSSEXP, SEXP specParamsSSEXP, SEXP extraArgsSSEXP, SEXP paramsSSEXP, SEXP eventsSSEXP, SEXP initsSSEXP, SEXP setupOnlySSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type objS(objSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type rxControlS(rxControlSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type specParamsS(specParamsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type extraArgsS(extraArgsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type paramsS(paramsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type eventsS(eventsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type initsS(initsSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type setupOnlyS(setupOnlySSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSolveSEXP(objS, rxControlS, specParamsS, extraArgsS, paramsS, eventsS, initsS, setupOnlyS));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSolveSEXP(SEXP objSSEXP, SEXP rxControlSSEXP, SEXP specParamsSSEXP, SEXP extraArgsSSEXP, SEXP paramsSSEXP, SEXP eventsSSEXP, SEXP initsSSEXP, SEXP setupOnlySSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSolveSEXP_try(objSSEXP, rxControlSSEXP, specParamsSSEXP, extraArgsSSEXP, paramsSSEXP, eventsSSEXP, initsSSEXP, setupOnlySSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxRmModelLib_
void rxRmModelLib_(std::string str);
static SEXP _rxode2_rxRmModelLib__try(SEXP strSEXP) {
BEGIN_RCPP
    Rcpp::traits::input_parameter< std::string >::type str(strSEXP);
    rxRmModelLib_(str);
    return R_NilValue;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxRmModelLib_(SEXP strSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxRmModelLib__try(strSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxGetrxode2
RObject rxGetrxode2(RObject obj);
static SEXP _rxode2_rxGetrxode2_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxGetrxode2(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxGetrxode2(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxGetrxode2_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxIsCurrent
bool rxIsCurrent(RObject obj);
static SEXP _rxode2_rxIsCurrent_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxIsCurrent(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxIsCurrent(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxIsCurrent_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxAssignPtr
void rxAssignPtr(SEXP object);
static SEXP _rxode2_rxAssignPtr_try(SEXP objectSEXP) {
BEGIN_RCPP
    Rcpp::traits::input_parameter< SEXP >::type object(objectSEXP);
    rxAssignPtr(object);
    return R_NilValue;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxAssignPtr(SEXP objectSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxAssignPtr_try(objectSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxDll
std::string rxDll(RObject obj);
static SEXP _rxode2_rxDll_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxDll(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxDll(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxDll_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxC
CharacterVector rxC(RObject obj);
static SEXP _rxode2_rxC_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxC(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxC(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxC_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxIsLoaded
bool rxIsLoaded(RObject obj);
static SEXP _rxode2_rxIsLoaded_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxIsLoaded(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxIsLoaded(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxIsLoaded_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxDynLoad
bool rxDynLoad(RObject obj);
static SEXP _rxode2_rxDynLoad_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxDynLoad(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxDynLoad(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxDynLoad_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxLock
RObject rxLock(RObject obj);
static SEXP _rxode2_rxLock_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxLock(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxLock(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxLock_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxUnlock
RObject rxUnlock(RObject obj);
static SEXP _rxode2_rxUnlock_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxUnlock(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxUnlock(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxUnlock_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxAllowUnload
bool rxAllowUnload(bool allow);
static SEXP _rxode2_rxAllowUnload_try(SEXP allowSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< bool >::type allow(allowSEXP);
    rcpp_result_gen = Rcpp::wrap(rxAllowUnload(allow));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxAllowUnload(SEXP allowSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxAllowUnload_try(allowSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxUnloadAll_
RObject rxUnloadAll_();
static SEXP _rxode2_rxUnloadAll__try() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    rcpp_result_gen = Rcpp::wrap(rxUnloadAll_());
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxUnloadAll_() {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxUnloadAll__try());
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxDynUnload
bool rxDynUnload(RObject obj);
static SEXP _rxode2_rxDynUnload_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxDynUnload(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxDynUnload(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxDynUnload_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxDelete
bool rxDelete(RObject obj);
static SEXP _rxode2_rxDelete_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(rxDelete(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxDelete(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxDelete_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// setRstudio
SEXP setRstudio(bool isRstudio);
static SEXP _rxode2_setRstudio_try(SEXP isRstudioSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< bool >::type isRstudio(isRstudioSEXP);
    rcpp_result_gen = Rcpp::wrap(setRstudio(isRstudio));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_setRstudio(SEXP isRstudioSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_setRstudio_try(isRstudioSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// setProgSupported
SEXP setProgSupported(int isSupported);
static SEXP _rxode2_setProgSupported_try(SEXP isSupportedSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< int >::type isSupported(isSupportedSEXP);
    rcpp_result_gen = Rcpp::wrap(setProgSupported(isSupported));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_setProgSupported(SEXP isSupportedSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_setProgSupported_try(isSupportedSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getProgSupported
SEXP getProgSupported();
static SEXP _rxode2_getProgSupported_try() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    rcpp_result_gen = Rcpp::wrap(getProgSupported());
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_getProgSupported() {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_getProgSupported_try());
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxUpdateTrans_
List rxUpdateTrans_(List ret, std::string prefix, std::string libName);
static SEXP _rxode2_rxUpdateTrans__try(SEXP retSEXP, SEXP prefixSEXP, SEXP libNameSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< List >::type ret(retSEXP);
    Rcpp::traits::input_parameter< std::string >::type prefix(prefixSEXP);
    Rcpp::traits::input_parameter< std::string >::type libName(libNameSEXP);
    rcpp_result_gen = Rcpp::wrap(rxUpdateTrans_(ret, prefix, libName));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxUpdateTrans_(SEXP retSEXP, SEXP prefixSEXP, SEXP libNameSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxUpdateTrans__try(retSEXP, prefixSEXP, libNameSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// dropUnitsRxSolve
List dropUnitsRxSolve(List x);
static SEXP _rxode2_dropUnitsRxSolve_try(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< List >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(dropUnitsRxSolve(x));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_dropUnitsRxSolve(SEXP xSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_dropUnitsRxSolve_try(xSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSetSilentErr
bool rxSetSilentErr(int silent);
static SEXP _rxode2_rxSetSilentErr_try(SEXP silentSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< int >::type silent(silentSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSetSilentErr(silent));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSetSilentErr(SEXP silentSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSetSilentErr_try(silentSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxInv
NumericVector rxInv(SEXP matrix);
static SEXP _rxode2_rxInv_try(SEXP matrixSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type matrix(matrixSEXP);
    rcpp_result_gen = Rcpp::wrap(rxInv(matrix));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxInv(SEXP matrixSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxInv_try(matrixSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSymInvChol
RObject rxSymInvChol(RObject invObjOrMatrix, Nullable<NumericVector> theta, std::string type, int thetaNumber);
static SEXP _rxode2_rxSymInvChol_try(SEXP invObjOrMatrixSEXP, SEXP thetaSEXP, SEXP typeSEXP, SEXP thetaNumberSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type invObjOrMatrix(invObjOrMatrixSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< std::string >::type type(typeSEXP);
    Rcpp::traits::input_parameter< int >::type thetaNumber(thetaNumberSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSymInvChol(invObjOrMatrix, theta, type, thetaNumber));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSymInvChol(SEXP invObjOrMatrixSEXP, SEXP thetaSEXP, SEXP typeSEXP, SEXP thetaNumberSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSymInvChol_try(invObjOrMatrixSEXP, thetaSEXP, typeSEXP, thetaNumberSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxSymInvCholEnvCalculate
RObject rxSymInvCholEnvCalculate(List obj, std::string what, Nullable<NumericVector> theta);
static SEXP _rxode2_rxSymInvCholEnvCalculate_try(SEXP objSEXP, SEXP whatSEXP, SEXP thetaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< List >::type obj(objSEXP);
    Rcpp::traits::input_parameter< std::string >::type what(whatSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type theta(thetaSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSymInvCholEnvCalculate(obj, what, theta));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSymInvCholEnvCalculate(SEXP objSEXP, SEXP whatSEXP, SEXP thetaSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSymInvCholEnvCalculate_try(objSEXP, whatSEXP, thetaSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxMemoryComponents_
NumericVector rxMemoryComponents_(int neq, int stateSize, int nlhs, int npars, int neta, int neps, int ncov, int nsim, int cores, int nMtime, int extraCmt, int linB, int nLlik, int nIndSim, int numLinSens, int numLin, int nsub, double nallTotal, double maxAllTimes);
static SEXP _rxode2_rxMemoryComponents__try(SEXP neqSEXP, SEXP stateSizeSEXP, SEXP nlhsSEXP, SEXP nparsSEXP, SEXP netaSEXP, SEXP nepsSEXP, SEXP ncovSEXP, SEXP nsimSEXP, SEXP coresSEXP, SEXP nMtimeSEXP, SEXP extraCmtSEXP, SEXP linBSEXP, SEXP nLlikSEXP, SEXP nIndSimSEXP, SEXP numLinSensSEXP, SEXP numLinSEXP, SEXP nsubSEXP, SEXP nallTotalSEXP, SEXP maxAllTimesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< int >::type neq(neqSEXP);
    Rcpp::traits::input_parameter< int >::type stateSize(stateSizeSEXP);
    Rcpp::traits::input_parameter< int >::type nlhs(nlhsSEXP);
    Rcpp::traits::input_parameter< int >::type npars(nparsSEXP);
    Rcpp::traits::input_parameter< int >::type neta(netaSEXP);
    Rcpp::traits::input_parameter< int >::type neps(nepsSEXP);
    Rcpp::traits::input_parameter< int >::type ncov(ncovSEXP);
    Rcpp::traits::input_parameter< int >::type nsim(nsimSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< int >::type nMtime(nMtimeSEXP);
    Rcpp::traits::input_parameter< int >::type extraCmt(extraCmtSEXP);
    Rcpp::traits::input_parameter< int >::type linB(linBSEXP);
    Rcpp::traits::input_parameter< int >::type nLlik(nLlikSEXP);
    Rcpp::traits::input_parameter< int >::type nIndSim(nIndSimSEXP);
    Rcpp::traits::input_parameter< int >::type numLinSens(numLinSensSEXP);
    Rcpp::traits::input_parameter< int >::type numLin(numLinSEXP);
    Rcpp::traits::input_parameter< int >::type nsub(nsubSEXP);
    Rcpp::traits::input_parameter< double >::type nallTotal(nallTotalSEXP);
    Rcpp::traits::input_parameter< double >::type maxAllTimes(maxAllTimesSEXP);
    rcpp_result_gen = Rcpp::wrap(rxMemoryComponents_(neq, stateSize, nlhs, npars, neta, neps, ncov, nsim, cores, nMtime, extraCmt, linB, nLlik, nIndSim, numLinSens, numLin, nsub, nallTotal, maxAllTimes));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxMemoryComponents_(SEXP neqSEXP, SEXP stateSizeSEXP, SEXP nlhsSEXP, SEXP nparsSEXP, SEXP netaSEXP, SEXP nepsSEXP, SEXP ncovSEXP, SEXP nsimSEXP, SEXP coresSEXP, SEXP nMtimeSEXP, SEXP extraCmtSEXP, SEXP linBSEXP, SEXP nLlikSEXP, SEXP nIndSimSEXP, SEXP numLinSensSEXP, SEXP numLinSEXP, SEXP nsubSEXP, SEXP nallTotalSEXP, SEXP maxAllTimesSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxMemoryComponents__try(neqSEXP, stateSizeSEXP, nlhsSEXP, nparsSEXP, netaSEXP, nepsSEXP, ncovSEXP, nsimSEXP, coresSEXP, nMtimeSEXP, extraCmtSEXP, linBSEXP, nLlikSEXP, nIndSimSEXP, numLinSensSEXP, numLinSEXP, nsubSEXP, nallTotalSEXP, maxAllTimesSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxOptRep_
RObject rxOptRep_(RObject input);
RcppExport SEXP _rxode2_rxOptRep_(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(rxOptRep_(input));
    return rcpp_result_gen;
END_RCPP
}
// rxSaveState_
SEXP rxSaveState_();
static SEXP _rxode2_rxSaveState__try() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    rcpp_result_gen = Rcpp::wrap(rxSaveState_());
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxSaveState_() {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxSaveState__try());
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxIsSerializeFile_
bool rxIsSerializeFile_(SEXP rawSexp);
static SEXP _rxode2_rxIsSerializeFile__try(SEXP rawSexpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type rawSexp(rawSexpSEXP);
    rcpp_result_gen = Rcpp::wrap(rxIsSerializeFile_(rawSexp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxIsSerializeFile_(SEXP rawSexpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxIsSerializeFile__try(rawSexpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxRestoreState_
SEXP rxRestoreState_(SEXP rawSexp);
static SEXP _rxode2_rxRestoreState__try(SEXP rawSexpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type rawSexp(rawSexpSEXP);
    rcpp_result_gen = Rcpp::wrap(rxRestoreState_(rawSexp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxRestoreState_(SEXP rawSexpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxRestoreState__try(rawSexpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxStack_
List rxStack_(List Data, Nullable<CharacterVector> vars);
RcppExport SEXP _rxode2_rxStack_(SEXP DataSEXP, SEXP varsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type Data(DataSEXP);
    Rcpp::traits::input_parameter< Nullable<CharacterVector> >::type vars(varsSEXP);
    rcpp_result_gen = Rcpp::wrap(rxStack_(Data, vars));
    return rcpp_result_gen;
END_RCPP
}
// rxModelVarsStack
RObject rxModelVarsStack(RObject x);
RcppExport SEXP _rxode2_rxModelVarsStack(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rxModelVarsStack(x));
    return rcpp_result_gen;
END_RCPP
}
// rxRmvn_
SEXP rxRmvn_(NumericMatrix A_, arma::rowvec mu, arma::mat sigma, int ncores, bool isChol);
RcppExport SEXP _rxode2_rxRmvn_(SEXP A_SEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP ncoresSEXP, SEXP isCholSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type A_(A_SEXP);
    Rcpp::traits::input_parameter< arma::rowvec >::type mu(muSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< bool >::type isChol(isCholSEXP);
    rcpp_result_gen = Rcpp::wrap(rxRmvn_(A_, mu, sigma, ncores, isChol));
    return rcpp_result_gen;
END_RCPP
}
// rxMvnrnd
List rxMvnrnd(int n, arma::mat& L, arma::vec& l, arma::vec& u, arma::vec mu, double a, double tol);
RcppExport SEXP _rxode2_rxMvnrnd(SEXP nSEXP, SEXP LSEXP, SEXP lSEXP, SEXP uSEXP, SEXP muSEXP, SEXP aSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type L(LSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type l(lSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type u(uSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type mu(muSEXP);
    Rcpp::traits::input_parameter< double >::type a(aSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(rxMvnrnd(n, L, l, u, mu, a, tol));
    return rcpp_result_gen;
END_RCPP
}
// rxCholperm
List rxCholperm(arma::mat Sig, arma::vec l, arma::vec u, double eps);
RcppExport SEXP _rxode2_rxCholperm(SEXP SigSEXP, SEXP lSEXP, SEXP uSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type Sig(SigSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type l(lSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type u(uSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(rxCholperm(Sig, l, u, eps));
    return rcpp_result_gen;
END_RCPP
}
// rxGradpsi
List rxGradpsi(arma::vec y, arma::mat L, arma::vec l, arma::vec u);
RcppExport SEXP _rxode2_rxGradpsi(SEXP ySEXP, SEXP LSEXP, SEXP lSEXP, SEXP uSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type y(ySEXP);
    Rcpp::traits::input_parameter< arma::mat >::type L(LSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type l(lSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type u(uSEXP);
    rcpp_result_gen = Rcpp::wrap(rxGradpsi(y, L, l, u));
    return rcpp_result_gen;
END_RCPP
}
// rxNleq
NumericVector rxNleq(arma::vec l, arma::vec u, arma::mat L);
RcppExport SEXP _rxode2_rxNleq(SEXP lSEXP, SEXP uSEXP, SEXP LSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type l(lSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type u(uSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type L(LSEXP);
    rcpp_result_gen = Rcpp::wrap(rxNleq(l, u, L));
    return rcpp_result_gen;
END_RCPP
}
// rxMvrandn_
arma::mat rxMvrandn_(NumericMatrix A_, arma::rowvec mu, arma::mat sigma, arma::vec lower, arma::vec upper, int ncores, double a, double tol, double nlTol, int nlMaxiter);
RcppExport SEXP _rxode2_rxMvrandn_(SEXP A_SEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP ncoresSEXP, SEXP aSEXP, SEXP tolSEXP, SEXP nlTolSEXP, SEXP nlMaxiterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type A_(A_SEXP);
    Rcpp::traits::input_parameter< arma::rowvec >::type mu(muSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< double >::type a(aSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< double >::type nlTol(nlTolSEXP);
    Rcpp::traits::input_parameter< int >::type nlMaxiter(nlMaxiterSEXP);
    rcpp_result_gen = Rcpp::wrap(rxMvrandn_(A_, mu, sigma, lower, upper, ncores, a, tol, nlTol, nlMaxiter));
    return rcpp_result_gen;
END_RCPP
}
// rxSeedEng
RObject rxSeedEng(int ncores);
RcppExport SEXP _rxode2_rxSeedEng(SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxSeedEng(ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxnbinomMu_
IntegerVector rxnbinomMu_(int size, double mu, int n, int ncores);
RcppExport SEXP _rxode2_rxnbinomMu_(SEXP sizeSEXP, SEXP muSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type size(sizeSEXP);
    Rcpp::traits::input_parameter< double >::type mu(muSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxnbinomMu_(size, mu, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxnbinom_
IntegerVector rxnbinom_(double size, double prob, int n, int ncores);
RcppExport SEXP _rxode2_rxnbinom_(SEXP sizeSEXP, SEXP probSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type size(sizeSEXP);
    Rcpp::traits::input_parameter< double >::type prob(probSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxnbinom_(size, prob, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxbinom_
IntegerVector rxbinom_(int n0, double prob, int n, int ncores);
RcppExport SEXP _rxode2_rxbinom_(SEXP n0SEXP, SEXP probSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type n0(n0SEXP);
    Rcpp::traits::input_parameter< double >::type prob(probSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxbinom_(n0, prob, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxcauchy_
NumericVector rxcauchy_(double location, double scale, int n, int ncores);
RcppExport SEXP _rxode2_rxcauchy_(SEXP locationSEXP, SEXP scaleSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type location(locationSEXP);
    Rcpp::traits::input_parameter< double >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxcauchy_(location, scale, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxchisq_
NumericVector rxchisq_(double df, int n, int ncores);
RcppExport SEXP _rxode2_rxchisq_(SEXP dfSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type df(dfSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxchisq_(df, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxexp_
NumericVector rxexp_(double rate, int n, int ncores);
RcppExport SEXP _rxode2_rxexp_(SEXP rateSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type rate(rateSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxexp_(rate, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxf_
NumericVector rxf_(double df1, double df2, int n, int ncores);
RcppExport SEXP _rxode2_rxf_(SEXP df1SEXP, SEXP df2SEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type df1(df1SEXP);
    Rcpp::traits::input_parameter< double >::type df2(df2SEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxf_(df1, df2, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxgamma_
NumericVector rxgamma_(double shape, double rate, int n, int ncores);
RcppExport SEXP _rxode2_rxgamma_(SEXP shapeSEXP, SEXP rateSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type shape(shapeSEXP);
    Rcpp::traits::input_parameter< double >::type rate(rateSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxgamma_(shape, rate, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxbeta_
NumericVector rxbeta_(double shape1, double shape2, int n, int ncores);
RcppExport SEXP _rxode2_rxbeta_(SEXP shape1SEXP, SEXP shape2SEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type shape1(shape1SEXP);
    Rcpp::traits::input_parameter< double >::type shape2(shape2SEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxbeta_(shape1, shape2, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxgeom_
IntegerVector rxgeom_(double prob, int n, int ncores);
RcppExport SEXP _rxode2_rxgeom_(SEXP probSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type prob(probSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxgeom_(prob, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxnorm_
NumericVector rxnorm_(double mean, double sd, int n, int ncores);
RcppExport SEXP _rxode2_rxnorm_(SEXP meanSEXP, SEXP sdSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type mean(meanSEXP);
    Rcpp::traits::input_parameter< double >::type sd(sdSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxnorm_(mean, sd, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxpois_
IntegerVector rxpois_(double lambda, int n, int ncores);
RcppExport SEXP _rxode2_rxpois_(SEXP lambdaSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxpois_(lambda, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxt__
NumericVector rxt__(double df, int n, int ncores);
RcppExport SEXP _rxode2_rxt__(SEXP dfSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type df(dfSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxt__(df, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxunif_
NumericVector rxunif_(double low, double hi, int n, int ncores);
RcppExport SEXP _rxode2_rxunif_(SEXP lowSEXP, SEXP hiSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type low(lowSEXP);
    Rcpp::traits::input_parameter< double >::type hi(hiSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxunif_(low, hi, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxweibull_
NumericVector rxweibull_(double shape, double scale, int n, int ncores);
RcppExport SEXP _rxode2_rxweibull_(SEXP shapeSEXP, SEXP scaleSEXP, SEXP nSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type shape(shapeSEXP);
    Rcpp::traits::input_parameter< double >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(rxweibull_(shape, scale, n, ncores));
    return rcpp_result_gen;
END_RCPP
}
// rxRmvn0
SEXP rxRmvn0(NumericMatrix& A_, arma::rowvec mu, arma::mat sigma, arma::vec lower, arma::vec upper, int ncores, bool isChol, double a, double tol, double nlTol, int nlMaxiter);
RcppExport SEXP _rxode2_rxRmvn0(SEXP A_SEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP ncoresSEXP, SEXP isCholSEXP, SEXP aSEXP, SEXP tolSEXP, SEXP nlTolSEXP, SEXP nlMaxiterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix& >::type A_(A_SEXP);
    Rcpp::traits::input_parameter< arma::rowvec >::type mu(muSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< bool >::type isChol(isCholSEXP);
    Rcpp::traits::input_parameter< double >::type a(aSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< double >::type nlTol(nlTolSEXP);
    Rcpp::traits::input_parameter< int >::type nlMaxiter(nlMaxiterSEXP);
    rcpp_result_gen = Rcpp::wrap(rxRmvn0(A_, mu, sigma, lower, upper, ncores, isChol, a, tol, nlTol, nlMaxiter));
    return rcpp_result_gen;
END_RCPP
}
// rxRmvnSEXP
SEXP rxRmvnSEXP(SEXP nS, SEXP muS, SEXP sigmaS, SEXP lowerS, SEXP upperS, SEXP ncoresS, SEXP isCholS, SEXP keepNamesS, SEXP aS, SEXP tolS, SEXP nlTolS, SEXP nlMaxiterS);
RcppExport SEXP _rxode2_rxRmvnSEXP(SEXP nSSEXP, SEXP muSSEXP, SEXP sigmaSSEXP, SEXP lowerSSEXP, SEXP upperSSEXP, SEXP ncoresSSEXP, SEXP isCholSSEXP, SEXP keepNamesSSEXP, SEXP aSSEXP, SEXP tolSSEXP, SEXP nlTolSSEXP, SEXP nlMaxiterSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type nS(nSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type muS(muSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type sigmaS(sigmaSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type lowerS(lowerSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type upperS(upperSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type ncoresS(ncoresSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type isCholS(isCholSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type keepNamesS(keepNamesSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type aS(aSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type tolS(tolSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type nlTolS(nlTolSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type nlMaxiterS(nlMaxiterSSEXP);
    rcpp_result_gen = Rcpp::wrap(rxRmvnSEXP(nS, muS, sigmaS, lowerS, upperS, ncoresS, isCholS, keepNamesS, aS, tolS, nlTolS, nlMaxiterS));
    return rcpp_result_gen;
END_RCPP
}
// rpp_
NumericVector rpp_(SEXP nS, SEXP lambdaS, SEXP gammaS, SEXP probS, SEXP t0S, SEXP tmaxS, SEXP randomOrderS);
RcppExport SEXP _rxode2_rpp_(SEXP nSSEXP, SEXP lambdaSSEXP, SEXP gammaSSEXP, SEXP probSSEXP, SEXP t0SSEXP, SEXP tmaxSSEXP, SEXP randomOrderSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type nS(nSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type lambdaS(lambdaSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type gammaS(gammaSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type probS(probSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type t0S(t0SSEXP);
    Rcpp::traits::input_parameter< SEXP >::type tmaxS(tmaxSSEXP);
    Rcpp::traits::input_parameter< SEXP >::type randomOrderS(randomOrderSSEXP);
    rcpp_result_gen = Rcpp::wrap(rpp_(nS, lambdaS, gammaS, probS, t0S, tmaxS, randomOrderS));
    return rcpp_result_gen;
END_RCPP
}
// rxordSelect
double rxordSelect(double u, NumericVector cs);
RcppExport SEXP _rxode2_rxordSelect(SEXP uSEXP, SEXP csSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type u(uSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type cs(csSEXP);
    rcpp_result_gen = Rcpp::wrap(rxordSelect(u, cs));
    return rcpp_result_gen;
END_RCPP
}
// isNullZero
LogicalVector isNullZero(RObject obj);
static SEXP _rxode2_isNullZero_try(SEXP objSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< RObject >::type obj(objSEXP);
    rcpp_result_gen = Rcpp::wrap(isNullZero(obj));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_isNullZero(SEXP objSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_isNullZero_try(objSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// rxErf
NumericVector rxErf(NumericVector v);
static SEXP _rxode2_rxErf_try(SEXP vSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< NumericVector >::type v(vSEXP);
    rcpp_result_gen = Rcpp::wrap(rxErf(v));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_rxErf(SEXP vSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_rxErf_try(vSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// binomProbsPredVec_
NumericVector binomProbsPredVec_(int n, int m, int Y, int M, bool doP, double tol);
static SEXP _rxode2_binomProbsPredVec__try(SEXP nSEXP, SEXP mSEXP, SEXP YSEXP, SEXP MSEXP, SEXP doPSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type m(mSEXP);
    Rcpp::traits::input_parameter< int >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type M(MSEXP);
    Rcpp::traits::input_parameter< bool >::type doP(doPSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(binomProbsPredVec_(n, m, Y, M, doP, tol));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_binomProbsPredVec_(SEXP nSEXP, SEXP mSEXP, SEXP YSEXP, SEXP MSEXP, SEXP doPSEXP, SEXP tolSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_binomProbsPredVec__try(nSEXP, mSEXP, YSEXP, MSEXP, doPSEXP, tolSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// binomProbs_
NumericVector binomProbs_(NumericVector x, NumericVector probs, bool naRm, int nIn, int cont);
static SEXP _rxode2_binomProbs__try(SEXP xSEXP, SEXP probsSEXP, SEXP naRmSEXP, SEXP nInSEXP, SEXP contSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< bool >::type naRm(naRmSEXP);
    Rcpp::traits::input_parameter< int >::type nIn(nInSEXP);
    Rcpp::traits::input_parameter< int >::type cont(contSEXP);
    rcpp_result_gen = Rcpp::wrap(binomProbs_(x, probs, naRm, nIn, cont));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_binomProbs_(SEXP xSEXP, SEXP probsSEXP, SEXP naRmSEXP, SEXP nInSEXP, SEXP contSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_binomProbs__try(xSEXP, probsSEXP, naRmSEXP, nInSEXP, contSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// meanProbs_
NumericVector meanProbs_(NumericVector x, NumericVector probs, bool naRm, bool useT, bool pred, int nIn);
static SEXP _rxode2_meanProbs__try(SEXP xSEXP, SEXP probsSEXP, SEXP naRmSEXP, SEXP useTSEXP, SEXP predSEXP, SEXP nInSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< bool >::type naRm(naRmSEXP);
    Rcpp::traits::input_parameter< bool >::type useT(useTSEXP);
    Rcpp::traits::input_parameter< bool >::type pred(predSEXP);
    Rcpp::traits::input_parameter< int >::type nIn(nInSEXP);
    rcpp_result_gen = Rcpp::wrap(meanProbs_(x, probs, naRm, useT, pred, nIn));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _rxode2_meanProbs_(SEXP xSEXP, SEXP probsSEXP, SEXP naRmSEXP, SEXP useTSEXP, SEXP predSEXP, SEXP nInSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_rxode2_meanProbs__try(xSEXP, probsSEXP, naRmSEXP, useTSEXP, predSEXP, nInSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}

// validate (ensure exported C++ functions exist before calling them)
static int _rxode2_RcppExport_validate(const char* sig) { 
    static std::set<std::string> signatures;
    if (signatures.empty()) {
        signatures.insert("List(*rxExpandGrid_)(RObject&,RObject&,RObject&)");
        signatures.insert("List(*rxExpandSens_)(CharacterVector,CharacterVector)");
        signatures.insert("List(*rxExpandSens2_)(CharacterVector,CharacterVector,CharacterVector)");
        signatures.insert("List(*rxExpandSens3_)(CharacterVector,CharacterVector,CharacterVector,CharacterVector)");
        signatures.insert("List(*rxExpandFEta_)(CharacterVector,int,int,bool)");
        signatures.insert("std::string(*rxRepR0_)(int)");
        signatures.insert("List(*rxExpandNesting)(const RObject&,List&,bool)");
        signatures.insert("bool(*rxIs)(const RObject&,std::string)");
        signatures.insert("SEXP(*dynLoad)(std::string)");
        signatures.insert("List(*rxModelVars_)(const RObject&)");
        signatures.insert("RObject(*rxState)(const RObject&,RObject)");
        signatures.insert("CharacterVector(*rxParams_)(const RObject&)");
        signatures.insert("CharacterVector(*rxDfdy)(const RObject&)");
        signatures.insert("CharacterVector(*rxLhs)(const RObject&)");
        signatures.insert("SEXP(*rxInits)(const RObject&,RObject,Nullable<CharacterVector>,double,bool,bool,bool)");
        signatures.insert("NumericVector(*rxSetupIni)(const RObject&,RObject)");
        signatures.insert("NumericVector(*rxSetupScale)(const RObject&,RObject,Nullable<List>)");
        signatures.insert("void(*atolRtolFactor_)(double)");
        signatures.insert("List(*rxSimThetaOmega)(const Nullable<NumericVector>&,const RObject&,const Nullable<NumericVector>&,const NumericVector&,const NumericVector&,const bool&,std::string,const int,int,const Nullable<NumericMatrix>&,const NumericVector&,const NumericVector&,const Nullable<NumericVector>&,const bool&,int,const RObject,const NumericVector&,const NumericVector&,const Nullable<NumericVector>&,const bool&,std::string,const int,int,int,double,double,bool,const LogicalVector&)");
        signatures.insert("void(*rxSolveSetCurObj_)(SEXP)");
        signatures.insert("LogicalVector(*rxSolveFree)()");
        signatures.insert("LogicalVector(*rxSolveSetup)()");
        signatures.insert("SEXP(*rxSolveFromRaw_)(const RObject&,const RObject&,const RObject&,const List&,const Nullable<CharacterVector>&,const Nullable<List>&,const RObject&,const RObject&,const RObject&)");
        signatures.insert("SEXP(*rxSolve_)(const RObject&,const List&,const Nullable<CharacterVector>&,const Nullable<List>&,const RObject&,const RObject&,const RObject&,const int)");
        signatures.insert("CharacterVector(*rxSolveDollarNames)(RObject)");
        signatures.insert("RObject(*rxSolveGet)(RObject,RObject,LogicalVector)");
        signatures.insert("RObject(*rxSolveUpdate)(RObject,RObject,RObject)");
        signatures.insert("SEXP(*rxSolveSEXP)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP)");
        signatures.insert("void(*rxRmModelLib_)(std::string)");
        signatures.insert("RObject(*rxGetrxode2)(RObject)");
        signatures.insert("bool(*rxIsCurrent)(RObject)");
        signatures.insert("void(*rxAssignPtr)(SEXP)");
        signatures.insert("std::string(*rxDll)(RObject)");
        signatures.insert("CharacterVector(*rxC)(RObject)");
        signatures.insert("bool(*rxIsLoaded)(RObject)");
        signatures.insert("bool(*rxDynLoad)(RObject)");
        signatures.insert("RObject(*rxLock)(RObject)");
        signatures.insert("RObject(*rxUnlock)(RObject)");
        signatures.insert("bool(*rxAllowUnload)(bool)");
        signatures.insert("RObject(*rxUnloadAll_)()");
        signatures.insert("bool(*rxDynUnload)(RObject)");
        signatures.insert("bool(*rxDelete)(RObject)");
        signatures.insert("SEXP(*setRstudio)(bool)");
        signatures.insert("SEXP(*setProgSupported)(int)");
        signatures.insert("SEXP(*getProgSupported)()");
        signatures.insert("List(*rxUpdateTrans_)(List,std::string,std::string)");
        signatures.insert("List(*dropUnitsRxSolve)(List)");
        signatures.insert("bool(*rxSetSilentErr)(int)");
        signatures.insert("NumericVector(*rxInv)(SEXP)");
        signatures.insert("RObject(*rxSymInvChol)(RObject,Nullable<NumericVector>,std::string,int)");
        signatures.insert("RObject(*rxSymInvCholEnvCalculate)(List,std::string,Nullable<NumericVector>)");
        signatures.insert("NumericVector(*rxMemoryComponents_)(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,double,double)");
        signatures.insert("SEXP(*rxSaveState_)()");
        signatures.insert("bool(*rxIsSerializeFile_)(SEXP)");
        signatures.insert("SEXP(*rxRestoreState_)(SEXP)");
        signatures.insert("LogicalVector(*isNullZero)(RObject)");
        signatures.insert("NumericVector(*rxErf)(NumericVector)");
        signatures.insert("NumericVector(*binomProbsPredVec_)(int,int,int,int,bool,double)");
        signatures.insert("NumericVector(*binomProbs_)(NumericVector,NumericVector,bool,int,int)");
        signatures.insert("NumericVector(*meanProbs_)(NumericVector,NumericVector,bool,bool,bool,int)");
    }
    return signatures.find(sig) != signatures.end();
}

// registerCCallable (register entry points for exported C++ functions)
RcppExport SEXP _rxode2_RcppExport_registerCCallable() { 
    R_RegisterCCallable("rxode2", "_rxode2_rxExpandGrid_", (DL_FUNC)_rxode2_rxExpandGrid__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxExpandSens_", (DL_FUNC)_rxode2_rxExpandSens__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxExpandSens2_", (DL_FUNC)_rxode2_rxExpandSens2__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxExpandSens3_", (DL_FUNC)_rxode2_rxExpandSens3__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxExpandFEta_", (DL_FUNC)_rxode2_rxExpandFEta__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxRepR0_", (DL_FUNC)_rxode2_rxRepR0__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxExpandNesting", (DL_FUNC)_rxode2_rxExpandNesting_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxIs", (DL_FUNC)_rxode2_rxIs_try);
    R_RegisterCCallable("rxode2", "_rxode2_dynLoad", (DL_FUNC)_rxode2_dynLoad_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxModelVars_", (DL_FUNC)_rxode2_rxModelVars__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxState", (DL_FUNC)_rxode2_rxState_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxParams_", (DL_FUNC)_rxode2_rxParams__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxDfdy", (DL_FUNC)_rxode2_rxDfdy_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxLhs", (DL_FUNC)_rxode2_rxLhs_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxInits", (DL_FUNC)_rxode2_rxInits_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSetupIni", (DL_FUNC)_rxode2_rxSetupIni_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSetupScale", (DL_FUNC)_rxode2_rxSetupScale_try);
    R_RegisterCCallable("rxode2", "_rxode2_atolRtolFactor_", (DL_FUNC)_rxode2_atolRtolFactor__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSimThetaOmega", (DL_FUNC)_rxode2_rxSimThetaOmega_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveSetCurObj_", (DL_FUNC)_rxode2_rxSolveSetCurObj__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveFree", (DL_FUNC)_rxode2_rxSolveFree_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveSetup", (DL_FUNC)_rxode2_rxSolveSetup_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveFromRaw_", (DL_FUNC)_rxode2_rxSolveFromRaw__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolve_", (DL_FUNC)_rxode2_rxSolve__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveDollarNames", (DL_FUNC)_rxode2_rxSolveDollarNames_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveGet", (DL_FUNC)_rxode2_rxSolveGet_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveUpdate", (DL_FUNC)_rxode2_rxSolveUpdate_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSolveSEXP", (DL_FUNC)_rxode2_rxSolveSEXP_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxRmModelLib_", (DL_FUNC)_rxode2_rxRmModelLib__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxGetrxode2", (DL_FUNC)_rxode2_rxGetrxode2_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxIsCurrent", (DL_FUNC)_rxode2_rxIsCurrent_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxAssignPtr", (DL_FUNC)_rxode2_rxAssignPtr_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxDll", (DL_FUNC)_rxode2_rxDll_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxC", (DL_FUNC)_rxode2_rxC_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxIsLoaded", (DL_FUNC)_rxode2_rxIsLoaded_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxDynLoad", (DL_FUNC)_rxode2_rxDynLoad_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxLock", (DL_FUNC)_rxode2_rxLock_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxUnlock", (DL_FUNC)_rxode2_rxUnlock_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxAllowUnload", (DL_FUNC)_rxode2_rxAllowUnload_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxUnloadAll_", (DL_FUNC)_rxode2_rxUnloadAll__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxDynUnload", (DL_FUNC)_rxode2_rxDynUnload_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxDelete", (DL_FUNC)_rxode2_rxDelete_try);
    R_RegisterCCallable("rxode2", "_rxode2_setRstudio", (DL_FUNC)_rxode2_setRstudio_try);
    R_RegisterCCallable("rxode2", "_rxode2_setProgSupported", (DL_FUNC)_rxode2_setProgSupported_try);
    R_RegisterCCallable("rxode2", "_rxode2_getProgSupported", (DL_FUNC)_rxode2_getProgSupported_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxUpdateTrans_", (DL_FUNC)_rxode2_rxUpdateTrans__try);
    R_RegisterCCallable("rxode2", "_rxode2_dropUnitsRxSolve", (DL_FUNC)_rxode2_dropUnitsRxSolve_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSetSilentErr", (DL_FUNC)_rxode2_rxSetSilentErr_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxInv", (DL_FUNC)_rxode2_rxInv_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSymInvChol", (DL_FUNC)_rxode2_rxSymInvChol_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSymInvCholEnvCalculate", (DL_FUNC)_rxode2_rxSymInvCholEnvCalculate_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxMemoryComponents_", (DL_FUNC)_rxode2_rxMemoryComponents__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxSaveState_", (DL_FUNC)_rxode2_rxSaveState__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxIsSerializeFile_", (DL_FUNC)_rxode2_rxIsSerializeFile__try);
    R_RegisterCCallable("rxode2", "_rxode2_rxRestoreState_", (DL_FUNC)_rxode2_rxRestoreState__try);
    R_RegisterCCallable("rxode2", "_rxode2_isNullZero", (DL_FUNC)_rxode2_isNullZero_try);
    R_RegisterCCallable("rxode2", "_rxode2_rxErf", (DL_FUNC)_rxode2_rxErf_try);
    R_RegisterCCallable("rxode2", "_rxode2_binomProbsPredVec_", (DL_FUNC)_rxode2_binomProbsPredVec__try);
    R_RegisterCCallable("rxode2", "_rxode2_binomProbs_", (DL_FUNC)_rxode2_binomProbs__try);
    R_RegisterCCallable("rxode2", "_rxode2_meanProbs_", (DL_FUNC)_rxode2_meanProbs__try);
    R_RegisterCCallable("rxode2", "_rxode2_RcppExport_validate", (DL_FUNC)_rxode2_RcppExport_validate);
    return R_NilValue;
}
