// 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

// createSimilarityMat
arma::mat createSimilarityMat(arma::umat allocations);
RcppExport SEXP _batchmix_createSimilarityMat(SEXP allocationsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::umat >::type allocations(allocationsSEXP);
    rcpp_result_gen = Rcpp::wrap(createSimilarityMat(allocations));
    return rcpp_result_gen;
END_RCPP
}
// gammaLogLikelihood
double gammaLogLikelihood(double x, double shape, double rate);
RcppExport SEXP _batchmix_gammaLogLikelihood(SEXP xSEXP, SEXP shapeSEXP, SEXP rateSEXP) {
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 shape(shapeSEXP);
    Rcpp::traits::input_parameter< double >::type rate(rateSEXP);
    rcpp_result_gen = Rcpp::wrap(gammaLogLikelihood(x, shape, rate));
    return rcpp_result_gen;
END_RCPP
}
// invGammaLogLikelihood
double invGammaLogLikelihood(double x, double shape, double scale);
RcppExport SEXP _batchmix_invGammaLogLikelihood(SEXP xSEXP, SEXP shapeSEXP, SEXP scaleSEXP) {
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 shape(shapeSEXP);
    Rcpp::traits::input_parameter< double >::type scale(scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(invGammaLogLikelihood(x, shape, scale));
    return rcpp_result_gen;
END_RCPP
}
// wishartLogLikelihood
double wishartLogLikelihood(arma::mat X, arma::mat V, double n, arma::uword P);
RcppExport SEXP _batchmix_wishartLogLikelihood(SEXP XSEXP, SEXP VSEXP, SEXP nSEXP, SEXP PSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type n(nSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type P(PSEXP);
    rcpp_result_gen = Rcpp::wrap(wishartLogLikelihood(X, V, n, P));
    return rcpp_result_gen;
END_RCPP
}
// invWishartLogLikelihood
double invWishartLogLikelihood(arma::mat X, arma::mat Psi, double nu, arma::uword P);
RcppExport SEXP _batchmix_invWishartLogLikelihood(SEXP XSEXP, SEXP PsiSEXP, SEXP nuSEXP, SEXP PSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type Psi(PsiSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type P(PSEXP);
    rcpp_result_gen = Rcpp::wrap(invWishartLogLikelihood(X, Psi, nu, P));
    return rcpp_result_gen;
END_RCPP
}
// sampleMVN
Rcpp::List sampleMVN(arma::mat X, arma::uword K, arma::uword B, arma::uvec labels, arma::uvec batch_vec, double mu_proposal_window, double cov_proposal_window, double m_proposal_window, double S_proposal_window, arma::uword R, arma::uword thin, arma::vec concentration, double m_scale, double rho, double theta, arma::mat initial_mu, arma::cube initial_cov, arma::mat initial_m, arma::mat initial_S, bool mu_initialised, bool cov_initialised, bool m_initialised, bool S_initialised, bool sample_m_scale);
RcppExport SEXP _batchmix_sampleMVN(SEXP XSEXP, SEXP KSEXP, SEXP BSEXP, SEXP labelsSEXP, SEXP batch_vecSEXP, SEXP mu_proposal_windowSEXP, SEXP cov_proposal_windowSEXP, SEXP m_proposal_windowSEXP, SEXP S_proposal_windowSEXP, SEXP RSEXP, SEXP thinSEXP, SEXP concentrationSEXP, SEXP m_scaleSEXP, SEXP rhoSEXP, SEXP thetaSEXP, SEXP initial_muSEXP, SEXP initial_covSEXP, SEXP initial_mSEXP, SEXP initial_SSEXP, SEXP mu_initialisedSEXP, SEXP cov_initialisedSEXP, SEXP m_initialisedSEXP, SEXP S_initialisedSEXP, SEXP sample_m_scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type K(KSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type B(BSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type batch_vec(batch_vecSEXP);
    Rcpp::traits::input_parameter< double >::type mu_proposal_window(mu_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type cov_proposal_window(cov_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type m_proposal_window(m_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type S_proposal_window(S_proposal_windowSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type R(RSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type thin(thinSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type concentration(concentrationSEXP);
    Rcpp::traits::input_parameter< double >::type m_scale(m_scaleSEXP);
    Rcpp::traits::input_parameter< double >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< double >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_mu(initial_muSEXP);
    Rcpp::traits::input_parameter< arma::cube >::type initial_cov(initial_covSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_m(initial_mSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_S(initial_SSEXP);
    Rcpp::traits::input_parameter< bool >::type mu_initialised(mu_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type cov_initialised(cov_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type m_initialised(m_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type S_initialised(S_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type sample_m_scale(sample_m_scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(sampleMVN(X, K, B, labels, batch_vec, mu_proposal_window, cov_proposal_window, m_proposal_window, S_proposal_window, R, thin, concentration, m_scale, rho, theta, initial_mu, initial_cov, initial_m, initial_S, mu_initialised, cov_initialised, m_initialised, S_initialised, sample_m_scale));
    return rcpp_result_gen;
END_RCPP
}
// sampleMVT
Rcpp::List sampleMVT(arma::mat X, arma::uword K, arma::uword B, arma::uvec labels, arma::uvec batch_vec, double mu_proposal_window, double cov_proposal_window, double m_proposal_window, double S_proposal_window, double t_df_proposal_window, arma::uword R, arma::uword thin, arma::vec concentration, double m_scale, double rho, double theta, arma::mat initial_mu, arma::cube initial_cov, arma::vec initial_df, arma::mat initial_m, arma::mat initial_S, bool mu_initialised, bool cov_initialised, bool df_initialised, bool m_initialised, bool S_initialised, bool sample_m_scale);
RcppExport SEXP _batchmix_sampleMVT(SEXP XSEXP, SEXP KSEXP, SEXP BSEXP, SEXP labelsSEXP, SEXP batch_vecSEXP, SEXP mu_proposal_windowSEXP, SEXP cov_proposal_windowSEXP, SEXP m_proposal_windowSEXP, SEXP S_proposal_windowSEXP, SEXP t_df_proposal_windowSEXP, SEXP RSEXP, SEXP thinSEXP, SEXP concentrationSEXP, SEXP m_scaleSEXP, SEXP rhoSEXP, SEXP thetaSEXP, SEXP initial_muSEXP, SEXP initial_covSEXP, SEXP initial_dfSEXP, SEXP initial_mSEXP, SEXP initial_SSEXP, SEXP mu_initialisedSEXP, SEXP cov_initialisedSEXP, SEXP df_initialisedSEXP, SEXP m_initialisedSEXP, SEXP S_initialisedSEXP, SEXP sample_m_scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type K(KSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type B(BSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type batch_vec(batch_vecSEXP);
    Rcpp::traits::input_parameter< double >::type mu_proposal_window(mu_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type cov_proposal_window(cov_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type m_proposal_window(m_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type S_proposal_window(S_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type t_df_proposal_window(t_df_proposal_windowSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type R(RSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type thin(thinSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type concentration(concentrationSEXP);
    Rcpp::traits::input_parameter< double >::type m_scale(m_scaleSEXP);
    Rcpp::traits::input_parameter< double >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< double >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_mu(initial_muSEXP);
    Rcpp::traits::input_parameter< arma::cube >::type initial_cov(initial_covSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type initial_df(initial_dfSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_m(initial_mSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_S(initial_SSEXP);
    Rcpp::traits::input_parameter< bool >::type mu_initialised(mu_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type cov_initialised(cov_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type df_initialised(df_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type m_initialised(m_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type S_initialised(S_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type sample_m_scale(sample_m_scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(sampleMVT(X, K, B, labels, batch_vec, mu_proposal_window, cov_proposal_window, m_proposal_window, S_proposal_window, t_df_proposal_window, R, thin, concentration, m_scale, rho, theta, initial_mu, initial_cov, initial_df, initial_m, initial_S, mu_initialised, cov_initialised, df_initialised, m_initialised, S_initialised, sample_m_scale));
    return rcpp_result_gen;
END_RCPP
}
// sampleSemisupervisedMVN
Rcpp::List sampleSemisupervisedMVN(arma::mat X, arma::uword K, arma::uword B, arma::uvec labels, arma::uvec batch_vec, arma::uvec fixed, double mu_proposal_window, double cov_proposal_window, double m_proposal_window, double S_proposal_window, arma::uword R, arma::uword thin, arma::vec concentration, double m_scale, double rho, double theta, arma::mat initial_mu, arma::cube initial_cov, arma::mat initial_m, arma::mat initial_S, bool mu_initialised, bool cov_initialised, bool m_initialised, bool S_initialised, bool sample_m_scale);
RcppExport SEXP _batchmix_sampleSemisupervisedMVN(SEXP XSEXP, SEXP KSEXP, SEXP BSEXP, SEXP labelsSEXP, SEXP batch_vecSEXP, SEXP fixedSEXP, SEXP mu_proposal_windowSEXP, SEXP cov_proposal_windowSEXP, SEXP m_proposal_windowSEXP, SEXP S_proposal_windowSEXP, SEXP RSEXP, SEXP thinSEXP, SEXP concentrationSEXP, SEXP m_scaleSEXP, SEXP rhoSEXP, SEXP thetaSEXP, SEXP initial_muSEXP, SEXP initial_covSEXP, SEXP initial_mSEXP, SEXP initial_SSEXP, SEXP mu_initialisedSEXP, SEXP cov_initialisedSEXP, SEXP m_initialisedSEXP, SEXP S_initialisedSEXP, SEXP sample_m_scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type K(KSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type B(BSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type batch_vec(batch_vecSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type fixed(fixedSEXP);
    Rcpp::traits::input_parameter< double >::type mu_proposal_window(mu_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type cov_proposal_window(cov_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type m_proposal_window(m_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type S_proposal_window(S_proposal_windowSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type R(RSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type thin(thinSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type concentration(concentrationSEXP);
    Rcpp::traits::input_parameter< double >::type m_scale(m_scaleSEXP);
    Rcpp::traits::input_parameter< double >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< double >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_mu(initial_muSEXP);
    Rcpp::traits::input_parameter< arma::cube >::type initial_cov(initial_covSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_m(initial_mSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_S(initial_SSEXP);
    Rcpp::traits::input_parameter< bool >::type mu_initialised(mu_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type cov_initialised(cov_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type m_initialised(m_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type S_initialised(S_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type sample_m_scale(sample_m_scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(sampleSemisupervisedMVN(X, K, B, labels, batch_vec, fixed, mu_proposal_window, cov_proposal_window, m_proposal_window, S_proposal_window, R, thin, concentration, m_scale, rho, theta, initial_mu, initial_cov, initial_m, initial_S, mu_initialised, cov_initialised, m_initialised, S_initialised, sample_m_scale));
    return rcpp_result_gen;
END_RCPP
}
// sampleSemisupervisedMVT
Rcpp::List sampleSemisupervisedMVT(arma::mat X, arma::uword K, arma::uword B, arma::uvec labels, arma::uvec batch_vec, arma::uvec fixed, double mu_proposal_window, double cov_proposal_window, double m_proposal_window, double S_proposal_window, double t_df_proposal_window, arma::uword R, arma::uword thin, arma::vec concentration, double m_scale, double rho, double theta, arma::mat initial_mu, arma::cube initial_cov, arma::vec initial_df, arma::mat initial_m, arma::mat initial_S, bool mu_initialised, bool cov_initialised, bool df_initialised, bool m_initialised, bool S_initialised, bool sample_m_scale);
RcppExport SEXP _batchmix_sampleSemisupervisedMVT(SEXP XSEXP, SEXP KSEXP, SEXP BSEXP, SEXP labelsSEXP, SEXP batch_vecSEXP, SEXP fixedSEXP, SEXP mu_proposal_windowSEXP, SEXP cov_proposal_windowSEXP, SEXP m_proposal_windowSEXP, SEXP S_proposal_windowSEXP, SEXP t_df_proposal_windowSEXP, SEXP RSEXP, SEXP thinSEXP, SEXP concentrationSEXP, SEXP m_scaleSEXP, SEXP rhoSEXP, SEXP thetaSEXP, SEXP initial_muSEXP, SEXP initial_covSEXP, SEXP initial_dfSEXP, SEXP initial_mSEXP, SEXP initial_SSEXP, SEXP mu_initialisedSEXP, SEXP cov_initialisedSEXP, SEXP df_initialisedSEXP, SEXP m_initialisedSEXP, SEXP S_initialisedSEXP, SEXP sample_m_scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type K(KSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type B(BSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type batch_vec(batch_vecSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type fixed(fixedSEXP);
    Rcpp::traits::input_parameter< double >::type mu_proposal_window(mu_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type cov_proposal_window(cov_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type m_proposal_window(m_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type S_proposal_window(S_proposal_windowSEXP);
    Rcpp::traits::input_parameter< double >::type t_df_proposal_window(t_df_proposal_windowSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type R(RSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type thin(thinSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type concentration(concentrationSEXP);
    Rcpp::traits::input_parameter< double >::type m_scale(m_scaleSEXP);
    Rcpp::traits::input_parameter< double >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< double >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_mu(initial_muSEXP);
    Rcpp::traits::input_parameter< arma::cube >::type initial_cov(initial_covSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type initial_df(initial_dfSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_m(initial_mSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type initial_S(initial_SSEXP);
    Rcpp::traits::input_parameter< bool >::type mu_initialised(mu_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type cov_initialised(cov_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type df_initialised(df_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type m_initialised(m_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type S_initialised(S_initialisedSEXP);
    Rcpp::traits::input_parameter< bool >::type sample_m_scale(sample_m_scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(sampleSemisupervisedMVT(X, K, B, labels, batch_vec, fixed, mu_proposal_window, cov_proposal_window, m_proposal_window, S_proposal_window, t_df_proposal_window, R, thin, concentration, m_scale, rho, theta, initial_mu, initial_cov, initial_df, initial_m, initial_S, mu_initialised, cov_initialised, df_initialised, m_initialised, S_initialised, sample_m_scale));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_batchmix_createSimilarityMat", (DL_FUNC) &_batchmix_createSimilarityMat, 1},
    {"_batchmix_gammaLogLikelihood", (DL_FUNC) &_batchmix_gammaLogLikelihood, 3},
    {"_batchmix_invGammaLogLikelihood", (DL_FUNC) &_batchmix_invGammaLogLikelihood, 3},
    {"_batchmix_wishartLogLikelihood", (DL_FUNC) &_batchmix_wishartLogLikelihood, 4},
    {"_batchmix_invWishartLogLikelihood", (DL_FUNC) &_batchmix_invWishartLogLikelihood, 4},
    {"_batchmix_sampleMVN", (DL_FUNC) &_batchmix_sampleMVN, 24},
    {"_batchmix_sampleMVT", (DL_FUNC) &_batchmix_sampleMVT, 27},
    {"_batchmix_sampleSemisupervisedMVN", (DL_FUNC) &_batchmix_sampleSemisupervisedMVN, 25},
    {"_batchmix_sampleSemisupervisedMVT", (DL_FUNC) &_batchmix_sampleSemisupervisedMVT, 28},
    {NULL, NULL, 0}
};

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