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

#include "tclust_types.h"
#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

// rlg_c1
Rcpp::List rlg_c1(Rcpp::NumericMatrix x, Rcpp::NumericVector d, double alpha, int niter1);
RcppExport SEXP _tclust_rlg_c1(SEXP xSEXP, SEXP dSEXP, SEXP alphaSEXP, SEXP niter1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type d(dSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< int >::type niter1(niter1SEXP);
    rcpp_result_gen = Rcpp::wrap(rlg_c1(x, d, alpha, niter1));
    return rcpp_result_gen;
END_RCPP
}
// rlg_c2
Rcpp::List rlg_c2(Rcpp::NumericMatrix x, Rcpp::NumericVector d, Rcpp::NumericVector cluster, double alpha, int niter2);
RcppExport SEXP _tclust_rlg_c2(SEXP xSEXP, SEXP dSEXP, SEXP clusterSEXP, SEXP alphaSEXP, SEXP niter2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type d(dSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type cluster(clusterSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< int >::type niter2(niter2SEXP);
    rcpp_result_gen = Rcpp::wrap(rlg_c2(x, d, cluster, alpha, niter2));
    return rcpp_result_gen;
END_RCPP
}
// tclust_c2
iteration tclust_c2(arma::mat x, int k, arma::uvec cluster, double alpha, int restrC, bool deterC, double restr_fact, double cshape, int niter2, Rcpp::String opt, bool equal_weights, double zero_tol);
RcppExport SEXP _tclust_tclust_c2(SEXP xSEXP, SEXP kSEXP, SEXP clusterSEXP, SEXP alphaSEXP, SEXP restrCSEXP, SEXP deterCSEXP, SEXP restr_factSEXP, SEXP cshapeSEXP, SEXP niter2SEXP, SEXP optSEXP, SEXP equal_weightsSEXP, SEXP zero_tolSEXP) {
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< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type cluster(clusterSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< int >::type restrC(restrCSEXP);
    Rcpp::traits::input_parameter< bool >::type deterC(deterCSEXP);
    Rcpp::traits::input_parameter< double >::type restr_fact(restr_factSEXP);
    Rcpp::traits::input_parameter< double >::type cshape(cshapeSEXP);
    Rcpp::traits::input_parameter< int >::type niter2(niter2SEXP);
    Rcpp::traits::input_parameter< Rcpp::String >::type opt(optSEXP);
    Rcpp::traits::input_parameter< bool >::type equal_weights(equal_weightsSEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tclust_c2(x, k, cluster, alpha, restrC, deterC, restr_fact, cshape, niter2, opt, equal_weights, zero_tol));
    return rcpp_result_gen;
END_RCPP
}
// tclust_c1
Rcpp::List tclust_c1(arma::mat x, int k, double alpha, int restrC, bool deterC, double restr_fact, double cshape, int niter1, Rcpp::String opt, bool equal_weights, double zero_tol);
RcppExport SEXP _tclust_tclust_c1(SEXP xSEXP, SEXP kSEXP, SEXP alphaSEXP, SEXP restrCSEXP, SEXP deterCSEXP, SEXP restr_factSEXP, SEXP cshapeSEXP, SEXP niter1SEXP, SEXP optSEXP, SEXP equal_weightsSEXP, SEXP zero_tolSEXP) {
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< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< int >::type restrC(restrCSEXP);
    Rcpp::traits::input_parameter< bool >::type deterC(deterCSEXP);
    Rcpp::traits::input_parameter< double >::type restr_fact(restr_factSEXP);
    Rcpp::traits::input_parameter< double >::type cshape(cshapeSEXP);
    Rcpp::traits::input_parameter< int >::type niter1(niter1SEXP);
    Rcpp::traits::input_parameter< Rcpp::String >::type opt(optSEXP);
    Rcpp::traits::input_parameter< bool >::type equal_weights(equal_weightsSEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tclust_c1(x, k, alpha, restrC, deterC, restr_fact, cshape, niter1, opt, equal_weights, zero_tol));
    return rcpp_result_gen;
END_RCPP
}
// tclust_restr2_eigenv
arma::mat tclust_restr2_eigenv(arma::mat autovalues, arma::vec ni_ini, double factor_e, double zero_tol);
RcppExport SEXP _tclust_tclust_restr2_eigenv(SEXP autovaluesSEXP, SEXP ni_iniSEXP, SEXP factor_eSEXP, SEXP zero_tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type autovalues(autovaluesSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type ni_ini(ni_iniSEXP);
    Rcpp::traits::input_parameter< double >::type factor_e(factor_eSEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tclust_restr2_eigenv(autovalues, ni_ini, factor_e, zero_tol));
    return rcpp_result_gen;
END_RCPP
}
// tclust_restr2_deter_old
arma::mat tclust_restr2_deter_old(arma::mat autovalues, arma::vec ni_ini, double factor_e, double zero_tol);
RcppExport SEXP _tclust_tclust_restr2_deter_old(SEXP autovaluesSEXP, SEXP ni_iniSEXP, SEXP factor_eSEXP, SEXP zero_tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type autovalues(autovaluesSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type ni_ini(ni_iniSEXP);
    Rcpp::traits::input_parameter< double >::type factor_e(factor_eSEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tclust_restr2_deter_old(autovalues, ni_ini, factor_e, zero_tol));
    return rcpp_result_gen;
END_RCPP
}
// tclust_restr2_deter
arma::mat tclust_restr2_deter(arma::mat autovalues, arma::vec ni_ini, double restr_factor, double cshape, double zero_tol);
RcppExport SEXP _tclust_tclust_restr2_deter(SEXP autovaluesSEXP, SEXP ni_iniSEXP, SEXP restr_factorSEXP, SEXP cshapeSEXP, SEXP zero_tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type autovalues(autovaluesSEXP);
    Rcpp::traits::input_parameter< arma::vec >::type ni_ini(ni_iniSEXP);
    Rcpp::traits::input_parameter< double >::type restr_factor(restr_factorSEXP);
    Rcpp::traits::input_parameter< double >::type cshape(cshapeSEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tclust_restr2_deter(autovalues, ni_ini, restr_factor, cshape, zero_tol));
    return rcpp_result_gen;
END_RCPP
}
// tclust_HandleSmallEv
arma::mat tclust_HandleSmallEv(arma::mat autovalues, double zero_tol);
RcppExport SEXP _tclust_tclust_HandleSmallEv(SEXP autovaluesSEXP, SEXP zero_tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type autovalues(autovaluesSEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tclust_HandleSmallEv(autovalues, zero_tol));
    return rcpp_result_gen;
END_RCPP
}
// dmvnrm
arma::vec dmvnrm(arma::mat x, arma::rowvec mean, arma::mat cov);
RcppExport SEXP _tclust_dmvnrm(SEXP xSEXP, SEXP meanSEXP, SEXP covSEXP) {
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::rowvec >::type mean(meanSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type cov(covSEXP);
    rcpp_result_gen = Rcpp::wrap(dmvnrm(x, mean, cov));
    return rcpp_result_gen;
END_RCPP
}
// estepRR
Rcpp::List estepRR(const arma::mat& ll);
RcppExport SEXP _tclust_estepRR(SEXP llSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type ll(llSEXP);
    rcpp_result_gen = Rcpp::wrap(estepRR(ll));
    return rcpp_result_gen;
END_RCPP
}
// tkmeans_c1
Rcpp::List tkmeans_c1(arma::mat x, int k, double alpha, int niter1, double zero_tol, Rcpp::Nullable<Rcpp::NumericMatrix> points);
RcppExport SEXP _tclust_tkmeans_c1(SEXP xSEXP, SEXP kSEXP, SEXP alphaSEXP, SEXP niter1SEXP, SEXP zero_tolSEXP, SEXP pointsSEXP) {
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< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< int >::type niter1(niter1SEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::NumericMatrix> >::type points(pointsSEXP);
    rcpp_result_gen = Rcpp::wrap(tkmeans_c1(x, k, alpha, niter1, zero_tol, points));
    return rcpp_result_gen;
END_RCPP
}
// tkmeans_c2
iteration tkmeans_c2(arma::mat x, int k, arma::uvec cluster, double alpha, int niter2, double zero_tol);
RcppExport SEXP _tclust_tkmeans_c2(SEXP xSEXP, SEXP kSEXP, SEXP clusterSEXP, SEXP alphaSEXP, SEXP niter2SEXP, SEXP zero_tolSEXP) {
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< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< arma::uvec >::type cluster(clusterSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< int >::type niter2(niter2SEXP);
    Rcpp::traits::input_parameter< double >::type zero_tol(zero_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(tkmeans_c2(x, k, cluster, alpha, niter2, zero_tol));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_tclust_rlg_c1", (DL_FUNC) &_tclust_rlg_c1, 4},
    {"_tclust_rlg_c2", (DL_FUNC) &_tclust_rlg_c2, 5},
    {"_tclust_tclust_c2", (DL_FUNC) &_tclust_tclust_c2, 12},
    {"_tclust_tclust_c1", (DL_FUNC) &_tclust_tclust_c1, 11},
    {"_tclust_tclust_restr2_eigenv", (DL_FUNC) &_tclust_tclust_restr2_eigenv, 4},
    {"_tclust_tclust_restr2_deter_old", (DL_FUNC) &_tclust_tclust_restr2_deter_old, 4},
    {"_tclust_tclust_restr2_deter", (DL_FUNC) &_tclust_tclust_restr2_deter, 5},
    {"_tclust_tclust_HandleSmallEv", (DL_FUNC) &_tclust_tclust_HandleSmallEv, 2},
    {"_tclust_dmvnrm", (DL_FUNC) &_tclust_dmvnrm, 3},
    {"_tclust_estepRR", (DL_FUNC) &_tclust_estepRR, 1},
    {"_tclust_tkmeans_c1", (DL_FUNC) &_tclust_tkmeans_c1, 6},
    {"_tclust_tkmeans_c2", (DL_FUNC) &_tclust_tkmeans_c2, 6},
    {NULL, NULL, 0}
};

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