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

#ifndef RCPP_mets_RCPPEXPORTS_H_GEN_
#define RCPP_mets_RCPPEXPORTS_H_GEN_

#include <RcppArmadillo.h>
#include <Rcpp.h>

namespace mets {

    using namespace Rcpp;

    namespace {
        void validateSignature(const char* sig) {
            Rcpp::Function require = Rcpp::Environment::base_env()["require"];
            require("mets", Rcpp::Named("quietly") = true);
            typedef int(*Ptr_validate)(const char*);
            static Ptr_validate p_validate = (Ptr_validate)
                R_GetCCallable("mets", "_mets_RcppExport_validate");
            if (!p_validate(sig)) {
                throw Rcpp::function_not_exported(
                    "C++ function with signature '" + std::string(sig) + "' not found in mets");
            }
        }
    }

    inline arma::mat _scoreMVN(arma::mat& Y, arma::mat& Mu, arma::mat& dMu, arma::mat& S, arma::mat& dS, double itol = 0.0) {
        typedef SEXP(*Ptr__scoreMVN)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__scoreMVN p__scoreMVN = NULL;
        if (p__scoreMVN == NULL) {
            validateSignature("arma::mat(*_scoreMVN)(arma::mat&,arma::mat&,arma::mat&,arma::mat&,arma::mat&,double)");
            p__scoreMVN = (Ptr__scoreMVN)R_GetCCallable("mets", "_mets__scoreMVN");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__scoreMVN(Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(Mu)), Shield<SEXP>(Rcpp::wrap(dMu)), Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(dS)), Shield<SEXP>(Rcpp::wrap(itol)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat _loglikMVN(arma::mat Yl, arma::mat Yu, arma::uvec Status, arma::mat Mu, arma::mat S, arma::mat Threshold, SEXP z, SEXP su, double itol) {
        typedef SEXP(*Ptr__loglikMVN)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__loglikMVN p__loglikMVN = NULL;
        if (p__loglikMVN == NULL) {
            validateSignature("arma::mat(*_loglikMVN)(arma::mat,arma::mat,arma::uvec,arma::mat,arma::mat,arma::mat,SEXP,SEXP,double)");
            p__loglikMVN = (Ptr__loglikMVN)R_GetCCallable("mets", "_mets__loglikMVN");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__loglikMVN(Shield<SEXP>(Rcpp::wrap(Yl)), Shield<SEXP>(Rcpp::wrap(Yu)), Shield<SEXP>(Rcpp::wrap(Status)), Shield<SEXP>(Rcpp::wrap(Mu)), Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Threshold)), Shield<SEXP>(Rcpp::wrap(z)), Shield<SEXP>(Rcpp::wrap(su)), Shield<SEXP>(Rcpp::wrap(itol)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline NumericVector _dmvn(arma::mat u, arma::mat mu, arma::mat rho) {
        typedef SEXP(*Ptr__dmvn)(SEXP,SEXP,SEXP);
        static Ptr__dmvn p__dmvn = NULL;
        if (p__dmvn == NULL) {
            validateSignature("NumericVector(*_dmvn)(arma::mat,arma::mat,arma::mat)");
            p__dmvn = (Ptr__dmvn)R_GetCCallable("mets", "_mets__dmvn");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__dmvn(Shield<SEXP>(Rcpp::wrap(u)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline arma::mat _rmvn(unsigned n, arma::mat mu, arma::mat rho) {
        typedef SEXP(*Ptr__rmvn)(SEXP,SEXP,SEXP);
        static Ptr__rmvn p__rmvn = NULL;
        if (p__rmvn == NULL) {
            validateSignature("arma::mat(*_rmvn)(unsigned,arma::mat,arma::mat)");
            p__rmvn = (Ptr__rmvn)R_GetCCallable("mets", "_mets__rmvn");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__rmvn(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::vec _rpch(unsigned n, std::vector<double> lambda, std::vector<double> time) {
        typedef SEXP(*Ptr__rpch)(SEXP,SEXP,SEXP);
        static Ptr__rpch p__rpch = NULL;
        if (p__rpch == NULL) {
            validateSignature("arma::vec(*_rpch)(unsigned,std::vector<double>,std::vector<double>)");
            p__rpch = (Ptr__rpch)R_GetCCallable("mets", "_mets__rpch");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__rpch(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(lambda)), Shield<SEXP>(Rcpp::wrap(time)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline arma::vec _cpch(arma::vec& x, std::vector<double> lambda, std::vector<double> time) {
        typedef SEXP(*Ptr__cpch)(SEXP,SEXP,SEXP);
        static Ptr__cpch p__cpch = NULL;
        if (p__cpch == NULL) {
            validateSignature("arma::vec(*_cpch)(arma::vec&,std::vector<double>,std::vector<double>)");
            p__cpch = (Ptr__cpch)R_GetCCallable("mets", "_mets__cpch");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__cpch(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(lambda)), Shield<SEXP>(Rcpp::wrap(time)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline arma::colvec _rchazC(const arma::mat& cum, const arma::colvec rr, const arma::colvec entry) {
        typedef SEXP(*Ptr__rchazC)(SEXP,SEXP,SEXP);
        static Ptr__rchazC p__rchazC = NULL;
        if (p__rchazC == NULL) {
            validateSignature("arma::colvec(*_rchazC)(const arma::mat&,const arma::colvec,const arma::colvec)");
            p__rchazC = (Ptr__rchazC)R_GetCCallable("mets", "_mets__rchazC");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__rchazC(Shield<SEXP>(Rcpp::wrap(cum)), Shield<SEXP>(Rcpp::wrap(rr)), Shield<SEXP>(Rcpp::wrap(entry)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::colvec >(rcpp_result_gen);
    }

    inline arma::mat _simGL(const arma::mat& dcum, const arma::colvec& St, const arma::colvec& rr, const arma::colvec& rd, const arma::colvec& z, const arma::colvec& fz, const arma::colvec& tc, const int type, const double theta, const int maxit, const double share) {
        typedef SEXP(*Ptr__simGL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__simGL p__simGL = NULL;
        if (p__simGL == NULL) {
            validateSignature("arma::mat(*_simGL)(const arma::mat&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const int,const double,const int,const double)");
            p__simGL = (Ptr__simGL)R_GetCCallable("mets", "_mets__simGL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__simGL(Shield<SEXP>(Rcpp::wrap(dcum)), Shield<SEXP>(Rcpp::wrap(St)), Shield<SEXP>(Rcpp::wrap(rr)), Shield<SEXP>(Rcpp::wrap(rd)), Shield<SEXP>(Rcpp::wrap(z)), Shield<SEXP>(Rcpp::wrap(fz)), Shield<SEXP>(Rcpp::wrap(tc)), Shield<SEXP>(Rcpp::wrap(type)), Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(maxit)), Shield<SEXP>(Rcpp::wrap(share)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat _simSurvZ(const arma::mat& St, const arma::colvec& rd, const arma::colvec& z, const double theta, const int type) {
        typedef SEXP(*Ptr__simSurvZ)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__simSurvZ p__simSurvZ = NULL;
        if (p__simSurvZ == NULL) {
            validateSignature("arma::mat(*_simSurvZ)(const arma::mat&,const arma::colvec&,const arma::colvec&,const double,const int)");
            p__simSurvZ = (Ptr__simSurvZ)R_GetCCallable("mets", "_mets__simSurvZ");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__simSurvZ(Shield<SEXP>(Rcpp::wrap(St)), Shield<SEXP>(Rcpp::wrap(rd)), Shield<SEXP>(Rcpp::wrap(z)), Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(type)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat _tildeLambda1(const arma::colvec& dLambda1, const arma::colvec& LambdaD, const arma::colvec& r1, const arma::colvec& rd, const arma::colvec& theta, const IntegerVector id) {
        typedef SEXP(*Ptr__tildeLambda1)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__tildeLambda1 p__tildeLambda1 = NULL;
        if (p__tildeLambda1 == NULL) {
            validateSignature("arma::mat(*_tildeLambda1)(const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const IntegerVector)");
            p__tildeLambda1 = (Ptr__tildeLambda1)R_GetCCallable("mets", "_mets__tildeLambda1");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__tildeLambda1(Shield<SEXP>(Rcpp::wrap(dLambda1)), Shield<SEXP>(Rcpp::wrap(LambdaD)), Shield<SEXP>(Rcpp::wrap(r1)), Shield<SEXP>(Rcpp::wrap(rd)), Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(id)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat _tildeLambda1R(const arma::colvec& dLambda1, const arma::colvec& LambdaD, const arma::colvec& r1, const arma::colvec& rd, const arma::colvec& theta, const IntegerVector id, const arma::colvec& sign) {
        typedef SEXP(*Ptr__tildeLambda1R)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__tildeLambda1R p__tildeLambda1R = NULL;
        if (p__tildeLambda1R == NULL) {
            validateSignature("arma::mat(*_tildeLambda1R)(const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const arma::colvec&,const IntegerVector,const arma::colvec&)");
            p__tildeLambda1R = (Ptr__tildeLambda1R)R_GetCCallable("mets", "_mets__tildeLambda1R");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__tildeLambda1R(Shield<SEXP>(Rcpp::wrap(dLambda1)), Shield<SEXP>(Rcpp::wrap(LambdaD)), Shield<SEXP>(Rcpp::wrap(r1)), Shield<SEXP>(Rcpp::wrap(rd)), Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(id)), Shield<SEXP>(Rcpp::wrap(sign)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

}

#endif // RCPP_mets_RCPPEXPORTS_H_GEN_
