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

#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

// ft_y
double ft_y(double y, double mung, double mutg, double sng, double stg, double pi1, double pi2);
RcppExport SEXP _DeMixT_ft_y(SEXP ySEXP, SEXP mungSEXP, SEXP mutgSEXP, SEXP sngSEXP, SEXP stgSEXP, SEXP pi1SEXP, SEXP pi2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< double >::type mutg(mutgSEXP);
    Rcpp::traits::input_parameter< double >::type sng(sngSEXP);
    Rcpp::traits::input_parameter< double >::type stg(stgSEXP);
    Rcpp::traits::input_parameter< double >::type pi1(pi1SEXP);
    Rcpp::traits::input_parameter< double >::type pi2(pi2SEXP);
    rcpp_result_gen = Rcpp::wrap(ft_y(y, mung, mutg, sng, stg, pi1, pi2));
    return rcpp_result_gen;
END_RCPP
}
// pf_y
double pf_y(NumericMatrix y, int samp, NumericVector mung, NumericVector mutg, NumericVector sng, NumericVector stg, double pi1);
RcppExport SEXP _DeMixT_pf_y(SEXP ySEXP, SEXP sampSEXP, SEXP mungSEXP, SEXP mutgSEXP, SEXP sngSEXP, SEXP stgSEXP, SEXP pi1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< int >::type samp(sampSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type mutg(mutgSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type sng(sngSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type stg(stgSEXP);
    Rcpp::traits::input_parameter< double >::type pi1(pi1SEXP);
    rcpp_result_gen = Rcpp::wrap(pf_y(y, samp, mung, mutg, sng, stg, pi1));
    return rcpp_result_gen;
END_RCPP
}
// pmin_y
double pmin_y(double ax, double bx, int samp, NumericMatrix y, NumericVector mung, NumericVector mutg, NumericVector sng, NumericVector stg, double tol);
RcppExport SEXP _DeMixT_pmin_y(SEXP axSEXP, SEXP bxSEXP, SEXP sampSEXP, SEXP ySEXP, SEXP mungSEXP, SEXP mutgSEXP, SEXP sngSEXP, SEXP stgSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type ax(axSEXP);
    Rcpp::traits::input_parameter< double >::type bx(bxSEXP);
    Rcpp::traits::input_parameter< int >::type samp(sampSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type mutg(mutgSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type sng(sngSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type stg(stgSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(pmin_y(ax, bx, samp, y, mung, mutg, sng, stg, tol));
    return rcpp_result_gen;
END_RCPP
}
// tf_y
double tf_y(int genes, double mu, double sigma, NumericMatrix y, NumericVector pi1, double mung, double sng);
RcppExport SEXP _DeMixT_tf_y(SEXP genesSEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP ySEXP, SEXP pi1SEXP, SEXP mungSEXP, SEXP sngSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type genes(genesSEXP);
    Rcpp::traits::input_parameter< double >::type mu(muSEXP);
    Rcpp::traits::input_parameter< double >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type pi1(pi1SEXP);
    Rcpp::traits::input_parameter< double >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< double >::type sng(sngSEXP);
    rcpp_result_gen = Rcpp::wrap(tf_y(genes, mu, sigma, y, pi1, mung, sng));
    return rcpp_result_gen;
END_RCPP
}
// tmin_y2
double tmin_y2(double ax, double bx, int genes, double mu, NumericMatrix y, NumericVector pi1, double mung, double sng, double tol);
RcppExport SEXP _DeMixT_tmin_y2(SEXP axSEXP, SEXP bxSEXP, SEXP genesSEXP, SEXP muSEXP, SEXP ySEXP, SEXP pi1SEXP, SEXP mungSEXP, SEXP sngSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type ax(axSEXP);
    Rcpp::traits::input_parameter< double >::type bx(bxSEXP);
    Rcpp::traits::input_parameter< int >::type genes(genesSEXP);
    Rcpp::traits::input_parameter< double >::type mu(muSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type pi1(pi1SEXP);
    Rcpp::traits::input_parameter< double >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< double >::type sng(sngSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tmin_y2(ax, bx, genes, mu, y, pi1, mung, sng, tol));
    return rcpp_result_gen;
END_RCPP
}
// mint
double mint(int genes, double mu, NumericMatrix y, NumericVector pi1, double mung, double sng);
RcppExport SEXP _DeMixT_mint(SEXP genesSEXP, SEXP muSEXP, SEXP ySEXP, SEXP pi1SEXP, SEXP mungSEXP, SEXP sngSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type genes(genesSEXP);
    Rcpp::traits::input_parameter< double >::type mu(muSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type pi1(pi1SEXP);
    Rcpp::traits::input_parameter< double >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< double >::type sng(sngSEXP);
    rcpp_result_gen = Rcpp::wrap(mint(genes, mu, y, pi1, mung, sng));
    return rcpp_result_gen;
END_RCPP
}
// tmin_y
double tmin_y(double ax, double bx, int genes, NumericMatrix y, NumericVector pi1, double mung, double sng, double tol);
RcppExport SEXP _DeMixT_tmin_y(SEXP axSEXP, SEXP bxSEXP, SEXP genesSEXP, SEXP ySEXP, SEXP pi1SEXP, SEXP mungSEXP, SEXP sngSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type ax(axSEXP);
    Rcpp::traits::input_parameter< double >::type bx(bxSEXP);
    Rcpp::traits::input_parameter< int >::type genes(genesSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type pi1(pi1SEXP);
    Rcpp::traits::input_parameter< double >::type mung(mungSEXP);
    Rcpp::traits::input_parameter< double >::type sng(sngSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tmin_y(ax, bx, genes, y, pi1, mung, sng, tol));
    return rcpp_result_gen;
END_RCPP
}
// Loglikelihood_ft_y
double Loglikelihood_ft_y(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_Loglikelihood_ft_y(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(Loglikelihood_ft_y(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// SoftThreshold
double SoftThreshold(double x, double t);
RcppExport SEXP _DeMixT_SoftThreshold(SEXP xSEXP, SEXP tSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    rcpp_result_gen = Rcpp::wrap(SoftThreshold(x, t));
    return rcpp_result_gen;
END_RCPP
}
// SoftThreshold_vec
NumericVector SoftThreshold_vec(NumericVector x, double t);
RcppExport SEXP _DeMixT_SoftThreshold_vec(SEXP xSEXP, SEXP tSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    rcpp_result_gen = Rcpp::wrap(SoftThreshold_vec(x, t));
    return rcpp_result_gen;
END_RCPP
}
// Gt
NumericVector Gt(NumericVector x, NumericVector Dg, double t);
RcppExport SEXP _DeMixT_Gt(SEXP xSEXP, SEXP DgSEXP, SEXP tSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Dg(DgSEXP);
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    rcpp_result_gen = Rcpp::wrap(Gt(x, Dg, t));
    return rcpp_result_gen;
END_RCPP
}
// Gt_vec
NumericVector Gt_vec(NumericVector x, NumericVector Dg, double t);
RcppExport SEXP _DeMixT_Gt_vec(SEXP xSEXP, SEXP DgSEXP, SEXP tSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Dg(DgSEXP);
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    rcpp_result_gen = Rcpp::wrap(Gt_vec(x, Dg, t));
    return rcpp_result_gen;
END_RCPP
}
// Alpha_search_2D
double Alpha_search_2D(NumericVector x, NumericVector p, int S, int G);
RcppExport SEXP _DeMixT_Alpha_search_2D(SEXP xSEXP, SEXP pSEXP, SEXP SSEXP, SEXP GSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    rcpp_result_gen = Rcpp::wrap(Alpha_search_2D(x, p, S, G));
    return rcpp_result_gen;
END_RCPP
}
// Alpha_search_Pi_2D
double Alpha_search_Pi_2D(NumericVector x, NumericVector p, int S);
RcppExport SEXP _DeMixT_Alpha_search_Pi_2D(SEXP xSEXP, SEXP pSEXP, SEXP SSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    rcpp_result_gen = Rcpp::wrap(Alpha_search_Pi_2D(x, p, S));
    return rcpp_result_gen;
END_RCPP
}
// Alpha_search_MuT_2D
double Alpha_search_MuT_2D(NumericVector x, NumericVector p, int G);
RcppExport SEXP _DeMixT_Alpha_search_MuT_2D(SEXP xSEXP, SEXP pSEXP, SEXP GSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    rcpp_result_gen = Rcpp::wrap(Alpha_search_MuT_2D(x, p, G));
    return rcpp_result_gen;
END_RCPP
}
// Alpha_search_SigmaT_2D
double Alpha_search_SigmaT_2D(NumericVector x, NumericVector p, int G);
RcppExport SEXP _DeMixT_Alpha_search_SigmaT_2D(SEXP xSEXP, SEXP pSEXP, SEXP GSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    rcpp_result_gen = Rcpp::wrap(Alpha_search_SigmaT_2D(x, p, G));
    return rcpp_result_gen;
END_RCPP
}
// Alpha_search_2D_sigma
double Alpha_search_2D_sigma(NumericVector x, NumericVector p, int S, int G);
RcppExport SEXP _DeMixT_Alpha_search_2D_sigma(SEXP xSEXP, SEXP pSEXP, SEXP SSEXP, SEXP GSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    rcpp_result_gen = Rcpp::wrap(Alpha_search_2D_sigma(x, p, S, G));
    return rcpp_result_gen;
END_RCPP
}
// Unit1
double Unit1(double t, double Mu, double Pit);
RcppExport SEXP _DeMixT_Unit1(SEXP tSEXP, SEXP MuSEXP, SEXP PitSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type Mu(MuSEXP);
    Rcpp::traits::input_parameter< double >::type Pit(PitSEXP);
    rcpp_result_gen = Rcpp::wrap(Unit1(t, Mu, Pit));
    return rcpp_result_gen;
END_RCPP
}
// x_update_2D
NumericVector x_update_2D(NumericVector Pi, NumericVector MuT, NumericVector SigmaT, int S, int G);
RcppExport SEXP _DeMixT_x_update_2D(SEXP PiSEXP, SEXP MuTSEXP, SEXP SigmaTSEXP, SEXP SSEXP, SEXP GSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    rcpp_result_gen = Rcpp::wrap(x_update_2D(Pi, MuT, SigmaT, S, G));
    return rcpp_result_gen;
END_RCPP
}
// x_update_inv_2D
List x_update_inv_2D(NumericVector x, int S, int G);
RcppExport SEXP _DeMixT_x_update_inv_2D(SEXP xSEXP, SEXP SSEXP, SEXP GSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    rcpp_result_gen = Rcpp::wrap(x_update_inv_2D(x, S, G));
    return rcpp_result_gen;
END_RCPP
}
// innerCPP_2D
double innerCPP_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_innerCPP_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(innerCPP_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// inner_trapez_2D
double inner_trapez_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_inner_trapez_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(inner_trapez_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// DPi_inner_2D
double DPi_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_DPi_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(DPi_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// DPi_outer_2D
double DPi_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_DPi_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(DPi_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1f0Pi_func_2D
NumericMatrix D1f0Pi_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1f0Pi_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1f0Pi_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// DMuT_inner_2D
double DMuT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_DMuT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(DMuT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// DMuT_outer_2D
double DMuT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_DMuT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(DMuT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1f0MuT_func_2D
NumericMatrix D1f0MuT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1f0MuT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1f0MuT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// DSigmaT_inner_2D
double DSigmaT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_DSigmaT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(DSigmaT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// DSigmaT_outer_2D
double DSigmaT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_DSigmaT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(DSigmaT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1f0SigmaT_func_2D
NumericMatrix D1f0SigmaT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1f0SigmaT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1f0SigmaT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2Pi_inner_2D
double D2Pi_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT, double ln2);
RcppExport SEXP _DeMixT_D2Pi_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP ln2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< double >::type ln2(ln2SEXP);
    rcpp_result_gen = Rcpp::wrap(D2Pi_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT, ln2));
    return rcpp_result_gen;
END_RCPP
}
// D2Pi_outer_2D
double D2Pi_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2Pi_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2Pi_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2f0Pi_func_2D
NumericMatrix D2f0Pi_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2f0Pi_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2f0Pi_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2PiMuT_inner_2D
double D2PiMuT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2PiMuT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2PiMuT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2PiMuT_outer_2D
double D2PiMuT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2PiMuT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2PiMuT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2f0PiMuT_func_2D
NumericMatrix D2f0PiMuT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2f0PiMuT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2f0PiMuT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2PiSigmaT_inner_2D
double D2PiSigmaT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2PiSigmaT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2PiSigmaT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2PiSigmaT_outer_2D
double D2PiSigmaT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2PiSigmaT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2PiSigmaT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2f0PiSigmaT_func_2D
NumericMatrix D2f0PiSigmaT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2f0PiSigmaT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2f0PiSigmaT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2MuT_inner_2D
double D2MuT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2MuT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2MuT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2MuT_outer_2D
double D2MuT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2MuT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2MuT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2f0MuT_func_2D
NumericMatrix D2f0MuT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2f0MuT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2f0MuT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2MuTSigmaT_inner_2D
double D2MuTSigmaT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2MuTSigmaT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2MuTSigmaT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2MuTSigmaT_outer_2D
double D2MuTSigmaT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2MuTSigmaT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2MuTSigmaT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2f0MuTSigmaT_func_2D
NumericMatrix D2f0MuTSigmaT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2f0MuTSigmaT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2f0MuTSigmaT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2SigmaT_inner_2D
double D2SigmaT_inner_2D(double t, double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2SigmaT_inner_2D(SEXP tSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2SigmaT_inner_2D(t, y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2SigmaT_outer_2D
double D2SigmaT_outer_2D(double y, double Pi, double MuN, double MuT, double SigmaN, double SigmaT);
RcppExport SEXP _DeMixT_D2SigmaT_outer_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< double >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2SigmaT_outer_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2f0SigmaT_func_2D
NumericMatrix D2f0SigmaT_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2f0SigmaT_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2f0SigmaT_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// f0_func_2D
NumericMatrix f0_func_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_f0_func_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(f0_func_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// Loglikelihood_Pi_2D
double Loglikelihood_Pi_2D(NumericMatrix y, double Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT, int j);
RcppExport SEXP _DeMixT_Loglikelihood_Pi_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP jSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< int >::type j(jSEXP);
    rcpp_result_gen = Rcpp::wrap(Loglikelihood_Pi_2D(y, Pi, MuN, MuT, SigmaN, SigmaT, j));
    return rcpp_result_gen;
END_RCPP
}
// GoldenSection_Loglikelihood_Pi_2D
double GoldenSection_Loglikelihood_Pi_2D(NumericMatrix y, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT, int j);
RcppExport SEXP _DeMixT_GoldenSection_Loglikelihood_Pi_2D(SEXP ySEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP jSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< int >::type j(jSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenSection_Loglikelihood_Pi_2D(y, MuN, MuT, SigmaN, SigmaT, j));
    return rcpp_result_gen;
END_RCPP
}
// Loglikelihood_MuT_2D
double Loglikelihood_MuT_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, double MuT, NumericVector SigmaN, NumericVector SigmaT, int i);
RcppExport SEXP _DeMixT_Loglikelihood_MuT_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP iSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< double >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< int >::type i(iSEXP);
    rcpp_result_gen = Rcpp::wrap(Loglikelihood_MuT_2D(y, Pi, MuN, MuT, SigmaN, SigmaT, i));
    return rcpp_result_gen;
END_RCPP
}
// GoldenSection_Loglikelihood_MuT_2D
double GoldenSection_Loglikelihood_MuT_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector SigmaN, NumericVector SigmaT, int j);
RcppExport SEXP _DeMixT_GoldenSection_Loglikelihood_MuT_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP jSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< int >::type j(jSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenSection_Loglikelihood_MuT_2D(y, Pi, MuN, SigmaN, SigmaT, j));
    return rcpp_result_gen;
END_RCPP
}
// Loglikelihood_SigmaT_2D
double Loglikelihood_SigmaT_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, double SigmaT, int i);
RcppExport SEXP _DeMixT_Loglikelihood_SigmaT_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP iSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< int >::type i(iSEXP);
    rcpp_result_gen = Rcpp::wrap(Loglikelihood_SigmaT_2D(y, Pi, MuN, MuT, SigmaN, SigmaT, i));
    return rcpp_result_gen;
END_RCPP
}
// GoldenSection_Loglikelihood_SigmaT_2D
double GoldenSection_Loglikelihood_SigmaT_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, int j);
RcppExport SEXP _DeMixT_GoldenSection_Loglikelihood_SigmaT_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP jSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< int >::type j(jSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenSection_Loglikelihood_SigmaT_2D(y, Pi, MuN, MuT, SigmaN, j));
    return rcpp_result_gen;
END_RCPP
}
// Loglikelihood_2D
double Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// Loglikelihood_2D_L1
double Loglikelihood_2D_L1(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector Beta, NumericVector SigmaN, NumericVector SigmaT, double lambda);
RcppExport SEXP _DeMixT_Loglikelihood_2D_L1(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP BetaSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP lambdaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Beta(BetaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    rcpp_result_gen = Rcpp::wrap(Loglikelihood_2D_L1(y, Pi, MuN, Beta, SigmaN, SigmaT, lambda));
    return rcpp_result_gen;
END_RCPP
}
// D1Loglikelihood_2D
NumericVector D1Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1Pi_Loglikelihood_2D
NumericVector D1Pi_Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1Pi_Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1Pi_Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1MuTSigmaT_Loglikelihood_2D
NumericVector D1MuTSigmaT_Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1MuTSigmaT_Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1MuTSigmaT_Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1MuT_Loglikelihood_2D
NumericVector D1MuT_Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1MuT_Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1MuT_Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D1SigmaT_Loglikelihood_2D
NumericVector D1SigmaT_Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1SigmaT_Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1SigmaT_Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// log_divide
double log_divide(double x, double f);
RcppExport SEXP _DeMixT_log_divide(SEXP xSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(log_divide(x, f));
    return rcpp_result_gen;
END_RCPP
}
// D1Loglikelihood_log_2D
NumericVector D1Loglikelihood_log_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D1Loglikelihood_log_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D1Loglikelihood_log_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2Loglikelihood_log_2D
NumericMatrix D2Loglikelihood_log_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2Loglikelihood_log_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2Loglikelihood_log_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2Loglikelihood_2D
NumericMatrix D2Loglikelihood_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2Loglikelihood_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2Loglikelihood_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// D2Loglikelihood_unit_2D
List D2Loglikelihood_unit_2D(NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT);
RcppExport SEXP _DeMixT_D2Loglikelihood_unit_2D(SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    rcpp_result_gen = Rcpp::wrap(D2Loglikelihood_unit_2D(y, Pi, MuN, MuT, SigmaN, SigmaT));
    return rcpp_result_gen;
END_RCPP
}
// Gfunc_2D_C
double Gfunc_2D_C(double alpha, NumericVector x, NumericVector p, int S, int G, NumericMatrix y, NumericVector MuN, NumericVector SigmaN);
RcppExport SEXP _DeMixT_Gfunc_2D_C(SEXP alphaSEXP, SEXP xSEXP, SEXP pSEXP, SEXP SSEXP, SEXP GSEXP, SEXP ySEXP, SEXP MuNSEXP, SEXP SigmaNSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    rcpp_result_gen = Rcpp::wrap(Gfunc_2D_C(alpha, x, p, S, G, y, MuN, SigmaN));
    return rcpp_result_gen;
END_RCPP
}
// GoldenLine_search_2D
double GoldenLine_search_2D(double alpha, NumericVector x, NumericVector p, NumericMatrix y, NumericVector MuN, NumericVector SigmaN, int S, int G, double steps);
RcppExport SEXP _DeMixT_GoldenLine_search_2D(SEXP alphaSEXP, SEXP xSEXP, SEXP pSEXP, SEXP ySEXP, SEXP MuNSEXP, SEXP SigmaNSEXP, SEXP SSEXP, SEXP GSEXP, SEXP stepsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< int >::type S(SSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    Rcpp::traits::input_parameter< double >::type steps(stepsSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenLine_search_2D(alpha, x, p, y, MuN, SigmaN, S, G, steps));
    return rcpp_result_gen;
END_RCPP
}
// GoldenLine_search_Pi_2D
double GoldenLine_search_Pi_2D(double alpha, NumericVector x, NumericVector p, NumericMatrix y, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, NumericVector SigmaT, double steps);
RcppExport SEXP _DeMixT_GoldenLine_search_Pi_2D(SEXP alphaSEXP, SEXP xSEXP, SEXP pSEXP, SEXP ySEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP stepsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< double >::type steps(stepsSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenLine_search_Pi_2D(alpha, x, p, y, MuN, MuT, SigmaN, SigmaT, steps));
    return rcpp_result_gen;
END_RCPP
}
// GoldenLine_search_MuT_2D
double GoldenLine_search_MuT_2D(double alpha, NumericVector x, NumericVector p, NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector SigmaN, NumericVector SigmaT, double steps);
RcppExport SEXP _DeMixT_GoldenLine_search_MuT_2D(SEXP alphaSEXP, SEXP xSEXP, SEXP pSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP SigmaNSEXP, SEXP SigmaTSEXP, SEXP stepsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaT(SigmaTSEXP);
    Rcpp::traits::input_parameter< double >::type steps(stepsSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenLine_search_MuT_2D(alpha, x, p, y, Pi, MuN, SigmaN, SigmaT, steps));
    return rcpp_result_gen;
END_RCPP
}
// GoldenLine_search_SigmaT_2D
double GoldenLine_search_SigmaT_2D(double alpha, NumericVector x, NumericVector p, NumericMatrix y, NumericVector Pi, NumericVector MuN, NumericVector MuT, NumericVector SigmaN, double steps);
RcppExport SEXP _DeMixT_GoldenLine_search_SigmaT_2D(SEXP alphaSEXP, SEXP xSEXP, SEXP pSEXP, SEXP ySEXP, SEXP PiSEXP, SEXP MuNSEXP, SEXP MuTSEXP, SEXP SigmaNSEXP, SEXP stepsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< NumericVector >::type Pi(PiSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuN(MuNSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type MuT(MuTSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type SigmaN(SigmaNSEXP);
    Rcpp::traits::input_parameter< double >::type steps(stepsSEXP);
    rcpp_result_gen = Rcpp::wrap(GoldenLine_search_SigmaT_2D(alpha, x, p, y, Pi, MuN, MuT, SigmaN, steps));
    return rcpp_result_gen;
END_RCPP
}
