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

#ifndef RCPP_simcdm_RCPPEXPORTS_H_GEN_
#define RCPP_simcdm_RCPPEXPORTS_H_GEN_

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

namespace simcdm {

    using namespace Rcpp;

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

    inline arma::mat sim_dina_class(unsigned int N, unsigned int J, const arma::vec& CLASS, const arma::mat& ETA, const arma::vec& gs, const arma::vec& ss) {
        typedef SEXP(*Ptr_sim_dina_class)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sim_dina_class p_sim_dina_class = NULL;
        if (p_sim_dina_class == NULL) {
            validateSignature("arma::mat(*sim_dina_class)(unsigned int,unsigned int,const arma::vec&,const arma::mat&,const arma::vec&,const arma::vec&)");
            p_sim_dina_class = (Ptr_sim_dina_class)R_GetCCallable("simcdm", "_simcdm_sim_dina_class");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_dina_class(Shield<SEXP>(Rcpp::wrap(N)), Shield<SEXP>(Rcpp::wrap(J)), Shield<SEXP>(Rcpp::wrap(CLASS)), Shield<SEXP>(Rcpp::wrap(ETA)), Shield<SEXP>(Rcpp::wrap(gs)), 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<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat sim_dina_attributes(const arma::mat& alphas, const arma::mat& Q) {
        typedef SEXP(*Ptr_sim_dina_attributes)(SEXP,SEXP);
        static Ptr_sim_dina_attributes p_sim_dina_attributes = NULL;
        if (p_sim_dina_attributes == NULL) {
            validateSignature("arma::mat(*sim_dina_attributes)(const arma::mat&,const arma::mat&)");
            p_sim_dina_attributes = (Ptr_sim_dina_attributes)R_GetCCallable("simcdm", "_simcdm_sim_dina_attributes");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_dina_attributes(Shield<SEXP>(Rcpp::wrap(alphas)), Shield<SEXP>(Rcpp::wrap(Q)));
        }
        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 sim_dina_items(const arma::mat& alphas, const arma::mat& Q, const arma::vec& ss, const arma::vec& gs) {
        typedef SEXP(*Ptr_sim_dina_items)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sim_dina_items p_sim_dina_items = NULL;
        if (p_sim_dina_items == NULL) {
            validateSignature("arma::mat(*sim_dina_items)(const arma::mat&,const arma::mat&,const arma::vec&,const arma::vec&)");
            p_sim_dina_items = (Ptr_sim_dina_items)R_GetCCallable("simcdm", "_simcdm_sim_dina_items");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_dina_items(Shield<SEXP>(Rcpp::wrap(alphas)), Shield<SEXP>(Rcpp::wrap(Q)), Shield<SEXP>(Rcpp::wrap(ss)), Shield<SEXP>(Rcpp::wrap(gs)));
        }
        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 sim_rrum_main(const arma::mat& Q, const arma::mat& rstar, const arma::vec& pistar, const arma::mat& alpha) {
        typedef SEXP(*Ptr_sim_rrum_main)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sim_rrum_main p_sim_rrum_main = NULL;
        if (p_sim_rrum_main == NULL) {
            validateSignature("arma::mat(*sim_rrum_main)(const arma::mat&,const arma::mat&,const arma::vec&,const arma::mat&)");
            p_sim_rrum_main = (Ptr_sim_rrum_main)R_GetCCallable("simcdm", "_simcdm_sim_rrum_main");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_rrum_main(Shield<SEXP>(Rcpp::wrap(Q)), Shield<SEXP>(Rcpp::wrap(rstar)), Shield<SEXP>(Rcpp::wrap(pistar)), Shield<SEXP>(Rcpp::wrap(alpha)));
        }
        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 sim_rrum_items(const arma::mat& Q, const arma::mat& rstar, const arma::vec& pistar, const arma::mat& alpha) {
        typedef SEXP(*Ptr_sim_rrum_items)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sim_rrum_items p_sim_rrum_items = NULL;
        if (p_sim_rrum_items == NULL) {
            validateSignature("arma::mat(*sim_rrum_items)(const arma::mat&,const arma::mat&,const arma::vec&,const arma::mat&)");
            p_sim_rrum_items = (Ptr_sim_rrum_items)R_GetCCallable("simcdm", "_simcdm_sim_rrum_items");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_rrum_items(Shield<SEXP>(Rcpp::wrap(Q)), Shield<SEXP>(Rcpp::wrap(rstar)), Shield<SEXP>(Rcpp::wrap(pistar)), Shield<SEXP>(Rcpp::wrap(alpha)));
        }
        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 attribute_bijection(unsigned int K) {
        typedef SEXP(*Ptr_attribute_bijection)(SEXP);
        static Ptr_attribute_bijection p_attribute_bijection = NULL;
        if (p_attribute_bijection == NULL) {
            validateSignature("arma::vec(*attribute_bijection)(unsigned int)");
            p_attribute_bijection = (Ptr_attribute_bijection)R_GetCCallable("simcdm", "_simcdm_attribute_bijection");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_attribute_bijection(Shield<SEXP>(Rcpp::wrap(K)));
        }
        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 attribute_inv_bijection(unsigned int K, double CL) {
        typedef SEXP(*Ptr_attribute_inv_bijection)(SEXP,SEXP);
        static Ptr_attribute_inv_bijection p_attribute_inv_bijection = NULL;
        if (p_attribute_inv_bijection == NULL) {
            validateSignature("arma::vec(*attribute_inv_bijection)(unsigned int,double)");
            p_attribute_inv_bijection = (Ptr_attribute_inv_bijection)R_GetCCallable("simcdm", "_simcdm_attribute_inv_bijection");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_attribute_inv_bijection(Shield<SEXP>(Rcpp::wrap(K)), Shield<SEXP>(Rcpp::wrap(CL)));
        }
        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::mat sim_q_matrix(unsigned int J, unsigned int K) {
        typedef SEXP(*Ptr_sim_q_matrix)(SEXP,SEXP);
        static Ptr_sim_q_matrix p_sim_q_matrix = NULL;
        if (p_sim_q_matrix == NULL) {
            validateSignature("arma::mat(*sim_q_matrix)(unsigned int,unsigned int)");
            p_sim_q_matrix = (Ptr_sim_q_matrix)R_GetCCallable("simcdm", "_simcdm_sim_q_matrix");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_q_matrix(Shield<SEXP>(Rcpp::wrap(J)), Shield<SEXP>(Rcpp::wrap(K)));
        }
        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 sim_eta_matrix(unsigned int K, unsigned int J, const arma::mat& Q) {
        typedef SEXP(*Ptr_sim_eta_matrix)(SEXP,SEXP,SEXP);
        static Ptr_sim_eta_matrix p_sim_eta_matrix = NULL;
        if (p_sim_eta_matrix == NULL) {
            validateSignature("arma::mat(*sim_eta_matrix)(unsigned int,unsigned int,const arma::mat&)");
            p_sim_eta_matrix = (Ptr_sim_eta_matrix)R_GetCCallable("simcdm", "_simcdm_sim_eta_matrix");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_eta_matrix(Shield<SEXP>(Rcpp::wrap(K)), Shield<SEXP>(Rcpp::wrap(J)), Shield<SEXP>(Rcpp::wrap(Q)));
        }
        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 attribute_classes(int K) {
        typedef SEXP(*Ptr_attribute_classes)(SEXP);
        static Ptr_attribute_classes p_attribute_classes = NULL;
        if (p_attribute_classes == NULL) {
            validateSignature("arma::mat(*attribute_classes)(int)");
            p_attribute_classes = (Ptr_attribute_classes)R_GetCCallable("simcdm", "_simcdm_attribute_classes");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_attribute_classes(Shield<SEXP>(Rcpp::wrap(K)));
        }
        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 sim_subject_attributes(int N, int K, Rcpp::Nullable<Rcpp::NumericVector> probs = R_NilValue) {
        typedef SEXP(*Ptr_sim_subject_attributes)(SEXP,SEXP,SEXP);
        static Ptr_sim_subject_attributes p_sim_subject_attributes = NULL;
        if (p_sim_subject_attributes == NULL) {
            validateSignature("arma::mat(*sim_subject_attributes)(int,int,Rcpp::Nullable<Rcpp::NumericVector>)");
            p_sim_subject_attributes = (Ptr_sim_subject_attributes)R_GetCCallable("simcdm", "_simcdm_sim_subject_attributes");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sim_subject_attributes(Shield<SEXP>(Rcpp::wrap(N)), Shield<SEXP>(Rcpp::wrap(K)), Shield<SEXP>(Rcpp::wrap(probs)));
        }
        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_simcdm_RCPPEXPORTS_H_GEN_
