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

// matrix_multiplication_cpp
arma::mat matrix_multiplication_cpp(arma::mat A, arma::mat B);
RcppExport SEXP _CALDER_matrix_multiplication_cpp(SEXP ASEXP, SEXP BSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    Rcpp::traits::input_parameter< arma::mat >::type B(BSEXP);
    rcpp_result_gen = Rcpp::wrap(matrix_multiplication_cpp(A, B));
    return rcpp_result_gen;
END_RCPP
}
// matrix_multiplication_sym_cpp
arma::mat matrix_multiplication_sym_cpp(arma::mat A);
RcppExport SEXP _CALDER_matrix_multiplication_sym_cpp(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(matrix_multiplication_sym_cpp(A));
    return rcpp_result_gen;
END_RCPP
}
// loglik_lnorm_cpp
double loglik_lnorm_cpp(double sum_ln1, double sum_ln2, double p, double q);
RcppExport SEXP _CALDER_loglik_lnorm_cpp(SEXP sum_ln1SEXP, SEXP sum_ln2SEXP, SEXP pSEXP, SEXP qSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type sum_ln1(sum_ln1SEXP);
    Rcpp::traits::input_parameter< double >::type sum_ln2(sum_ln2SEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type q(qSEXP);
    rcpp_result_gen = Rcpp::wrap(loglik_lnorm_cpp(sum_ln1, sum_ln2, p, q));
    return rcpp_result_gen;
END_RCPP
}
// loglik_lnorm_cpp_vec
double loglik_lnorm_cpp_vec(arma::vec vec_values);
RcppExport SEXP _CALDER_loglik_lnorm_cpp_vec(SEXP vec_valuesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type vec_values(vec_valuesSEXP);
    rcpp_result_gen = Rcpp::wrap(loglik_lnorm_cpp_vec(vec_values));
    return rcpp_result_gen;
END_RCPP
}
// get_A_len
arma::mat get_A_len(arma::mat A);
RcppExport SEXP _CALDER_get_A_len(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(get_A_len(A));
    return rcpp_result_gen;
END_RCPP
}
// get_A_ln1
arma::mat get_A_ln1(arma::mat A);
RcppExport SEXP _CALDER_get_A_ln1(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(get_A_ln1(A));
    return rcpp_result_gen;
END_RCPP
}
// get_A_ln2
arma::mat get_A_ln2(arma::mat A);
RcppExport SEXP _CALDER_get_A_ln2(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(get_A_ln2(A));
    return rcpp_result_gen;
END_RCPP
}
// loglik_lnorm_cpp_mat
arma::mat loglik_lnorm_cpp_mat(arma::mat sum_ln1, arma::mat sum_ln2, arma::mat ps, arma::mat qs);
RcppExport SEXP _CALDER_loglik_lnorm_cpp_mat(SEXP sum_ln1SEXP, SEXP sum_ln2SEXP, SEXP psSEXP, SEXP qsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type sum_ln1(sum_ln1SEXP);
    Rcpp::traits::input_parameter< arma::mat >::type sum_ln2(sum_ln2SEXP);
    Rcpp::traits::input_parameter< arma::mat >::type ps(psSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type qs(qsSEXP);
    rcpp_result_gen = Rcpp::wrap(loglik_lnorm_cpp_mat(sum_ln1, sum_ln2, ps, qs));
    return rcpp_result_gen;
END_RCPP
}
// zigzag_loglik_ancestors_v4_5
List zigzag_loglik_ancestors_v4_5(arma::mat A, int k, int min_n_bins);
RcppExport SEXP _CALDER_zigzag_loglik_ancestors_v4_5(SEXP ASEXP, SEXP kSEXP, SEXP min_n_binsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< int >::type min_n_bins(min_n_binsSEXP);
    rcpp_result_gen = Rcpp::wrap(zigzag_loglik_ancestors_v4_5(A, k, min_n_bins));
    return rcpp_result_gen;
END_RCPP
}
// compute_L
List compute_L(arma::mat A, arma::mat L, int k);
RcppExport SEXP _CALDER_compute_L(SEXP ASEXP, SEXP LSEXP, SEXP kSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type A(ASEXP);
    Rcpp::traits::input_parameter< arma::mat >::type L(LSEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    rcpp_result_gen = Rcpp::wrap(compute_L(A, L, k));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_CALDER_matrix_multiplication_cpp", (DL_FUNC) &_CALDER_matrix_multiplication_cpp, 2},
    {"_CALDER_matrix_multiplication_sym_cpp", (DL_FUNC) &_CALDER_matrix_multiplication_sym_cpp, 1},
    {"_CALDER_loglik_lnorm_cpp", (DL_FUNC) &_CALDER_loglik_lnorm_cpp, 4},
    {"_CALDER_loglik_lnorm_cpp_vec", (DL_FUNC) &_CALDER_loglik_lnorm_cpp_vec, 1},
    {"_CALDER_get_A_len", (DL_FUNC) &_CALDER_get_A_len, 1},
    {"_CALDER_get_A_ln1", (DL_FUNC) &_CALDER_get_A_ln1, 1},
    {"_CALDER_get_A_ln2", (DL_FUNC) &_CALDER_get_A_ln2, 1},
    {"_CALDER_loglik_lnorm_cpp_mat", (DL_FUNC) &_CALDER_loglik_lnorm_cpp_mat, 4},
    {"_CALDER_zigzag_loglik_ancestors_v4_5", (DL_FUNC) &_CALDER_zigzag_loglik_ancestors_v4_5, 3},
    {"_CALDER_compute_L", (DL_FUNC) &_CALDER_compute_L, 3},
    {NULL, NULL, 0}
};

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