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

// moments_ctmcjumps
List moments_ctmcjumps(arma::vec& edge_lengths, arma::mat& rate_mat, arma::imat& label_mat, int num_edges, int num_states);
RcppExport SEXP phylomoments_moments_ctmcjumps(SEXP edge_lengthsSEXP, SEXP rate_matSEXP, SEXP label_matSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec& >::type edge_lengths(edge_lengthsSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< arma::imat& >::type label_mat(label_matSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    rcpp_result_gen = Rcpp::wrap(moments_ctmcjumps(edge_lengths, rate_mat, label_mat, num_edges, num_states));
    return rcpp_result_gen;
END_RCPP
}
// ctmc_sim
NumericMatrix ctmc_sim(double t, arma::mat& rate_mat, int init_state);
RcppExport SEXP phylomoments_ctmc_sim(SEXP tSEXP, SEXP rate_matSEXP, SEXP init_stateSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type t(tSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< int >::type init_state(init_stateSEXP);
    rcpp_result_gen = Rcpp::wrap(ctmc_sim(t, rate_mat, init_state));
    return rcpp_result_gen;
END_RCPP
}
// int_states_sim
arma::imat int_states_sim(arma::imat& edge_mat, arma::vec& edge_lengths, arma::mat& rate_mat, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, arma::ivec& tip_data, int N);
RcppExport SEXP phylomoments_int_states_sim(SEXP edge_matSEXP, SEXP edge_lengthsSEXP, SEXP rate_matSEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP tip_dataSEXP, SEXP NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type edge_lengths(edge_lengthsSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type tip_data(tip_dataSEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    rcpp_result_gen = Rcpp::wrap(int_states_sim(edge_mat, edge_lengths, rate_mat, root_dist, num_edges, num_states, num_term_nodes, tip_data, N));
    return rcpp_result_gen;
END_RCPP
}
// prior_moments_phylojumps
NumericVector prior_moments_phylojumps(arma::imat& edge_mat, arma::ivec& edge_set, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, List& edge_moments);
RcppExport SEXP phylomoments_prior_moments_phylojumps(SEXP edge_matSEXP, SEXP edge_setSEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP edge_momentsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set(edge_setSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< List& >::type edge_moments(edge_momentsSEXP);
    rcpp_result_gen = Rcpp::wrap(prior_moments_phylojumps(edge_mat, edge_set, root_dist, num_edges, num_states, num_term_nodes, edge_moments));
    return rcpp_result_gen;
END_RCPP
}
// post_moments_phylojumps
NumericVector post_moments_phylojumps(arma::imat& edge_mat, arma::ivec& edge_set, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, List& edge_moments, arma::imat& seq_data);
RcppExport SEXP phylomoments_post_moments_phylojumps(SEXP edge_matSEXP, SEXP edge_setSEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP edge_momentsSEXP, SEXP seq_dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set(edge_setSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< List& >::type edge_moments(edge_momentsSEXP);
    Rcpp::traits::input_parameter< arma::imat& >::type seq_data(seq_dataSEXP);
    rcpp_result_gen = Rcpp::wrap(post_moments_phylojumps(edge_mat, edge_set, root_dist, num_edges, num_states, num_term_nodes, edge_moments, seq_data));
    return rcpp_result_gen;
END_RCPP
}
// find_subtree_edges
arma::ivec find_subtree_edges(int node, arma::imat& edge_mat);
RcppExport SEXP phylomoments_find_subtree_edges(SEXP nodeSEXP, SEXP edge_matSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    rcpp_result_gen = Rcpp::wrap(find_subtree_edges(node, edge_mat));
    return rcpp_result_gen;
END_RCPP
}
// tips_sim
arma::imat tips_sim(arma::imat& edge_mat, arma::vec& edge_lengths, arma::mat& rate_mat, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, int N);
RcppExport SEXP phylomoments_tips_sim(SEXP edge_matSEXP, SEXP edge_lengthsSEXP, SEXP rate_matSEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type edge_lengths(edge_lengthsSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    rcpp_result_gen = Rcpp::wrap(tips_sim(edge_mat, edge_lengths, rate_mat, root_dist, num_edges, num_states, num_term_nodes, N));
    return rcpp_result_gen;
END_RCPP
}
// phylojumps_sim
arma::imat phylojumps_sim(arma::imat& edge_mat, arma::vec& edge_lengths, arma::mat& rate_mat, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, arma::imat& seq_data, int N);
RcppExport SEXP phylomoments_phylojumps_sim(SEXP edge_matSEXP, SEXP edge_lengthsSEXP, SEXP rate_matSEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP seq_dataSEXP, SEXP NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type edge_lengths(edge_lengthsSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< arma::imat& >::type seq_data(seq_dataSEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    rcpp_result_gen = Rcpp::wrap(phylojumps_sim(edge_mat, edge_lengths, rate_mat, root_dist, num_edges, num_states, num_term_nodes, seq_data, N));
    return rcpp_result_gen;
END_RCPP
}
// postmean_moments_phylojumps
NumericVector postmean_moments_phylojumps(arma::imat& edge_mat, arma::vec& edge_lengths, arma::mat& rate_mat, arma::ivec& edge_set, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, List& edge_moments, int N);
RcppExport SEXP phylomoments_postmean_moments_phylojumps(SEXP edge_matSEXP, SEXP edge_lengthsSEXP, SEXP rate_matSEXP, SEXP edge_setSEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP edge_momentsSEXP, SEXP NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type edge_lengths(edge_lengthsSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set(edge_setSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< List& >::type edge_moments(edge_momentsSEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    rcpp_result_gen = Rcpp::wrap(postmean_moments_phylojumps(edge_mat, edge_lengths, rate_mat, edge_set, root_dist, num_edges, num_states, num_term_nodes, edge_moments, N));
    return rcpp_result_gen;
END_RCPP
}
// joint_prior_moments_phylojumps
NumericVector joint_prior_moments_phylojumps(arma::imat& edge_mat, arma::ivec& edge_set1, arma::ivec& edge_set2, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, List& edge_moments);
RcppExport SEXP phylomoments_joint_prior_moments_phylojumps(SEXP edge_matSEXP, SEXP edge_set1SEXP, SEXP edge_set2SEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP edge_momentsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set1(edge_set1SEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set2(edge_set2SEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< List& >::type edge_moments(edge_momentsSEXP);
    rcpp_result_gen = Rcpp::wrap(joint_prior_moments_phylojumps(edge_mat, edge_set1, edge_set2, root_dist, num_edges, num_states, num_term_nodes, edge_moments));
    return rcpp_result_gen;
END_RCPP
}
// joint_post_moments_phylojumps
NumericVector joint_post_moments_phylojumps(arma::imat& edge_mat, arma::ivec& edge_set1, arma::ivec& edge_set2, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, List& edge_moments, arma::imat& seq_data);
RcppExport SEXP phylomoments_joint_post_moments_phylojumps(SEXP edge_matSEXP, SEXP edge_set1SEXP, SEXP edge_set2SEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP edge_momentsSEXP, SEXP seq_dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set1(edge_set1SEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set2(edge_set2SEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< List& >::type edge_moments(edge_momentsSEXP);
    Rcpp::traits::input_parameter< arma::imat& >::type seq_data(seq_dataSEXP);
    rcpp_result_gen = Rcpp::wrap(joint_post_moments_phylojumps(edge_mat, edge_set1, edge_set2, root_dist, num_edges, num_states, num_term_nodes, edge_moments, seq_data));
    return rcpp_result_gen;
END_RCPP
}
// joint_postmean_moments_phylojumps
NumericVector joint_postmean_moments_phylojumps(arma::imat& edge_mat, arma::vec& edge_lengths, arma::mat& rate_mat, arma::ivec& edge_set1, arma::ivec& edge_set2, arma::vec& root_dist, int num_edges, int num_states, int num_term_nodes, List& edge_moments, int N);
RcppExport SEXP phylomoments_joint_postmean_moments_phylojumps(SEXP edge_matSEXP, SEXP edge_lengthsSEXP, SEXP rate_matSEXP, SEXP edge_set1SEXP, SEXP edge_set2SEXP, SEXP root_distSEXP, SEXP num_edgesSEXP, SEXP num_statesSEXP, SEXP num_term_nodesSEXP, SEXP edge_momentsSEXP, SEXP NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::imat& >::type edge_mat(edge_matSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type edge_lengths(edge_lengthsSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type rate_mat(rate_matSEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set1(edge_set1SEXP);
    Rcpp::traits::input_parameter< arma::ivec& >::type edge_set2(edge_set2SEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type root_dist(root_distSEXP);
    Rcpp::traits::input_parameter< int >::type num_edges(num_edgesSEXP);
    Rcpp::traits::input_parameter< int >::type num_states(num_statesSEXP);
    Rcpp::traits::input_parameter< int >::type num_term_nodes(num_term_nodesSEXP);
    Rcpp::traits::input_parameter< List& >::type edge_moments(edge_momentsSEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    rcpp_result_gen = Rcpp::wrap(joint_postmean_moments_phylojumps(edge_mat, edge_lengths, rate_mat, edge_set1, edge_set2, root_dist, num_edges, num_states, num_term_nodes, edge_moments, N));
    return rcpp_result_gen;
END_RCPP
}
