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

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

using namespace Rcpp;

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

// loglikPCMlasso
double loglikPCMlasso(arma::vec alpha, arma::vec Y, arma::mat X, arma::mat Z, int Q, arma::vec q, int n, int I, int px, arma::vec GHweights, arma::vec GHnodes, arma::mat acoefs, double lambda, double lambda2, double cvalue, int cores, arma::vec weight, int n_sigma, double scale_fac);
RcppExport SEXP _GPCMlasso_loglikPCMlasso(SEXP alphaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP QSEXP, SEXP qSEXP, SEXP nSEXP, SEXP ISEXP, SEXP pxSEXP, SEXP GHweightsSEXP, SEXP GHnodesSEXP, SEXP acoefsSEXP, SEXP lambdaSEXP, SEXP lambda2SEXP, SEXP cvalueSEXP, SEXP coresSEXP, SEXP weightSEXP, SEXP n_sigmaSEXP, SEXP scale_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< int >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type q(qSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHweights(GHweightsSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHnodes(GHnodesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type acoefs(acoefsSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda2(lambda2SEXP);
    Rcpp::traits::input_parameter< double >::type cvalue(cvalueSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< int >::type n_sigma(n_sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type scale_fac(scale_facSEXP);
    rcpp_result_gen = Rcpp::wrap(loglikPCMlasso(alpha, Y, X, Z, Q, q, n, I, px, GHweights, GHnodes, acoefs, lambda, lambda2, cvalue, cores, weight, n_sigma, scale_fac));
    return rcpp_result_gen;
END_RCPP
}
// scorePCMlasso
arma::vec scorePCMlasso(arma::vec alpha, arma::vec Y, arma::mat X, arma::mat Z, int Q, arma::vec q, int n, int I, int px, arma::vec GHweights, arma::vec GHnodes, arma::mat acoefs, double lambda, double lambda2, double cvalue, int cores, arma::vec weight, int n_sigma, double scale_fac);
RcppExport SEXP _GPCMlasso_scorePCMlasso(SEXP alphaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP QSEXP, SEXP qSEXP, SEXP nSEXP, SEXP ISEXP, SEXP pxSEXP, SEXP GHweightsSEXP, SEXP GHnodesSEXP, SEXP acoefsSEXP, SEXP lambdaSEXP, SEXP lambda2SEXP, SEXP cvalueSEXP, SEXP coresSEXP, SEXP weightSEXP, SEXP n_sigmaSEXP, SEXP scale_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< int >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type q(qSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHweights(GHweightsSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHnodes(GHnodesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type acoefs(acoefsSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda2(lambda2SEXP);
    Rcpp::traits::input_parameter< double >::type cvalue(cvalueSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< int >::type n_sigma(n_sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type scale_fac(scale_facSEXP);
    rcpp_result_gen = Rcpp::wrap(scorePCMlasso(alpha, Y, X, Z, Q, q, n, I, px, GHweights, GHnodes, acoefs, lambda, lambda2, cvalue, cores, weight, n_sigma, scale_fac));
    return rcpp_result_gen;
END_RCPP
}
// loglikDIFlasso
double loglikDIFlasso(arma::vec alpha, arma::vec Y, arma::mat X, arma::mat Z, int Q, arma::vec q, int n, int I, int px, arma::vec GHweights, arma::vec GHnodes, arma::mat acoefs, double lambda, double lambda2, double cvalue, int cores, arma::vec weight, int n_sigma, double scale_fac);
RcppExport SEXP _GPCMlasso_loglikDIFlasso(SEXP alphaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP QSEXP, SEXP qSEXP, SEXP nSEXP, SEXP ISEXP, SEXP pxSEXP, SEXP GHweightsSEXP, SEXP GHnodesSEXP, SEXP acoefsSEXP, SEXP lambdaSEXP, SEXP lambda2SEXP, SEXP cvalueSEXP, SEXP coresSEXP, SEXP weightSEXP, SEXP n_sigmaSEXP, SEXP scale_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< int >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type q(qSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHweights(GHweightsSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHnodes(GHnodesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type acoefs(acoefsSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda2(lambda2SEXP);
    Rcpp::traits::input_parameter< double >::type cvalue(cvalueSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< int >::type n_sigma(n_sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type scale_fac(scale_facSEXP);
    rcpp_result_gen = Rcpp::wrap(loglikDIFlasso(alpha, Y, X, Z, Q, q, n, I, px, GHweights, GHnodes, acoefs, lambda, lambda2, cvalue, cores, weight, n_sigma, scale_fac));
    return rcpp_result_gen;
END_RCPP
}
// scoreDIFlasso
arma::vec scoreDIFlasso(arma::vec alpha, arma::vec Y, arma::mat X, arma::mat Z, int Q, arma::vec q, int n, int I, int px, arma::vec GHweights, arma::vec GHnodes, arma::mat acoefs, double lambda, double lambda2, double cvalue, int cores, arma::vec weight, int n_sigma, double scale_fac);
RcppExport SEXP _GPCMlasso_scoreDIFlasso(SEXP alphaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP QSEXP, SEXP qSEXP, SEXP nSEXP, SEXP ISEXP, SEXP pxSEXP, SEXP GHweightsSEXP, SEXP GHnodesSEXP, SEXP acoefsSEXP, SEXP lambdaSEXP, SEXP lambda2SEXP, SEXP cvalueSEXP, SEXP coresSEXP, SEXP weightSEXP, SEXP n_sigmaSEXP, SEXP scale_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< int >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type q(qSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHweights(GHweightsSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHnodes(GHnodesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type acoefs(acoefsSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda2(lambda2SEXP);
    Rcpp::traits::input_parameter< double >::type cvalue(cvalueSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< int >::type n_sigma(n_sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type scale_fac(scale_facSEXP);
    rcpp_result_gen = Rcpp::wrap(scoreDIFlasso(alpha, Y, X, Z, Q, q, n, I, px, GHweights, GHnodes, acoefs, lambda, lambda2, cvalue, cores, weight, n_sigma, scale_fac));
    return rcpp_result_gen;
END_RCPP
}
// loglikscorePCMlasso
Rcpp::List loglikscorePCMlasso(arma::vec alpha, arma::vec Y, arma::mat X, arma::mat Z, int Q, arma::vec q, int n, int I, int px, arma::vec GHweights, arma::vec GHnodes, arma::mat acoefs, double lambda, double lambda2, double cvalue, int cores, arma::vec weight, int n_sigma, double scale_fac);
RcppExport SEXP _GPCMlasso_loglikscorePCMlasso(SEXP alphaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP QSEXP, SEXP qSEXP, SEXP nSEXP, SEXP ISEXP, SEXP pxSEXP, SEXP GHweightsSEXP, SEXP GHnodesSEXP, SEXP acoefsSEXP, SEXP lambdaSEXP, SEXP lambda2SEXP, SEXP cvalueSEXP, SEXP coresSEXP, SEXP weightSEXP, SEXP n_sigmaSEXP, SEXP scale_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< int >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type q(qSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHweights(GHweightsSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHnodes(GHnodesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type acoefs(acoefsSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda2(lambda2SEXP);
    Rcpp::traits::input_parameter< double >::type cvalue(cvalueSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< int >::type n_sigma(n_sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type scale_fac(scale_facSEXP);
    rcpp_result_gen = Rcpp::wrap(loglikscorePCMlasso(alpha, Y, X, Z, Q, q, n, I, px, GHweights, GHnodes, acoefs, lambda, lambda2, cvalue, cores, weight, n_sigma, scale_fac));
    return rcpp_result_gen;
END_RCPP
}
// loglikscoreDIFlasso
Rcpp::List loglikscoreDIFlasso(arma::vec alpha, arma::vec Y, arma::mat X, arma::mat Z, int Q, arma::vec q, int n, int I, int px, arma::vec GHweights, arma::vec GHnodes, arma::mat acoefs, double lambda, double lambda2, double cvalue, int cores, arma::vec weight, int n_sigma, double scale_fac);
RcppExport SEXP _GPCMlasso_loglikscoreDIFlasso(SEXP alphaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP QSEXP, SEXP qSEXP, SEXP nSEXP, SEXP ISEXP, SEXP pxSEXP, SEXP GHweightsSEXP, SEXP GHnodesSEXP, SEXP acoefsSEXP, SEXP lambdaSEXP, SEXP lambda2SEXP, SEXP cvalueSEXP, SEXP coresSEXP, SEXP weightSEXP, SEXP n_sigmaSEXP, SEXP scale_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type Y(YSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< int >::type Q(QSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type q(qSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHweights(GHweightsSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type GHnodes(GHnodesSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type acoefs(acoefsSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda2(lambda2SEXP);
    Rcpp::traits::input_parameter< double >::type cvalue(cvalueSEXP);
    Rcpp::traits::input_parameter< int >::type cores(coresSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< int >::type n_sigma(n_sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type scale_fac(scale_facSEXP);
    rcpp_result_gen = Rcpp::wrap(loglikscoreDIFlasso(alpha, Y, X, Z, Q, q, n, I, px, GHweights, GHnodes, acoefs, lambda, lambda2, cvalue, cores, weight, n_sigma, scale_fac));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_GPCMlasso_loglikPCMlasso", (DL_FUNC) &_GPCMlasso_loglikPCMlasso, 19},
    {"_GPCMlasso_scorePCMlasso", (DL_FUNC) &_GPCMlasso_scorePCMlasso, 19},
    {"_GPCMlasso_loglikDIFlasso", (DL_FUNC) &_GPCMlasso_loglikDIFlasso, 19},
    {"_GPCMlasso_scoreDIFlasso", (DL_FUNC) &_GPCMlasso_scoreDIFlasso, 19},
    {"_GPCMlasso_loglikscorePCMlasso", (DL_FUNC) &_GPCMlasso_loglikscorePCMlasso, 19},
    {"_GPCMlasso_loglikscoreDIFlasso", (DL_FUNC) &_GPCMlasso_loglikscoreDIFlasso, 19},
    {NULL, NULL, 0}
};

RcppExport void R_init_GPCMlasso(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
