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

#include "../inst/include/ppforest2.h"
#include <RcppEigen.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

// ppforest2_has_openmp
bool ppforest2_has_openmp();
RcppExport SEXP _ppforest2_ppforest2_has_openmp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(ppforest2_has_openmp());
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_proportion_to_count
int ppforest2_proportion_to_count(double p, int total);
RcppExport SEXP _ppforest2_ppforest2_proportion_to_count(SEXP pSEXP, SEXP totalSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type total(totalSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_proportion_to_count(p, total));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_train
Model::Ptr ppforest2_train(TrainingSpec::Ptr spec, FeatureMatrix x, OutcomeVector y);
RcppExport SEXP _ppforest2_ppforest2_train(SEXP specSEXP, SEXP xSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< TrainingSpec::Ptr >::type spec(specSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix >::type x(xSEXP);
    Rcpp::traits::input_parameter< OutcomeVector >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_train(spec, x, y));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_predict_tree
OutcomeVector ppforest2_predict_tree(Tree::Ptr const& tree, FeatureMatrix const& data);
RcppExport SEXP _ppforest2_ppforest2_predict_tree(SEXP treeSEXP, SEXP dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type data(dataSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_predict_tree(tree, data));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_predict_forest
OutcomeVector ppforest2_predict_forest(Forest::Ptr const& forest, FeatureMatrix const& data);
RcppExport SEXP _ppforest2_ppforest2_predict_forest(SEXP forestSEXP, SEXP dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type data(dataSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_predict_forest(forest, data));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_predict_tree_prob
FeatureMatrix ppforest2_predict_tree_prob(Tree::Ptr const& tree, FeatureMatrix const& data);
RcppExport SEXP _ppforest2_ppforest2_predict_tree_prob(SEXP treeSEXP, SEXP dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type data(dataSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_predict_tree_prob(tree, data));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_predict_forest_prob
FeatureMatrix ppforest2_predict_forest_prob(Forest::Ptr const& forest, FeatureMatrix const& data);
RcppExport SEXP _ppforest2_ppforest2_predict_forest_prob(SEXP forestSEXP, SEXP dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type data(dataSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_predict_forest_prob(forest, data));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_vi_projections_tree
FeatureVector ppforest2_vi_projections_tree(Tree::Ptr const& tree, int n_vars, FeatureVector const& scale);
RcppExport SEXP _ppforest2_ppforest2_vi_projections_tree(SEXP treeSEXP, SEXP n_varsSEXP, SEXP scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< int >::type n_vars(n_varsSEXP);
    Rcpp::traits::input_parameter< FeatureVector const& >::type scale(scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_vi_projections_tree(tree, n_vars, scale));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_vi_projections_forest
FeatureVector ppforest2_vi_projections_forest(Forest::Ptr const& forest, int n_vars, FeatureVector const& scale);
RcppExport SEXP _ppforest2_ppforest2_vi_projections_forest(SEXP forestSEXP, SEXP n_varsSEXP, SEXP scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< int >::type n_vars(n_varsSEXP);
    Rcpp::traits::input_parameter< FeatureVector const& >::type scale(scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_vi_projections_forest(forest, n_vars, scale));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_vi_weighted_forest
FeatureVector ppforest2_vi_weighted_forest(Forest::Ptr const& forest, FeatureMatrix const& x, OutcomeVector y, FeatureVector const& scale);
RcppExport SEXP _ppforest2_ppforest2_vi_weighted_forest(SEXP forestSEXP, SEXP xSEXP, SEXP ySEXP, SEXP scaleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< OutcomeVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< FeatureVector const& >::type scale(scaleSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_vi_weighted_forest(forest, x, y, scale));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_vi_permuted_forest
FeatureVector ppforest2_vi_permuted_forest(Forest::Ptr const& forest, FeatureMatrix const& x, OutcomeVector y, int seed);
RcppExport SEXP _ppforest2_ppforest2_vi_permuted_forest(SEXP forestSEXP, SEXP xSEXP, SEXP ySEXP, SEXP seedSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< OutcomeVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< int >::type seed(seedSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_vi_permuted_forest(forest, x, y, seed));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_oob_error
Rcpp::NumericVector ppforest2_oob_error(Forest::Ptr const& forest, FeatureMatrix const& x, OutcomeVector y);
RcppExport SEXP _ppforest2_ppforest2_oob_error(SEXP forestSEXP, SEXP xSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< OutcomeVector >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_oob_error(forest, x, y));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_oob_predict
OutcomeVector ppforest2_oob_predict(Forest::Ptr const& forest, FeatureMatrix const& x);
RcppExport SEXP _ppforest2_ppforest2_oob_predict(SEXP forestSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Forest::Ptr const& >::type forest(forestSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_oob_predict(forest, x));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_tree_node_data
Rcpp::List ppforest2_tree_node_data(Tree::Ptr const& tree, FeatureMatrix const& x, OutcomeVector y);
RcppExport SEXP _ppforest2_ppforest2_tree_node_data(SEXP treeSEXP, SEXP xSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< OutcomeVector >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_tree_node_data(tree, x, y));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_boundary_segments
Rcpp::DataFrame ppforest2_boundary_segments(Tree::Ptr const& tree, Rcpp::IntegerVector var_indices, Rcpp::NumericVector fixed_values, double x_min, double x_max, double y_min, double y_max);
RcppExport SEXP _ppforest2_ppforest2_boundary_segments(SEXP treeSEXP, SEXP var_indicesSEXP, SEXP fixed_valuesSEXP, SEXP x_minSEXP, SEXP x_maxSEXP, SEXP y_minSEXP, SEXP y_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type var_indices(var_indicesSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type fixed_values(fixed_valuesSEXP);
    Rcpp::traits::input_parameter< double >::type x_min(x_minSEXP);
    Rcpp::traits::input_parameter< double >::type x_max(x_maxSEXP);
    Rcpp::traits::input_parameter< double >::type y_min(y_minSEXP);
    Rcpp::traits::input_parameter< double >::type y_max(y_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_boundary_segments(tree, var_indices, fixed_values, x_min, x_max, y_min, y_max));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_decision_regions
Rcpp::List ppforest2_decision_regions(Tree::Ptr const& tree, Rcpp::IntegerVector var_indices, Rcpp::NumericVector fixed_values, double x_min, double x_max, double y_min, double y_max);
RcppExport SEXP _ppforest2_ppforest2_decision_regions(SEXP treeSEXP, SEXP var_indicesSEXP, SEXP fixed_valuesSEXP, SEXP x_minSEXP, SEXP x_maxSEXP, SEXP y_minSEXP, SEXP y_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type var_indices(var_indicesSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type fixed_values(fixed_valuesSEXP);
    Rcpp::traits::input_parameter< double >::type x_min(x_minSEXP);
    Rcpp::traits::input_parameter< double >::type x_max(x_maxSEXP);
    Rcpp::traits::input_parameter< double >::type y_min(y_minSEXP);
    Rcpp::traits::input_parameter< double >::type y_max(y_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_decision_regions(tree, var_indices, fixed_values, x_min, x_max, y_min, y_max));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_tree_layout
Rcpp::List ppforest2_tree_layout(Tree::Ptr const& tree);
RcppExport SEXP _ppforest2_ppforest2_tree_layout(SEXP treeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Tree::Ptr const& >::type tree(treeSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_tree_layout(tree));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_save_model_json
std::string ppforest2_save_model_json(Model::Ptr model, types::Names groups, bool include_metrics, FeatureMatrix const& x, OutcomeVector y, types::Names feature_names);
RcppExport SEXP _ppforest2_ppforest2_save_model_json(SEXP modelSEXP, SEXP groupsSEXP, SEXP include_metricsSEXP, SEXP xSEXP, SEXP ySEXP, SEXP feature_namesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Model::Ptr >::type model(modelSEXP);
    Rcpp::traits::input_parameter< types::Names >::type groups(groupsSEXP);
    Rcpp::traits::input_parameter< bool >::type include_metrics(include_metricsSEXP);
    Rcpp::traits::input_parameter< FeatureMatrix const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< OutcomeVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< types::Names >::type feature_names(feature_namesSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_save_model_json(model, groups, include_metrics, x, y, feature_names));
    return rcpp_result_gen;
END_RCPP
}
// ppforest2_load_model_json
ppforest2::serialization::Export<Model::Ptr> ppforest2_load_model_json(std::string const& path);
RcppExport SEXP _ppforest2_ppforest2_load_model_json(SEXP pathSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< std::string const& >::type path(pathSEXP);
    rcpp_result_gen = Rcpp::wrap(ppforest2_load_model_json(path));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_ppforest2_ppforest2_has_openmp", (DL_FUNC) &_ppforest2_ppforest2_has_openmp, 0},
    {"_ppforest2_ppforest2_proportion_to_count", (DL_FUNC) &_ppforest2_ppforest2_proportion_to_count, 2},
    {"_ppforest2_ppforest2_train", (DL_FUNC) &_ppforest2_ppforest2_train, 3},
    {"_ppforest2_ppforest2_predict_tree", (DL_FUNC) &_ppforest2_ppforest2_predict_tree, 2},
    {"_ppforest2_ppforest2_predict_forest", (DL_FUNC) &_ppforest2_ppforest2_predict_forest, 2},
    {"_ppforest2_ppforest2_predict_tree_prob", (DL_FUNC) &_ppforest2_ppforest2_predict_tree_prob, 2},
    {"_ppforest2_ppforest2_predict_forest_prob", (DL_FUNC) &_ppforest2_ppforest2_predict_forest_prob, 2},
    {"_ppforest2_ppforest2_vi_projections_tree", (DL_FUNC) &_ppforest2_ppforest2_vi_projections_tree, 3},
    {"_ppforest2_ppforest2_vi_projections_forest", (DL_FUNC) &_ppforest2_ppforest2_vi_projections_forest, 3},
    {"_ppforest2_ppforest2_vi_weighted_forest", (DL_FUNC) &_ppforest2_ppforest2_vi_weighted_forest, 4},
    {"_ppforest2_ppforest2_vi_permuted_forest", (DL_FUNC) &_ppforest2_ppforest2_vi_permuted_forest, 4},
    {"_ppforest2_ppforest2_oob_error", (DL_FUNC) &_ppforest2_ppforest2_oob_error, 3},
    {"_ppforest2_ppforest2_oob_predict", (DL_FUNC) &_ppforest2_ppforest2_oob_predict, 2},
    {"_ppforest2_ppforest2_tree_node_data", (DL_FUNC) &_ppforest2_ppforest2_tree_node_data, 3},
    {"_ppforest2_ppforest2_boundary_segments", (DL_FUNC) &_ppforest2_ppforest2_boundary_segments, 7},
    {"_ppforest2_ppforest2_decision_regions", (DL_FUNC) &_ppforest2_ppforest2_decision_regions, 7},
    {"_ppforest2_ppforest2_tree_layout", (DL_FUNC) &_ppforest2_ppforest2_tree_layout, 1},
    {"_ppforest2_ppforest2_save_model_json", (DL_FUNC) &_ppforest2_ppforest2_save_model_json, 6},
    {"_ppforest2_ppforest2_load_model_json", (DL_FUNC) &_ppforest2_ppforest2_load_model_json, 1},
    {NULL, NULL, 0}
};

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