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

#ifndef RCPP_rust_RCPPEXPORTS_H_GEN_
#define RCPP_rust_RCPPEXPORTS_H_GEN_

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

namespace rust {

    using namespace Rcpp;

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

    inline bool any_infinite(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_any_infinite)(SEXP);
        static Ptr_any_infinite p_any_infinite = NULL;
        if (p_any_infinite == NULL) {
            validateSignature("bool(*any_infinite)(const Rcpp::NumericVector&)");
            p_any_infinite = (Ptr_any_infinite)R_GetCCallable("rust", "_rust_any_infinite");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_infinite(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool any_naC(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_any_naC)(SEXP);
        static Ptr_any_naC p_any_naC = NULL;
        if (p_any_naC == NULL) {
            validateSignature("bool(*any_naC)(const Rcpp::NumericVector&)");
            p_any_naC = (Ptr_any_naC)R_GetCCallable("rust", "_rust_any_naC");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_naC(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool no_naC(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_no_naC)(SEXP);
        static Ptr_no_naC p_no_naC = NULL;
        if (p_no_naC == NULL) {
            validateSignature("bool(*no_naC)(const Rcpp::NumericVector&)");
            p_no_naC = (Ptr_no_naC)R_GetCCallable("rust", "_rust_no_naC");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_no_naC(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool any_nonpos(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_any_nonpos)(SEXP);
        static Ptr_any_nonpos p_any_nonpos = NULL;
        if (p_any_nonpos == NULL) {
            validateSignature("bool(*any_nonpos)(const Rcpp::NumericVector&)");
            p_any_nonpos = (Ptr_any_nonpos)R_GetCCallable("rust", "_rust_any_nonpos");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_nonpos(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool all_pos(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_all_pos)(SEXP);
        static Ptr_all_pos p_all_pos = NULL;
        if (p_all_pos == NULL) {
            validateSignature("bool(*all_pos)(const Rcpp::NumericVector&)");
            p_all_pos = (Ptr_all_pos)R_GetCCallable("rust", "_rust_all_pos");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_all_pos(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool any_neg(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_any_neg)(SEXP);
        static Ptr_any_neg p_any_neg = NULL;
        if (p_any_neg == NULL) {
            validateSignature("bool(*any_neg)(const Rcpp::NumericVector&)");
            p_any_neg = (Ptr_any_neg)R_GetCCallable("rust", "_rust_any_neg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_neg(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool any_col_nonneg(const Rcpp::NumericMatrix& x) {
        typedef SEXP(*Ptr_any_col_nonneg)(SEXP);
        static Ptr_any_col_nonneg p_any_col_nonneg = NULL;
        if (p_any_col_nonneg == NULL) {
            validateSignature("bool(*any_col_nonneg)(const Rcpp::NumericMatrix&)");
            p_any_col_nonneg = (Ptr_any_col_nonneg)R_GetCCallable("rust", "_rust_any_col_nonneg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_col_nonneg(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool any_pos(const Rcpp::NumericVector& x) {
        typedef SEXP(*Ptr_any_pos)(SEXP);
        static Ptr_any_pos p_any_pos = NULL;
        if (p_any_pos == NULL) {
            validateSignature("bool(*any_pos)(const Rcpp::NumericVector&)");
            p_any_pos = (Ptr_any_pos)R_GetCCallable("rust", "_rust_any_pos");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_pos(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline bool any_col_nonpos(const Rcpp::NumericMatrix& x) {
        typedef SEXP(*Ptr_any_col_nonpos)(SEXP);
        static Ptr_any_col_nonpos p_any_col_nonpos = NULL;
        if (p_any_col_nonpos == NULL) {
            validateSignature("bool(*any_col_nonpos)(const Rcpp::NumericMatrix&)");
            p_any_col_nonpos = (Ptr_any_col_nonpos)R_GetCCallable("rust", "_rust_any_col_nonpos");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_any_col_nonpos(Shield<SEXP>(Rcpp::wrap(x)));
        }
        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<bool >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector vecpow(const Rcpp::NumericVector& base, const Rcpp::NumericVector& exp) {
        typedef SEXP(*Ptr_vecpow)(SEXP,SEXP);
        static Ptr_vecpow p_vecpow = NULL;
        if (p_vecpow == NULL) {
            validateSignature("Rcpp::NumericVector(*vecpow)(const Rcpp::NumericVector&,const Rcpp::NumericVector&)");
            p_vecpow = (Ptr_vecpow)R_GetCCallable("rust", "_rust_vecpow");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_vecpow(Shield<SEXP>(Rcpp::wrap(base)), Shield<SEXP>(Rcpp::wrap(exp)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline arma::vec cpp_rho_to_psi(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat) {
        typedef SEXP(*Ptr_cpp_rho_to_psi)(SEXP,SEXP,SEXP);
        static Ptr_cpp_rho_to_psi p_cpp_rho_to_psi = NULL;
        if (p_cpp_rho_to_psi == NULL) {
            validateSignature("arma::vec(*cpp_rho_to_psi)(const arma::vec&,const arma::vec&,const arma::mat&)");
            p_cpp_rho_to_psi = (Ptr_cpp_rho_to_psi)R_GetCCallable("rust", "_rust_cpp_rho_to_psi");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_rho_to_psi(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)));
        }
        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 Rcpp::NumericVector cpp_psi_to_phi(const Rcpp::NumericVector& psi, const Rcpp::NumericVector& lambda, const Rcpp::NumericVector& gm, const Rcpp::NumericVector& con) {
        typedef SEXP(*Ptr_cpp_psi_to_phi)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_psi_to_phi p_cpp_psi_to_phi = NULL;
        if (p_cpp_psi_to_phi == NULL) {
            validateSignature("Rcpp::NumericVector(*cpp_psi_to_phi)(const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::NumericVector&)");
            p_cpp_psi_to_phi = (Ptr_cpp_psi_to_phi)R_GetCCallable("rust", "_rust_cpp_psi_to_phi");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_psi_to_phi(Shield<SEXP>(Rcpp::wrap(psi)), Shield<SEXP>(Rcpp::wrap(lambda)), Shield<SEXP>(Rcpp::wrap(gm)), Shield<SEXP>(Rcpp::wrap(con)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector cpp_psi_to_phi_0(const Rcpp::NumericVector& psi, const Rcpp::NumericVector& lambda, const Rcpp::NumericVector& gm, const Rcpp::NumericVector& con) {
        typedef SEXP(*Ptr_cpp_psi_to_phi_0)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_psi_to_phi_0 p_cpp_psi_to_phi_0 = NULL;
        if (p_cpp_psi_to_phi_0 == NULL) {
            validateSignature("Rcpp::NumericVector(*cpp_psi_to_phi_0)(const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::NumericVector&)");
            p_cpp_psi_to_phi_0 = (Ptr_cpp_psi_to_phi_0)R_GetCCallable("rust", "_rust_cpp_psi_to_phi_0");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_psi_to_phi_0(Shield<SEXP>(Rcpp::wrap(psi)), Shield<SEXP>(Rcpp::wrap(lambda)), Shield<SEXP>(Rcpp::wrap(gm)), Shield<SEXP>(Rcpp::wrap(con)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline double cpp_logf(const Rcpp::NumericVector& theta, const SEXP& logf, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_cpp_logf)(SEXP,SEXP,SEXP);
        static Ptr_cpp_logf p_cpp_logf = NULL;
        if (p_cpp_logf == NULL) {
            validateSignature("double(*cpp_logf)(const Rcpp::NumericVector&,const SEXP&,const Rcpp::List&)");
            p_cpp_logf = (Ptr_cpp_logf)R_GetCCallable("rust", "_rust_cpp_logf");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_logf(Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_logf_scaled(const Rcpp::NumericVector& theta, const SEXP& logf, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_cpp_logf_scaled)(SEXP,SEXP,SEXP);
        static Ptr_cpp_logf_scaled p_cpp_logf_scaled = NULL;
        if (p_cpp_logf_scaled == NULL) {
            validateSignature("double(*cpp_logf_scaled)(const Rcpp::NumericVector&,const SEXP&,const Rcpp::List&)");
            p_cpp_logf_scaled = (Ptr_cpp_logf_scaled)R_GetCCallable("rust", "_rust_cpp_logf_scaled");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_logf_scaled(Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_logf_rho(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_cpp_logf_rho)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_logf_rho p_cpp_logf_rho = NULL;
        if (p_cpp_logf_rho == NULL) {
            validateSignature("double(*cpp_logf_rho)(const arma::vec&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&)");
            p_cpp_logf_rho = (Ptr_cpp_logf_rho)R_GetCCallable("rust", "_rust_cpp_logf_rho");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_logf_rho(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline arma::vec trans1(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat) {
        typedef SEXP(*Ptr_trans1)(SEXP,SEXP,SEXP);
        static Ptr_trans1 p_trans1 = NULL;
        if (p_trans1 == NULL) {
            validateSignature("arma::vec(*trans1)(const arma::vec&,const arma::vec&,const arma::mat&)");
            p_trans1 = (Ptr_trans1)R_GetCCallable("rust", "_rust_trans1");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_trans1(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)));
        }
        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 double cpp_logf_rho_2(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_cpp_logf_rho_2)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_logf_rho_2 p_cpp_logf_rho_2 = NULL;
        if (p_cpp_logf_rho_2 == NULL) {
            validateSignature("double(*cpp_logf_rho_2)(const arma::vec&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_cpp_logf_rho_2 = (Ptr_cpp_logf_rho_2)R_GetCCallable("rust", "_rust_cpp_logf_rho_2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_logf_rho_2(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline arma::vec trans2(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const Rcpp::List& tpars, const SEXP& ptpfun) {
        typedef SEXP(*Ptr_trans2)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_trans2 p_trans2 = NULL;
        if (p_trans2 == NULL) {
            validateSignature("arma::vec(*trans2)(const arma::vec&,const arma::vec&,const arma::mat&,const Rcpp::List&,const SEXP&)");
            p_trans2 = (Ptr_trans2)R_GetCCallable("rust", "_rust_trans2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_trans2(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)));
        }
        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 double cpp_logf_rho_3(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_cpp_logf_rho_3)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_logf_rho_3 p_cpp_logf_rho_3 = NULL;
        if (p_cpp_logf_rho_3 == NULL) {
            validateSignature("double(*cpp_logf_rho_3)(const arma::vec&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_cpp_logf_rho_3 = (Ptr_cpp_logf_rho_3)R_GetCCallable("rust", "_rust_cpp_logf_rho_3");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_logf_rho_3(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline arma::vec trans3(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_trans3)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_trans3 p_trans3 = NULL;
        if (p_trans3 == NULL) {
            validateSignature("arma::vec(*trans3)(const arma::vec&,const arma::vec&,const arma::mat&,const Rcpp::List&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_trans3 = (Ptr_trans3)R_GetCCallable("rust", "_rust_trans3");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_trans3(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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 double cpp_logf_rho_4(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_cpp_logf_rho_4)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_logf_rho_4 p_cpp_logf_rho_4 = NULL;
        if (p_cpp_logf_rho_4 == NULL) {
            validateSignature("double(*cpp_logf_rho_4)(const arma::vec&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_cpp_logf_rho_4 = (Ptr_cpp_logf_rho_4)R_GetCCallable("rust", "_rust_cpp_logf_rho_4");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_logf_rho_4(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline arma::vec trans4(const arma::vec& rho, const arma::vec& psi_mode, const arma::mat& rot_mat, const SEXP& ptpfun, const SEXP& phi_to_theta, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_trans4)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_trans4 p_trans4 = NULL;
        if (p_trans4 == NULL) {
            validateSignature("arma::vec(*trans4)(const arma::vec&,const arma::vec&,const arma::mat&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_trans4 = (Ptr_trans4)R_GetCCallable("rust", "_rust_trans4");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_trans4(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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 Rcpp::NumericVector rcpp_apply(const Rcpp::NumericMatrix& x, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_rcpp_apply)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_rcpp_apply p_rcpp_apply = NULL;
        if (p_rcpp_apply == NULL) {
            validateSignature("Rcpp::NumericVector(*rcpp_apply)(const Rcpp::NumericMatrix&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_rcpp_apply = (Ptr_rcpp_apply)R_GetCCallable("rust", "_rust_rcpp_apply");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_rcpp_apply(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline double cpp_a_obj(const arma::vec& psi, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const int& d, const double& r, const double& big_val, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_cpp_a_obj)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_a_obj p_cpp_a_obj = NULL;
        if (p_cpp_a_obj == NULL) {
            validateSignature("double(*cpp_a_obj)(const arma::vec&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const int&,const double&,const double&,const Rcpp::List&)");
            p_cpp_a_obj = (Ptr_cpp_a_obj)R_GetCCallable("rust", "_rust_cpp_a_obj");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_a_obj(Shield<SEXP>(Rcpp::wrap(psi)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(big_val)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_a_obj_2(const arma::vec& psi, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const int& d, const double& r, const double& big_val, const SEXP& tfun, const Rcpp::List& tpars, const SEXP& logf, const Rcpp::List& pars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_cpp_a_obj_2)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_a_obj_2 p_cpp_a_obj_2 = NULL;
        if (p_cpp_a_obj_2 == NULL) {
            validateSignature("double(*cpp_a_obj_2)(const arma::vec&,const arma::vec&,const arma::mat&,const double&,const int&,const double&,const double&,const SEXP&,const Rcpp::List&,const SEXP&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_cpp_a_obj_2 = (Ptr_cpp_a_obj_2)R_GetCCallable("rust", "_rust_cpp_a_obj_2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_a_obj_2(Shield<SEXP>(Rcpp::wrap(psi)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(big_val)), Shield<SEXP>(Rcpp::wrap(tfun)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_lower_box(const arma::vec& rho, int j, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const int& d, const double& r, const double& big_val, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_cpp_lower_box)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_lower_box p_cpp_lower_box = NULL;
        if (p_cpp_lower_box == NULL) {
            validateSignature("double(*cpp_lower_box)(const arma::vec&,int,const arma::vec&,const arma::mat&,const double&,const SEXP&,const int&,const double&,const double&,const Rcpp::List&)");
            p_cpp_lower_box = (Ptr_cpp_lower_box)R_GetCCallable("rust", "_rust_cpp_lower_box");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_lower_box(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(j)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(big_val)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_lower_box_2(const arma::vec& rho, int j, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& tfun, const Rcpp::List& tpars, const SEXP& logf, const Rcpp::List& pars, const int& d, const double& r, const double& big_val, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_cpp_lower_box_2)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_lower_box_2 p_cpp_lower_box_2 = NULL;
        if (p_cpp_lower_box_2 == NULL) {
            validateSignature("double(*cpp_lower_box_2)(const arma::vec&,int,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const SEXP&,const Rcpp::List&,const int&,const double&,const double&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_cpp_lower_box_2 = (Ptr_cpp_lower_box_2)R_GetCCallable("rust", "_rust_cpp_lower_box_2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_lower_box_2(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(j)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(tfun)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(big_val)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_upper_box(const arma::vec& rho, int j, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const int& d, const double& r, const double& big_val, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_cpp_upper_box)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_upper_box p_cpp_upper_box = NULL;
        if (p_cpp_upper_box == NULL) {
            validateSignature("double(*cpp_upper_box)(const arma::vec&,int,const arma::vec&,const arma::mat&,const double&,const SEXP&,const int&,const double&,const double&,const Rcpp::List&)");
            p_cpp_upper_box = (Ptr_cpp_upper_box)R_GetCCallable("rust", "_rust_cpp_upper_box");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_upper_box(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(j)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(big_val)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double cpp_upper_box_2(const arma::vec& rho, int j, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& tfun, const Rcpp::List& tpars, const SEXP& logf, const Rcpp::List& pars, const int& d, const double& r, const double& big_val, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_cpp_upper_box_2)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_cpp_upper_box_2 p_cpp_upper_box_2 = NULL;
        if (p_cpp_upper_box_2 == NULL) {
            validateSignature("double(*cpp_upper_box_2)(const arma::vec&,int,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const SEXP&,const Rcpp::List&,const int&,const double&,const double&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_cpp_upper_box_2 = (Ptr_cpp_upper_box_2)R_GetCCallable("rust", "_rust_cpp_upper_box_2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cpp_upper_box_2(Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(j)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(tfun)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(big_val)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline Rcpp::List ru_cpp(const int& n, const int& d, const double& r, const double& a_box, const Rcpp::NumericVector& l_box, const Rcpp::NumericVector& u_box, const SEXP& logf, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_ru_cpp)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_ru_cpp p_ru_cpp = NULL;
        if (p_ru_cpp == NULL) {
            validateSignature("Rcpp::List(*ru_cpp)(const int&,const int&,const double&,const double&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const SEXP&,const arma::vec&,const arma::mat&,const double&,const Rcpp::List&)");
            p_ru_cpp = (Ptr_ru_cpp)R_GetCCallable("rust", "_rust_ru_cpp");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_ru_cpp(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(a_box)), Shield<SEXP>(Rcpp::wrap(l_box)), Shield<SEXP>(Rcpp::wrap(u_box)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List ru_cpp_2(const int& n, const int& d, const double& r, const double& a_box, const Rcpp::NumericVector& l_box, const Rcpp::NumericVector& u_box, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_ru_cpp_2)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_ru_cpp_2 p_ru_cpp_2 = NULL;
        if (p_ru_cpp_2 == NULL) {
            validateSignature("Rcpp::List(*ru_cpp_2)(const int&,const int&,const double&,const double&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_ru_cpp_2 = (Ptr_ru_cpp_2)R_GetCCallable("rust", "_rust_ru_cpp_2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_ru_cpp_2(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(a_box)), Shield<SEXP>(Rcpp::wrap(l_box)), Shield<SEXP>(Rcpp::wrap(u_box)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List ru_cpp_3(const int& n, const int& d, const double& r, const double& a_box, const Rcpp::NumericVector& l_box, const Rcpp::NumericVector& u_box, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_ru_cpp_3)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_ru_cpp_3 p_ru_cpp_3 = NULL;
        if (p_ru_cpp_3 == NULL) {
            validateSignature("Rcpp::List(*ru_cpp_3)(const int&,const int&,const double&,const double&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_ru_cpp_3 = (Ptr_ru_cpp_3)R_GetCCallable("rust", "_rust_ru_cpp_3");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_ru_cpp_3(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(a_box)), Shield<SEXP>(Rcpp::wrap(l_box)), Shield<SEXP>(Rcpp::wrap(u_box)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List ru_cpp_4(const int& n, const int& d, const double& r, const double& a_box, const Rcpp::NumericVector& l_box, const Rcpp::NumericVector& u_box, const arma::vec& psi_mode, const arma::mat& rot_mat, const double& hscale, const SEXP& logf, const Rcpp::List& pars, const Rcpp::List& tpars, const SEXP& ptpfun, const SEXP& phi_to_theta, const SEXP& log_j, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_ru_cpp_4)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_ru_cpp_4 p_ru_cpp_4 = NULL;
        if (p_ru_cpp_4 == NULL) {
            validateSignature("Rcpp::List(*ru_cpp_4)(const int&,const int&,const double&,const double&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const arma::vec&,const arma::mat&,const double&,const SEXP&,const Rcpp::List&,const Rcpp::List&,const SEXP&,const SEXP&,const SEXP&,const Rcpp::List&)");
            p_ru_cpp_4 = (Ptr_ru_cpp_4)R_GetCCallable("rust", "_rust_ru_cpp_4");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_ru_cpp_4(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(d)), Shield<SEXP>(Rcpp::wrap(r)), Shield<SEXP>(Rcpp::wrap(a_box)), Shield<SEXP>(Rcpp::wrap(l_box)), Shield<SEXP>(Rcpp::wrap(u_box)), Shield<SEXP>(Rcpp::wrap(psi_mode)), Shield<SEXP>(Rcpp::wrap(rot_mat)), Shield<SEXP>(Rcpp::wrap(hscale)), Shield<SEXP>(Rcpp::wrap(logf)), Shield<SEXP>(Rcpp::wrap(pars)), Shield<SEXP>(Rcpp::wrap(tpars)), Shield<SEXP>(Rcpp::wrap(ptpfun)), Shield<SEXP>(Rcpp::wrap(phi_to_theta)), Shield<SEXP>(Rcpp::wrap(log_j)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::List >(rcpp_result_gen);
    }

    inline SEXP create_trans_xptr(std::string fstr) {
        typedef SEXP(*Ptr_create_trans_xptr)(SEXP);
        static Ptr_create_trans_xptr p_create_trans_xptr = NULL;
        if (p_create_trans_xptr == NULL) {
            validateSignature("SEXP(*create_trans_xptr)(std::string)");
            p_create_trans_xptr = (Ptr_create_trans_xptr)R_GetCCallable("rust", "_rust_create_trans_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_trans_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector bc_no_trans(const Rcpp::NumericVector& psi, const Rcpp::NumericVector& lambda, const Rcpp::NumericVector& gm, const Rcpp::NumericVector& con) {
        typedef SEXP(*Ptr_bc_no_trans)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_bc_no_trans p_bc_no_trans = NULL;
        if (p_bc_no_trans == NULL) {
            validateSignature("Rcpp::NumericVector(*bc_no_trans)(const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::NumericVector&)");
            p_bc_no_trans = (Ptr_bc_no_trans)R_GetCCallable("rust", "_rust_bc_no_trans");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bc_no_trans(Shield<SEXP>(Rcpp::wrap(psi)), Shield<SEXP>(Rcpp::wrap(lambda)), Shield<SEXP>(Rcpp::wrap(gm)), Shield<SEXP>(Rcpp::wrap(con)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline SEXP create_psi_to_phi_xptr(std::string fstr) {
        typedef SEXP(*Ptr_create_psi_to_phi_xptr)(SEXP);
        static Ptr_create_psi_to_phi_xptr p_create_psi_to_phi_xptr = NULL;
        if (p_create_psi_to_phi_xptr == NULL) {
            validateSignature("SEXP(*create_psi_to_phi_xptr)(std::string)");
            p_create_psi_to_phi_xptr = (Ptr_create_psi_to_phi_xptr)R_GetCCallable("rust", "_rust_create_psi_to_phi_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_psi_to_phi_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

    inline double log_none_jac(const Rcpp::NumericVector& theta, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_log_none_jac)(SEXP,SEXP);
        static Ptr_log_none_jac p_log_none_jac = NULL;
        if (p_log_none_jac == NULL) {
            validateSignature("double(*log_none_jac)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_log_none_jac = (Ptr_log_none_jac)R_GetCCallable("rust", "_rust_log_none_jac");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_none_jac(Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline SEXP create_log_jac_xptr(std::string fstr) {
        typedef SEXP(*Ptr_create_log_jac_xptr)(SEXP);
        static Ptr_create_log_jac_xptr p_create_log_jac_xptr = NULL;
        if (p_create_log_jac_xptr == NULL) {
            validateSignature("SEXP(*create_log_jac_xptr)(std::string)");
            p_create_log_jac_xptr = (Ptr_create_log_jac_xptr)R_GetCCallable("rust", "_rust_create_log_jac_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_log_jac_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector no_trans(const Rcpp::NumericVector& theta, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_no_trans)(SEXP,SEXP);
        static Ptr_no_trans p_no_trans = NULL;
        if (p_no_trans == NULL) {
            validateSignature("Rcpp::NumericVector(*no_trans)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_no_trans = (Ptr_no_trans)R_GetCCallable("rust", "_rust_no_trans");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_no_trans(Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline SEXP null_phi_to_theta_xptr(std::string fstr) {
        typedef SEXP(*Ptr_null_phi_to_theta_xptr)(SEXP);
        static Ptr_null_phi_to_theta_xptr p_null_phi_to_theta_xptr = NULL;
        if (p_null_phi_to_theta_xptr == NULL) {
            validateSignature("SEXP(*null_phi_to_theta_xptr)(std::string)");
            p_null_phi_to_theta_xptr = (Ptr_null_phi_to_theta_xptr)R_GetCCallable("rust", "_rust_null_phi_to_theta_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_null_phi_to_theta_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

    inline double logdN01(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_logdN01)(SEXP,SEXP);
        static Ptr_logdN01 p_logdN01 = NULL;
        if (p_logdN01 == NULL) {
            validateSignature("double(*logdN01)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_logdN01 = (Ptr_logdN01)R_GetCCallable("rust", "_rust_logdN01");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logdN01(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double logdnorm2(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_logdnorm2)(SEXP,SEXP);
        static Ptr_logdnorm2 p_logdnorm2 = NULL;
        if (p_logdnorm2 == NULL) {
            validateSignature("double(*logdnorm2)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_logdnorm2 = (Ptr_logdnorm2)R_GetCCallable("rust", "_rust_logdnorm2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logdnorm2(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double logdmvnorm(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_logdmvnorm)(SEXP,SEXP);
        static Ptr_logdmvnorm p_logdmvnorm = NULL;
        if (p_logdmvnorm == NULL) {
            validateSignature("double(*logdmvnorm)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_logdmvnorm = (Ptr_logdmvnorm)R_GetCCallable("rust", "_rust_logdmvnorm");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logdmvnorm(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double logcauchy(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_logcauchy)(SEXP,SEXP);
        static Ptr_logcauchy p_logcauchy = NULL;
        if (p_logcauchy == NULL) {
            validateSignature("double(*logcauchy)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_logcauchy = (Ptr_logcauchy)R_GetCCallable("rust", "_rust_logcauchy");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logcauchy(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double loghalfcauchy(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_loghalfcauchy)(SEXP,SEXP);
        static Ptr_loghalfcauchy p_loghalfcauchy = NULL;
        if (p_loghalfcauchy == NULL) {
            validateSignature("double(*loghalfcauchy)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_loghalfcauchy = (Ptr_loghalfcauchy)R_GetCCallable("rust", "_rust_loghalfcauchy");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_loghalfcauchy(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double lognormalmix(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_lognormalmix)(SEXP,SEXP);
        static Ptr_lognormalmix p_lognormalmix = NULL;
        if (p_lognormalmix == NULL) {
            validateSignature("double(*lognormalmix)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_lognormalmix = (Ptr_lognormalmix)R_GetCCallable("rust", "_rust_lognormalmix");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_lognormalmix(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double lognormt(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_lognormt)(SEXP,SEXP);
        static Ptr_lognormt p_lognormt = NULL;
        if (p_lognormt == NULL) {
            validateSignature("double(*lognormt)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_lognormt = (Ptr_lognormt)R_GetCCallable("rust", "_rust_lognormt");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_lognormt(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double logdlnorm(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_logdlnorm)(SEXP,SEXP);
        static Ptr_logdlnorm p_logdlnorm = NULL;
        if (p_logdlnorm == NULL) {
            validateSignature("double(*logdlnorm)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_logdlnorm = (Ptr_logdlnorm)R_GetCCallable("rust", "_rust_logdlnorm");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logdlnorm(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double logdgamma(const Rcpp::NumericVector& x, const Rcpp::List& pars) {
        typedef SEXP(*Ptr_logdgamma)(SEXP,SEXP);
        static Ptr_logdgamma p_logdgamma = NULL;
        if (p_logdgamma == NULL) {
            validateSignature("double(*logdgamma)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_logdgamma = (Ptr_logdgamma)R_GetCCallable("rust", "_rust_logdgamma");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logdgamma(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(pars)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double loggp(const Rcpp::NumericVector& x, const Rcpp::List& ss) {
        typedef SEXP(*Ptr_loggp)(SEXP,SEXP);
        static Ptr_loggp p_loggp = NULL;
        if (p_loggp == NULL) {
            validateSignature("double(*loggp)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_loggp = (Ptr_loggp)R_GetCCallable("rust", "_rust_loggp");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_loggp(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(ss)));
        }
        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<double >(rcpp_result_gen);
    }

    inline SEXP create_xptr(std::string fstr) {
        typedef SEXP(*Ptr_create_xptr)(SEXP);
        static Ptr_create_xptr p_create_xptr = NULL;
        if (p_create_xptr == NULL) {
            validateSignature("SEXP(*create_xptr)(std::string)");
            p_create_xptr = (Ptr_create_xptr)R_GetCCallable("rust", "_rust_create_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

    inline double neglog(const Rcpp::NumericVector& theta, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_neglog)(SEXP,SEXP);
        static Ptr_neglog p_neglog = NULL;
        if (p_neglog == NULL) {
            validateSignature("double(*neglog)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_neglog = (Ptr_neglog)R_GetCCallable("rust", "_rust_neglog");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_neglog(Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline double bc_log_j(const Rcpp::NumericVector& theta, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_bc_log_j)(SEXP,SEXP);
        static Ptr_bc_log_j p_bc_log_j = NULL;
        if (p_bc_log_j == NULL) {
            validateSignature("double(*bc_log_j)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_bc_log_j = (Ptr_bc_log_j)R_GetCCallable("rust", "_rust_bc_log_j");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bc_log_j(Shield<SEXP>(Rcpp::wrap(theta)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<double >(rcpp_result_gen);
    }

    inline SEXP create_log_j_xptr(std::string fstr) {
        typedef SEXP(*Ptr_create_log_j_xptr)(SEXP);
        static Ptr_create_log_j_xptr p_create_log_j_xptr = NULL;
        if (p_create_log_j_xptr == NULL) {
            validateSignature("SEXP(*create_log_j_xptr)(std::string)");
            p_create_log_j_xptr = (Ptr_create_log_j_xptr)R_GetCCallable("rust", "_rust_create_log_j_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_log_j_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector exptrans(const Rcpp::NumericVector& phi, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_exptrans)(SEXP,SEXP);
        static Ptr_exptrans p_exptrans = NULL;
        if (p_exptrans == NULL) {
            validateSignature("Rcpp::NumericVector(*exptrans)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_exptrans = (Ptr_exptrans)R_GetCCallable("rust", "_rust_exptrans");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_exptrans(Shield<SEXP>(Rcpp::wrap(phi)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector vecpower(const Rcpp::NumericVector& base, const Rcpp::NumericVector& exp) {
        typedef SEXP(*Ptr_vecpower)(SEXP,SEXP);
        static Ptr_vecpower p_vecpower = NULL;
        if (p_vecpower == NULL) {
            validateSignature("Rcpp::NumericVector(*vecpower)(const Rcpp::NumericVector&,const Rcpp::NumericVector&)");
            p_vecpower = (Ptr_vecpower)R_GetCCallable("rust", "_rust_vecpower");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_vecpower(Shield<SEXP>(Rcpp::wrap(base)), Shield<SEXP>(Rcpp::wrap(exp)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector bc_phi_to_theta(const Rcpp::NumericVector& phi, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_bc_phi_to_theta)(SEXP,SEXP);
        static Ptr_bc_phi_to_theta p_bc_phi_to_theta = NULL;
        if (p_bc_phi_to_theta == NULL) {
            validateSignature("Rcpp::NumericVector(*bc_phi_to_theta)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_bc_phi_to_theta = (Ptr_bc_phi_to_theta)R_GetCCallable("rust", "_rust_bc_phi_to_theta");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bc_phi_to_theta(Shield<SEXP>(Rcpp::wrap(phi)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline Rcpp::NumericVector gp_phi_to_theta(const Rcpp::NumericVector& phi, const Rcpp::List& user_args) {
        typedef SEXP(*Ptr_gp_phi_to_theta)(SEXP,SEXP);
        static Ptr_gp_phi_to_theta p_gp_phi_to_theta = NULL;
        if (p_gp_phi_to_theta == NULL) {
            validateSignature("Rcpp::NumericVector(*gp_phi_to_theta)(const Rcpp::NumericVector&,const Rcpp::List&)");
            p_gp_phi_to_theta = (Ptr_gp_phi_to_theta)R_GetCCallable("rust", "_rust_gp_phi_to_theta");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_gp_phi_to_theta(Shield<SEXP>(Rcpp::wrap(phi)), Shield<SEXP>(Rcpp::wrap(user_args)));
        }
        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<Rcpp::NumericVector >(rcpp_result_gen);
    }

    inline SEXP create_phi_to_theta_xptr(std::string fstr) {
        typedef SEXP(*Ptr_create_phi_to_theta_xptr)(SEXP);
        static Ptr_create_phi_to_theta_xptr p_create_phi_to_theta_xptr = NULL;
        if (p_create_phi_to_theta_xptr == NULL) {
            validateSignature("SEXP(*create_phi_to_theta_xptr)(std::string)");
            p_create_phi_to_theta_xptr = (Ptr_create_phi_to_theta_xptr)R_GetCCallable("rust", "_rust_create_phi_to_theta_xptr");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_phi_to_theta_xptr(Shield<SEXP>(Rcpp::wrap(fstr)));
        }
        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<SEXP >(rcpp_result_gen);
    }

}

#endif // RCPP_rust_RCPPEXPORTS_H_GEN_
