// Generated by cpp11: do not edit by hand
// clang-format off

#include "stochtree_types.h"
#include "cpp11/declarations.hpp"
#include <R_ext/Visibility.h>

// R_data.cpp
cpp11::external_pointer<StochTree::ForestDataset> create_forest_dataset_cpp();
extern "C" SEXP _stochtree_create_forest_dataset_cpp() {
  BEGIN_CPP11
    return cpp11::as_sexp(create_forest_dataset_cpp());
  END_CPP11
}
// R_data.cpp
int dataset_num_rows_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_dataset_num_rows_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(dataset_num_rows_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
int dataset_num_covariates_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_dataset_num_covariates_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(dataset_num_covariates_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
int dataset_num_basis_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_dataset_num_basis_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(dataset_num_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
bool dataset_has_basis_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_dataset_has_basis_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(dataset_has_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
bool dataset_has_variance_weights_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_dataset_has_variance_weights_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(dataset_has_variance_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
void forest_dataset_add_covariates_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, cpp11::doubles_matrix<> covariates);
extern "C" SEXP _stochtree_forest_dataset_add_covariates_cpp(SEXP dataset_ptr, SEXP covariates) {
  BEGIN_CPP11
    forest_dataset_add_covariates_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(covariates));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void forest_dataset_add_basis_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, cpp11::doubles_matrix<> basis);
extern "C" SEXP _stochtree_forest_dataset_add_basis_cpp(SEXP dataset_ptr, SEXP basis) {
  BEGIN_CPP11
    forest_dataset_add_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(basis));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void forest_dataset_update_basis_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, cpp11::doubles_matrix<> basis);
extern "C" SEXP _stochtree_forest_dataset_update_basis_cpp(SEXP dataset_ptr, SEXP basis) {
  BEGIN_CPP11
    forest_dataset_update_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(basis));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void forest_dataset_update_var_weights_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, cpp11::doubles weights, bool exponentiate);
extern "C" SEXP _stochtree_forest_dataset_update_var_weights_cpp(SEXP dataset_ptr, SEXP weights, SEXP exponentiate) {
  BEGIN_CPP11
    forest_dataset_update_var_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(weights), cpp11::as_cpp<cpp11::decay_t<bool>>(exponentiate));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void forest_dataset_add_weights_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, cpp11::doubles weights);
extern "C" SEXP _stochtree_forest_dataset_add_weights_cpp(SEXP dataset_ptr, SEXP weights) {
  BEGIN_CPP11
    forest_dataset_add_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(weights));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles_matrix<> forest_dataset_get_covariates_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr);
extern "C" SEXP _stochtree_forest_dataset_get_covariates_cpp(SEXP dataset_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_dataset_get_covariates_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr)));
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles_matrix<> forest_dataset_get_basis_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr);
extern "C" SEXP _stochtree_forest_dataset_get_basis_cpp(SEXP dataset_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_dataset_get_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr)));
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles forest_dataset_get_variance_weights_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr);
extern "C" SEXP _stochtree_forest_dataset_get_variance_weights_cpp(SEXP dataset_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_dataset_get_variance_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr)));
  END_CPP11
}
// R_data.cpp
bool forest_dataset_has_auxiliary_dimension_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, int dim_idx);
extern "C" SEXP _stochtree_forest_dataset_has_auxiliary_dimension_cpp(SEXP dataset_ptr, SEXP dim_idx) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_dataset_has_auxiliary_dimension_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(dim_idx)));
  END_CPP11
}
// R_data.cpp
void forest_dataset_add_auxiliary_dimension_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, int dim_size);
extern "C" SEXP _stochtree_forest_dataset_add_auxiliary_dimension_cpp(SEXP dataset_ptr, SEXP dim_size) {
  BEGIN_CPP11
    forest_dataset_add_auxiliary_dimension_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(dim_size));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
double forest_dataset_get_auxiliary_data_value_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, int dim_idx, int element_idx);
extern "C" SEXP _stochtree_forest_dataset_get_auxiliary_data_value_cpp(SEXP dataset_ptr, SEXP dim_idx, SEXP element_idx) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_dataset_get_auxiliary_data_value_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(dim_idx), cpp11::as_cpp<cpp11::decay_t<int>>(element_idx)));
  END_CPP11
}
// R_data.cpp
void forest_dataset_set_auxiliary_data_value_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, int dim_idx, int element_idx, double value);
extern "C" SEXP _stochtree_forest_dataset_set_auxiliary_data_value_cpp(SEXP dataset_ptr, SEXP dim_idx, SEXP element_idx, SEXP value) {
  BEGIN_CPP11
    forest_dataset_set_auxiliary_data_value_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(dim_idx), cpp11::as_cpp<cpp11::decay_t<int>>(element_idx), cpp11::as_cpp<cpp11::decay_t<double>>(value));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles forest_dataset_get_auxiliary_data_vector_cpp(cpp11::external_pointer<StochTree::ForestDataset> dataset_ptr, int dim_idx);
extern "C" SEXP _stochtree_forest_dataset_get_auxiliary_data_vector_cpp(SEXP dataset_ptr, SEXP dim_idx) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_dataset_get_auxiliary_data_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(dim_idx)));
  END_CPP11
}
// R_data.cpp
cpp11::external_pointer<StochTree::ColumnVector> create_column_vector_cpp(cpp11::doubles outcome);
extern "C" SEXP _stochtree_create_column_vector_cpp(SEXP outcome) {
  BEGIN_CPP11
    return cpp11::as_sexp(create_column_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(outcome)));
  END_CPP11
}
// R_data.cpp
void add_to_column_vector_cpp(cpp11::external_pointer<StochTree::ColumnVector> outcome, cpp11::doubles update_vector);
extern "C" SEXP _stochtree_add_to_column_vector_cpp(SEXP outcome, SEXP update_vector) {
  BEGIN_CPP11
    add_to_column_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(outcome), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(update_vector));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void subtract_from_column_vector_cpp(cpp11::external_pointer<StochTree::ColumnVector> outcome, cpp11::doubles update_vector);
extern "C" SEXP _stochtree_subtract_from_column_vector_cpp(SEXP outcome, SEXP update_vector) {
  BEGIN_CPP11
    subtract_from_column_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(outcome), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(update_vector));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void overwrite_column_vector_cpp(cpp11::external_pointer<StochTree::ColumnVector> outcome, cpp11::doubles new_vector);
extern "C" SEXP _stochtree_overwrite_column_vector_cpp(SEXP outcome, SEXP new_vector) {
  BEGIN_CPP11
    overwrite_column_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(outcome), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(new_vector));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void propagate_trees_column_vector_cpp(cpp11::external_pointer<StochTree::ForestTracker> tracker, cpp11::external_pointer<StochTree::ColumnVector> residual);
extern "C" SEXP _stochtree_propagate_trees_column_vector_cpp(SEXP tracker, SEXP residual) {
  BEGIN_CPP11
    propagate_trees_column_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles get_residual_cpp(cpp11::external_pointer<StochTree::ColumnVector> vector_ptr);
extern "C" SEXP _stochtree_get_residual_cpp(SEXP vector_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_residual_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(vector_ptr)));
  END_CPP11
}
// R_data.cpp
cpp11::external_pointer<StochTree::RandomEffectsDataset> create_rfx_dataset_cpp();
extern "C" SEXP _stochtree_create_rfx_dataset_cpp() {
  BEGIN_CPP11
    return cpp11::as_sexp(create_rfx_dataset_cpp());
  END_CPP11
}
// R_data.cpp
void rfx_dataset_update_basis_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr, cpp11::doubles_matrix<> basis);
extern "C" SEXP _stochtree_rfx_dataset_update_basis_cpp(SEXP dataset_ptr, SEXP basis) {
  BEGIN_CPP11
    rfx_dataset_update_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(basis));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void rfx_dataset_update_var_weights_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr, cpp11::doubles weights, bool exponentiate);
extern "C" SEXP _stochtree_rfx_dataset_update_var_weights_cpp(SEXP dataset_ptr, SEXP weights, SEXP exponentiate) {
  BEGIN_CPP11
    rfx_dataset_update_var_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(weights), cpp11::as_cpp<cpp11::decay_t<bool>>(exponentiate));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void rfx_dataset_update_group_labels_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr, cpp11::integers group_labels);
extern "C" SEXP _stochtree_rfx_dataset_update_group_labels_cpp(SEXP dataset_ptr, SEXP group_labels) {
  BEGIN_CPP11
    rfx_dataset_update_group_labels_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(group_labels));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
int rfx_dataset_num_basis_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset);
extern "C" SEXP _stochtree_rfx_dataset_num_basis_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_num_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
int rfx_dataset_num_rows_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset);
extern "C" SEXP _stochtree_rfx_dataset_num_rows_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_num_rows_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
bool rfx_dataset_has_group_labels_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset);
extern "C" SEXP _stochtree_rfx_dataset_has_group_labels_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_has_group_labels_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
bool rfx_dataset_has_basis_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset);
extern "C" SEXP _stochtree_rfx_dataset_has_basis_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_has_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
bool rfx_dataset_has_variance_weights_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset);
extern "C" SEXP _stochtree_rfx_dataset_has_variance_weights_cpp(SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_has_variance_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset)));
  END_CPP11
}
// R_data.cpp
void rfx_dataset_add_group_labels_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr, cpp11::integers group_labels);
extern "C" SEXP _stochtree_rfx_dataset_add_group_labels_cpp(SEXP dataset_ptr, SEXP group_labels) {
  BEGIN_CPP11
    rfx_dataset_add_group_labels_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(group_labels));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void rfx_dataset_add_basis_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr, cpp11::doubles_matrix<> basis);
extern "C" SEXP _stochtree_rfx_dataset_add_basis_cpp(SEXP dataset_ptr, SEXP basis) {
  BEGIN_CPP11
    rfx_dataset_add_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(basis));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
void rfx_dataset_add_weights_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr, cpp11::doubles weights);
extern "C" SEXP _stochtree_rfx_dataset_add_weights_cpp(SEXP dataset_ptr, SEXP weights) {
  BEGIN_CPP11
    rfx_dataset_add_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(weights));
    return R_NilValue;
  END_CPP11
}
// R_data.cpp
cpp11::writable::integers rfx_dataset_get_group_labels_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr);
extern "C" SEXP _stochtree_rfx_dataset_get_group_labels_cpp(SEXP dataset_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_get_group_labels_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr)));
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles_matrix<> rfx_dataset_get_basis_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr);
extern "C" SEXP _stochtree_rfx_dataset_get_basis_cpp(SEXP dataset_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_get_basis_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr)));
  END_CPP11
}
// R_data.cpp
cpp11::writable::doubles rfx_dataset_get_variance_weights_cpp(cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset_ptr);
extern "C" SEXP _stochtree_rfx_dataset_get_variance_weights_cpp(SEXP dataset_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_dataset_get_variance_weights_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset_ptr)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_cpp(int num_components, int num_groups);
extern "C" SEXP _stochtree_rfx_container_cpp(SEXP num_components, SEXP num_groups) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_cpp(cpp11::as_cpp<cpp11::decay_t<int>>(num_components), cpp11::as_cpp<cpp11::decay_t<int>>(num_groups)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_from_json_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_container_from_json_cpp(SEXP json_ptr, SEXP rfx_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_from_json_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::LabelMapper> rfx_label_mapper_from_json_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_label_mapper_from_json_cpp(SEXP json_ptr, SEXP rfx_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_label_mapper_from_json_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::integers rfx_group_ids_from_json_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_group_ids_from_json_cpp(SEXP json_ptr, SEXP rfx_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_group_ids_from_json_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label)));
  END_CPP11
}
// R_random_effects.cpp
void rfx_container_append_from_json_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_ptr, cpp11::external_pointer<nlohmann::json> json_ptr, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_container_append_from_json_cpp(SEXP rfx_container_ptr, SEXP json_ptr, SEXP rfx_label) {
  BEGIN_CPP11
    rfx_container_append_from_json_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_from_json_string_cpp(std::string json_string, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_container_from_json_string_cpp(SEXP json_string, SEXP rfx_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_from_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::LabelMapper> rfx_label_mapper_from_json_string_cpp(std::string json_string, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_label_mapper_from_json_string_cpp(SEXP json_string, SEXP rfx_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_label_mapper_from_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::integers rfx_group_ids_from_json_string_cpp(std::string json_string, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_group_ids_from_json_string_cpp(SEXP json_string, SEXP rfx_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_group_ids_from_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label)));
  END_CPP11
}
// R_random_effects.cpp
void rfx_container_append_from_json_string_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_ptr, std::string json_string, std::string rfx_label);
extern "C" SEXP _stochtree_rfx_container_append_from_json_string_cpp(SEXP rfx_container_ptr, SEXP json_string, SEXP rfx_label) {
  BEGIN_CPP11
    rfx_container_append_from_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string), cpp11::as_cpp<cpp11::decay_t<std::string>>(rfx_label));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model_cpp(int num_components, int num_groups);
extern "C" SEXP _stochtree_rfx_model_cpp(SEXP num_components, SEXP num_groups) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_model_cpp(cpp11::as_cpp<cpp11::decay_t<int>>(num_components), cpp11::as_cpp<cpp11::decay_t<int>>(num_groups)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::RandomEffectsTracker> rfx_tracker_cpp(cpp11::integers group_labels);
extern "C" SEXP _stochtree_rfx_tracker_cpp(SEXP group_labels) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_tracker_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(group_labels)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::external_pointer<StochTree::LabelMapper> rfx_label_mapper_cpp(cpp11::external_pointer<StochTree::RandomEffectsTracker> rfx_tracker);
extern "C" SEXP _stochtree_rfx_label_mapper_cpp(SEXP rfx_tracker) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_label_mapper_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsTracker>>>(rfx_tracker)));
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_sample_random_effects_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::external_pointer<StochTree::RandomEffectsDataset> rfx_dataset, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::RandomEffectsTracker> rfx_tracker, cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container, bool keep_sample, double global_variance, cpp11::external_pointer<std::mt19937> rng);
extern "C" SEXP _stochtree_rfx_model_sample_random_effects_cpp(SEXP rfx_model, SEXP rfx_dataset, SEXP residual, SEXP rfx_tracker, SEXP rfx_container, SEXP keep_sample, SEXP global_variance, SEXP rng) {
  BEGIN_CPP11
    rfx_model_sample_random_effects_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(rfx_dataset), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsTracker>>>(rfx_tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container), cpp11::as_cpp<cpp11::decay_t<bool>>(keep_sample), cpp11::as_cpp<cpp11::decay_t<double>>(global_variance), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::doubles rfx_model_predict_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::external_pointer<StochTree::RandomEffectsDataset> rfx_dataset, cpp11::external_pointer<StochTree::RandomEffectsTracker> rfx_tracker);
extern "C" SEXP _stochtree_rfx_model_predict_cpp(SEXP rfx_model, SEXP rfx_dataset, SEXP rfx_tracker) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_model_predict_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(rfx_dataset), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsTracker>>>(rfx_tracker)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::doubles rfx_container_predict_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container, cpp11::external_pointer<StochTree::RandomEffectsDataset> rfx_dataset, cpp11::external_pointer<StochTree::LabelMapper> label_mapper);
extern "C" SEXP _stochtree_rfx_container_predict_cpp(SEXP rfx_container, SEXP rfx_dataset, SEXP label_mapper) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_predict_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(rfx_dataset), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::LabelMapper>>>(label_mapper)));
  END_CPP11
}
// R_random_effects.cpp
int rfx_container_num_samples_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container);
extern "C" SEXP _stochtree_rfx_container_num_samples_cpp(SEXP rfx_container) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_num_samples_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container)));
  END_CPP11
}
// R_random_effects.cpp
int rfx_container_num_components_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container);
extern "C" SEXP _stochtree_rfx_container_num_components_cpp(SEXP rfx_container) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_num_components_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container)));
  END_CPP11
}
// R_random_effects.cpp
int rfx_container_num_groups_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container);
extern "C" SEXP _stochtree_rfx_container_num_groups_cpp(SEXP rfx_container) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_num_groups_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container)));
  END_CPP11
}
// R_random_effects.cpp
void rfx_container_delete_sample_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container, int sample_num);
extern "C" SEXP _stochtree_rfx_container_delete_sample_cpp(SEXP rfx_container, SEXP sample_num) {
  BEGIN_CPP11
    rfx_container_delete_sample_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container), cpp11::as_cpp<cpp11::decay_t<int>>(sample_num));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_set_working_parameter_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::doubles working_param_init);
extern "C" SEXP _stochtree_rfx_model_set_working_parameter_cpp(SEXP rfx_model, SEXP working_param_init) {
  BEGIN_CPP11
    rfx_model_set_working_parameter_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(working_param_init));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_set_group_parameters_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::doubles_matrix<> group_params_init);
extern "C" SEXP _stochtree_rfx_model_set_group_parameters_cpp(SEXP rfx_model, SEXP group_params_init) {
  BEGIN_CPP11
    rfx_model_set_group_parameters_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(group_params_init));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_set_working_parameter_covariance_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::doubles_matrix<> working_param_cov_init);
extern "C" SEXP _stochtree_rfx_model_set_working_parameter_covariance_cpp(SEXP rfx_model, SEXP working_param_cov_init) {
  BEGIN_CPP11
    rfx_model_set_working_parameter_covariance_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(working_param_cov_init));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_set_group_parameter_covariance_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::doubles_matrix<> group_param_cov_init);
extern "C" SEXP _stochtree_rfx_model_set_group_parameter_covariance_cpp(SEXP rfx_model, SEXP group_param_cov_init) {
  BEGIN_CPP11
    rfx_model_set_group_parameter_covariance_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(group_param_cov_init));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_set_variance_prior_shape_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, double shape);
extern "C" SEXP _stochtree_rfx_model_set_variance_prior_shape_cpp(SEXP rfx_model, SEXP shape) {
  BEGIN_CPP11
    rfx_model_set_variance_prior_shape_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<double>>(shape));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void rfx_model_set_variance_prior_scale_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, double scale);
extern "C" SEXP _stochtree_rfx_model_set_variance_prior_scale_cpp(SEXP rfx_model, SEXP scale) {
  BEGIN_CPP11
    rfx_model_set_variance_prior_scale_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<double>>(scale));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::integers rfx_tracker_get_unique_group_ids_cpp(cpp11::external_pointer<StochTree::RandomEffectsTracker> rfx_tracker);
extern "C" SEXP _stochtree_rfx_tracker_get_unique_group_ids_cpp(SEXP rfx_tracker) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_tracker_get_unique_group_ids_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsTracker>>>(rfx_tracker)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::doubles rfx_container_get_beta_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_ptr);
extern "C" SEXP _stochtree_rfx_container_get_beta_cpp(SEXP rfx_container_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_get_beta_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container_ptr)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::doubles rfx_container_get_alpha_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_ptr);
extern "C" SEXP _stochtree_rfx_container_get_alpha_cpp(SEXP rfx_container_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_get_alpha_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container_ptr)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::doubles rfx_container_get_xi_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_ptr);
extern "C" SEXP _stochtree_rfx_container_get_xi_cpp(SEXP rfx_container_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_get_xi_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container_ptr)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::writable::doubles rfx_container_get_sigma_cpp(cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container_ptr);
extern "C" SEXP _stochtree_rfx_container_get_sigma_cpp(SEXP rfx_container_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_container_get_sigma_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container_ptr)));
  END_CPP11
}
// R_random_effects.cpp
cpp11::list rfx_label_mapper_to_list_cpp(cpp11::external_pointer<StochTree::LabelMapper> label_mapper_ptr);
extern "C" SEXP _stochtree_rfx_label_mapper_to_list_cpp(SEXP label_mapper_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(rfx_label_mapper_to_list_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::LabelMapper>>>(label_mapper_ptr)));
  END_CPP11
}
// R_random_effects.cpp
void reset_rfx_model_cpp(cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model, cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_container, int sample_num);
extern "C" SEXP _stochtree_reset_rfx_model_cpp(SEXP rfx_model, SEXP rfx_container, SEXP sample_num) {
  BEGIN_CPP11
    reset_rfx_model_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_container), cpp11::as_cpp<cpp11::decay_t<int>>(sample_num));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void reset_rfx_tracker_cpp(cpp11::external_pointer<StochTree::RandomEffectsTracker> tracker, cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model);
extern "C" SEXP _stochtree_reset_rfx_tracker_cpp(SEXP tracker, SEXP dataset, SEXP residual, SEXP rfx_model) {
  BEGIN_CPP11
    reset_rfx_tracker_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model));
    return R_NilValue;
  END_CPP11
}
// R_random_effects.cpp
void root_reset_rfx_tracker_cpp(cpp11::external_pointer<StochTree::RandomEffectsTracker> tracker, cpp11::external_pointer<StochTree::RandomEffectsDataset> dataset, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel> rfx_model);
extern "C" SEXP _stochtree_root_reset_rfx_tracker_cpp(SEXP tracker, SEXP dataset, SEXP residual, SEXP rfx_model) {
  BEGIN_CPP11
    root_reset_rfx_tracker_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsDataset>>>(dataset), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::MultivariateRegressionRandomEffectsModel>>>(rfx_model));
    return R_NilValue;
  END_CPP11
}
// R_utils.cpp
double sum_cpp(cpp11::doubles x);
extern "C" SEXP _stochtree_sum_cpp(SEXP x) {
  BEGIN_CPP11
    return cpp11::as_sexp(sum_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(x)));
  END_CPP11
}
// R_utils.cpp
double mean_cpp(cpp11::doubles x);
extern "C" SEXP _stochtree_mean_cpp(SEXP x) {
  BEGIN_CPP11
    return cpp11::as_sexp(mean_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(x)));
  END_CPP11
}
// R_utils.cpp
double var_cpp(cpp11::doubles x);
extern "C" SEXP _stochtree_var_cpp(SEXP x) {
  BEGIN_CPP11
    return cpp11::as_sexp(var_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(x)));
  END_CPP11
}
// R_utils.cpp
double sd_cpp(cpp11::doubles x);
extern "C" SEXP _stochtree_sd_cpp(SEXP x) {
  BEGIN_CPP11
    return cpp11::as_sexp(sd_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(x)));
  END_CPP11
}
// forest.cpp
cpp11::external_pointer<StochTree::TreeEnsemble> active_forest_cpp(int num_trees, int output_dimension, bool is_leaf_constant, bool is_exponentiated);
extern "C" SEXP _stochtree_active_forest_cpp(SEXP num_trees, SEXP output_dimension, SEXP is_leaf_constant, SEXP is_exponentiated) {
  BEGIN_CPP11
    return cpp11::as_sexp(active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<int>>(num_trees), cpp11::as_cpp<cpp11::decay_t<int>>(output_dimension), cpp11::as_cpp<cpp11::decay_t<bool>>(is_leaf_constant), cpp11::as_cpp<cpp11::decay_t<bool>>(is_exponentiated)));
  END_CPP11
}
// forest.cpp
cpp11::external_pointer<StochTree::ForestContainer> forest_container_cpp(int num_trees, int output_dimension, bool is_leaf_constant, bool is_exponentiated);
extern "C" SEXP _stochtree_forest_container_cpp(SEXP num_trees, SEXP output_dimension, SEXP is_leaf_constant, SEXP is_exponentiated) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<int>>(num_trees), cpp11::as_cpp<cpp11::decay_t<int>>(output_dimension), cpp11::as_cpp<cpp11::decay_t<bool>>(is_leaf_constant), cpp11::as_cpp<cpp11::decay_t<bool>>(is_exponentiated)));
  END_CPP11
}
// forest.cpp
cpp11::external_pointer<StochTree::ForestContainer> forest_container_from_json_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string forest_label);
extern "C" SEXP _stochtree_forest_container_from_json_cpp(SEXP json_ptr, SEXP forest_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_container_from_json_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(forest_label)));
  END_CPP11
}
// forest.cpp
void forest_container_append_from_json_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_sample_ptr, cpp11::external_pointer<nlohmann::json> json_ptr, std::string forest_label);
extern "C" SEXP _stochtree_forest_container_append_from_json_cpp(SEXP forest_sample_ptr, SEXP json_ptr, SEXP forest_label) {
  BEGIN_CPP11
    forest_container_append_from_json_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_sample_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(forest_label));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
cpp11::external_pointer<StochTree::ForestContainer> forest_container_from_json_string_cpp(std::string json_string, std::string forest_label);
extern "C" SEXP _stochtree_forest_container_from_json_string_cpp(SEXP json_string, SEXP forest_label) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_container_from_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string), cpp11::as_cpp<cpp11::decay_t<std::string>>(forest_label)));
  END_CPP11
}
// forest.cpp
void forest_merge_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> inbound_forest_ptr, cpp11::external_pointer<StochTree::TreeEnsemble> outbound_forest_ptr);
extern "C" SEXP _stochtree_forest_merge_cpp(SEXP inbound_forest_ptr, SEXP outbound_forest_ptr) {
  BEGIN_CPP11
    forest_merge_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(inbound_forest_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(outbound_forest_ptr));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void forest_add_constant_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> forest_ptr, double constant_value);
extern "C" SEXP _stochtree_forest_add_constant_cpp(SEXP forest_ptr, SEXP constant_value) {
  BEGIN_CPP11
    forest_add_constant_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(forest_ptr), cpp11::as_cpp<cpp11::decay_t<double>>(constant_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void forest_multiply_constant_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> forest_ptr, double constant_multiple);
extern "C" SEXP _stochtree_forest_multiply_constant_cpp(SEXP forest_ptr, SEXP constant_multiple) {
  BEGIN_CPP11
    forest_multiply_constant_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(forest_ptr), cpp11::as_cpp<cpp11::decay_t<double>>(constant_multiple));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void forest_container_append_from_json_string_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_sample_ptr, std::string json_string, std::string forest_label);
extern "C" SEXP _stochtree_forest_container_append_from_json_string_cpp(SEXP forest_sample_ptr, SEXP json_string, SEXP forest_label) {
  BEGIN_CPP11
    forest_container_append_from_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_sample_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string), cpp11::as_cpp<cpp11::decay_t<std::string>>(forest_label));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void combine_forests_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::integers forest_inds);
extern "C" SEXP _stochtree_combine_forests_forest_container_cpp(SEXP forest_samples, SEXP forest_inds) {
  BEGIN_CPP11
    combine_forests_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(forest_inds));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_to_forest_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_index, double constant_value);
extern "C" SEXP _stochtree_add_to_forest_forest_container_cpp(SEXP forest_samples, SEXP forest_index, SEXP constant_value) {
  BEGIN_CPP11
    add_to_forest_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_index), cpp11::as_cpp<cpp11::decay_t<double>>(constant_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void multiply_forest_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_index, double constant_multiple);
extern "C" SEXP _stochtree_multiply_forest_forest_container_cpp(SEXP forest_samples, SEXP forest_index, SEXP constant_multiple) {
  BEGIN_CPP11
    multiply_forest_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_index), cpp11::as_cpp<cpp11::decay_t<double>>(constant_multiple));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
int num_samples_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_num_samples_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_samples_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// forest.cpp
int ensemble_tree_max_depth_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int ensemble_num, int tree_num);
extern "C" SEXP _stochtree_ensemble_tree_max_depth_forest_container_cpp(SEXP forest_samples, SEXP ensemble_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(ensemble_tree_max_depth_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(ensemble_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
double ensemble_average_max_depth_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int ensemble_num);
extern "C" SEXP _stochtree_ensemble_average_max_depth_forest_container_cpp(SEXP forest_samples, SEXP ensemble_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(ensemble_average_max_depth_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(ensemble_num)));
  END_CPP11
}
// forest.cpp
double average_max_depth_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_average_max_depth_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(average_max_depth_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// forest.cpp
int num_leaves_ensemble_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num);
extern "C" SEXP _stochtree_num_leaves_ensemble_forest_container_cpp(SEXP forest_samples, SEXP forest_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_leaves_ensemble_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num)));
  END_CPP11
}
// forest.cpp
double sum_leaves_squared_ensemble_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num);
extern "C" SEXP _stochtree_sum_leaves_squared_ensemble_forest_container_cpp(SEXP forest_samples, SEXP forest_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(sum_leaves_squared_ensemble_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num)));
  END_CPP11
}
// forest.cpp
int num_trees_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_num_trees_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_trees_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// forest.cpp
void json_save_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, std::string json_filename);
extern "C" SEXP _stochtree_json_save_forest_container_cpp(SEXP forest_samples, SEXP json_filename) {
  BEGIN_CPP11
    json_save_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<std::string>>(json_filename));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void json_load_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, std::string json_filename);
extern "C" SEXP _stochtree_json_load_forest_container_cpp(SEXP forest_samples, SEXP json_filename) {
  BEGIN_CPP11
    json_load_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<std::string>>(json_filename));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
int leaf_dimension_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_leaf_dimension_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(leaf_dimension_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// forest.cpp
int is_leaf_constant_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_is_leaf_constant_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_leaf_constant_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// forest.cpp
int is_exponentiated_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_is_exponentiated_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_exponentiated_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// forest.cpp
bool all_roots_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num);
extern "C" SEXP _stochtree_all_roots_forest_container_cpp(SEXP forest_samples, SEXP forest_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(all_roots_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num)));
  END_CPP11
}
// forest.cpp
void add_sample_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_add_sample_forest_container_cpp(SEXP forest_samples) {
  BEGIN_CPP11
    add_sample_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void set_leaf_value_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, double leaf_value);
extern "C" SEXP _stochtree_set_leaf_value_forest_container_cpp(SEXP forest_samples, SEXP leaf_value) {
  BEGIN_CPP11
    set_leaf_value_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<double>>(leaf_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_sample_value_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, double leaf_value);
extern "C" SEXP _stochtree_add_sample_value_forest_container_cpp(SEXP forest_samples, SEXP leaf_value) {
  BEGIN_CPP11
    add_sample_value_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<double>>(leaf_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_sample_vector_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::doubles leaf_vector);
extern "C" SEXP _stochtree_add_sample_vector_forest_container_cpp(SEXP forest_samples, SEXP leaf_vector) {
  BEGIN_CPP11
    add_sample_vector_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(leaf_vector));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_numeric_split_tree_value_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int leaf_num, int feature_num, double split_threshold, double left_leaf_value, double right_leaf_value);
extern "C" SEXP _stochtree_add_numeric_split_tree_value_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP leaf_num, SEXP feature_num, SEXP split_threshold, SEXP left_leaf_value, SEXP right_leaf_value) {
  BEGIN_CPP11
    add_numeric_split_tree_value_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_num), cpp11::as_cpp<cpp11::decay_t<int>>(feature_num), cpp11::as_cpp<cpp11::decay_t<double>>(split_threshold), cpp11::as_cpp<cpp11::decay_t<double>>(left_leaf_value), cpp11::as_cpp<cpp11::decay_t<double>>(right_leaf_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_numeric_split_tree_vector_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int leaf_num, int feature_num, double split_threshold, cpp11::doubles left_leaf_vector, cpp11::doubles right_leaf_vector);
extern "C" SEXP _stochtree_add_numeric_split_tree_vector_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP leaf_num, SEXP feature_num, SEXP split_threshold, SEXP left_leaf_vector, SEXP right_leaf_vector) {
  BEGIN_CPP11
    add_numeric_split_tree_vector_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_num), cpp11::as_cpp<cpp11::decay_t<int>>(feature_num), cpp11::as_cpp<cpp11::decay_t<double>>(split_threshold), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(left_leaf_vector), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(right_leaf_vector));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_tree_leaves_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_get_tree_leaves_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_tree_leaves_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_tree_split_counts_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int num_features);
extern "C" SEXP _stochtree_get_tree_split_counts_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_tree_split_counts_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_forest_split_counts_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int num_features);
extern "C" SEXP _stochtree_get_forest_split_counts_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_forest_split_counts_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_overall_split_counts_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int num_features);
extern "C" SEXP _stochtree_get_overall_split_counts_forest_container_cpp(SEXP forest_samples, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_overall_split_counts_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_granular_split_count_array_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int num_features);
extern "C" SEXP _stochtree_get_granular_split_count_array_forest_container_cpp(SEXP forest_samples, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_granular_split_count_array_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
void set_leaf_vector_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::doubles leaf_vector);
extern "C" SEXP _stochtree_set_leaf_vector_forest_container_cpp(SEXP forest_samples, SEXP leaf_vector) {
  BEGIN_CPP11
    set_leaf_vector_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(leaf_vector));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
bool is_leaf_node_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_is_leaf_node_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_leaf_node_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
bool is_numeric_split_node_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_is_numeric_split_node_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_numeric_split_node_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
bool is_categorical_split_node_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_is_categorical_split_node_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_categorical_split_node_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
int parent_node_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_parent_node_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(parent_node_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
int left_child_node_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_left_child_node_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(left_child_node_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
int right_child_node_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_right_child_node_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(right_child_node_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
int node_depth_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_node_depth_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(node_depth_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
int split_index_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_split_index_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(split_index_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
double split_theshold_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_split_theshold_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(split_theshold_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers split_categories_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_split_categories_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(split_categories_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles leaf_values_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num, int node_id);
extern "C" SEXP _stochtree_leaf_values_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num, SEXP node_id) {
  BEGIN_CPP11
    return cpp11::as_sexp(leaf_values_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(node_id)));
  END_CPP11
}
// forest.cpp
int num_nodes_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_num_nodes_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_nodes_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
int num_leaves_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_num_leaves_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_leaves_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
int num_leaf_parents_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_num_leaf_parents_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_leaf_parents_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
int num_split_nodes_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_num_split_nodes_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_split_nodes_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers nodes_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_nodes_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(nodes_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers leaves_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num, int tree_num);
extern "C" SEXP _stochtree_leaves_forest_container_cpp(SEXP forest_samples, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(leaves_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
void initialize_forest_model_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestTracker> tracker, cpp11::doubles init_values, int leaf_model_int);
extern "C" SEXP _stochtree_initialize_forest_model_cpp(SEXP data, SEXP residual, SEXP forest_samples, SEXP tracker, SEXP init_values, SEXP leaf_model_int) {
  BEGIN_CPP11
    initialize_forest_model_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(init_values), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_model_int));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void adjust_residual_forest_container_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestTracker> tracker, bool requires_basis, int forest_num, bool add);
extern "C" SEXP _stochtree_adjust_residual_forest_container_cpp(SEXP data, SEXP residual, SEXP forest_samples, SEXP tracker, SEXP requires_basis, SEXP forest_num, SEXP add) {
  BEGIN_CPP11
    adjust_residual_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<bool>>(requires_basis), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<bool>>(add));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void propagate_basis_update_forest_container_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestTracker> tracker, int forest_num);
extern "C" SEXP _stochtree_propagate_basis_update_forest_container_cpp(SEXP data, SEXP residual, SEXP forest_samples, SEXP tracker, SEXP forest_num) {
  BEGIN_CPP11
    propagate_basis_update_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void remove_sample_forest_container_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num);
extern "C" SEXP _stochtree_remove_sample_forest_container_cpp(SEXP forest_samples, SEXP forest_num) {
  BEGIN_CPP11
    remove_sample_forest_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles_matrix<> predict_forest_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_predict_forest_cpp(SEXP forest_samples, SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(predict_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles predict_forest_raw_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_predict_forest_raw_cpp(SEXP forest_samples, SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(predict_forest_raw_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles_matrix<> predict_forest_raw_single_forest_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestDataset> dataset, int forest_num);
extern "C" SEXP _stochtree_predict_forest_raw_single_forest_cpp(SEXP forest_samples, SEXP dataset, SEXP forest_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(predict_forest_raw_single_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num)));
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles_matrix<> predict_forest_raw_single_tree_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::ForestDataset> dataset, int forest_num, int tree_num);
extern "C" SEXP _stochtree_predict_forest_raw_single_tree_cpp(SEXP forest_samples, SEXP dataset, SEXP forest_num, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(predict_forest_raw_single_tree_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles predict_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_predict_active_forest_cpp(SEXP active_forest, SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(predict_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// forest.cpp
cpp11::writable::doubles predict_raw_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestDataset> dataset);
extern "C" SEXP _stochtree_predict_raw_active_forest_cpp(SEXP active_forest, SEXP dataset) {
  BEGIN_CPP11
    return cpp11::as_sexp(predict_raw_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset)));
  END_CPP11
}
// forest.cpp
int leaf_dimension_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_leaf_dimension_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    return cpp11::as_sexp(leaf_dimension_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest)));
  END_CPP11
}
// forest.cpp
double average_max_depth_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_average_max_depth_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    return cpp11::as_sexp(average_max_depth_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest)));
  END_CPP11
}
// forest.cpp
int num_trees_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_num_trees_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    return cpp11::as_sexp(num_trees_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest)));
  END_CPP11
}
// forest.cpp
int ensemble_tree_max_depth_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int tree_num);
extern "C" SEXP _stochtree_ensemble_tree_max_depth_active_forest_cpp(SEXP active_forest, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(ensemble_tree_max_depth_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
int is_leaf_constant_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_is_leaf_constant_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_leaf_constant_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest)));
  END_CPP11
}
// forest.cpp
int is_exponentiated_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_is_exponentiated_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    return cpp11::as_sexp(is_exponentiated_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest)));
  END_CPP11
}
// forest.cpp
bool all_roots_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_all_roots_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    return cpp11::as_sexp(all_roots_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest)));
  END_CPP11
}
// forest.cpp
void set_leaf_value_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, double leaf_value);
extern "C" SEXP _stochtree_set_leaf_value_active_forest_cpp(SEXP active_forest, SEXP leaf_value) {
  BEGIN_CPP11
    set_leaf_value_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<double>>(leaf_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void set_leaf_vector_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::doubles leaf_vector);
extern "C" SEXP _stochtree_set_leaf_vector_active_forest_cpp(SEXP active_forest, SEXP leaf_vector) {
  BEGIN_CPP11
    set_leaf_vector_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(leaf_vector));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_numeric_split_tree_value_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int tree_num, int leaf_num, int feature_num, double split_threshold, double left_leaf_value, double right_leaf_value);
extern "C" SEXP _stochtree_add_numeric_split_tree_value_active_forest_cpp(SEXP active_forest, SEXP tree_num, SEXP leaf_num, SEXP feature_num, SEXP split_threshold, SEXP left_leaf_value, SEXP right_leaf_value) {
  BEGIN_CPP11
    add_numeric_split_tree_value_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_num), cpp11::as_cpp<cpp11::decay_t<int>>(feature_num), cpp11::as_cpp<cpp11::decay_t<double>>(split_threshold), cpp11::as_cpp<cpp11::decay_t<double>>(left_leaf_value), cpp11::as_cpp<cpp11::decay_t<double>>(right_leaf_value));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void add_numeric_split_tree_vector_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int tree_num, int leaf_num, int feature_num, double split_threshold, cpp11::doubles left_leaf_vector, cpp11::doubles right_leaf_vector);
extern "C" SEXP _stochtree_add_numeric_split_tree_vector_active_forest_cpp(SEXP active_forest, SEXP tree_num, SEXP leaf_num, SEXP feature_num, SEXP split_threshold, SEXP left_leaf_vector, SEXP right_leaf_vector) {
  BEGIN_CPP11
    add_numeric_split_tree_vector_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_num), cpp11::as_cpp<cpp11::decay_t<int>>(feature_num), cpp11::as_cpp<cpp11::decay_t<double>>(split_threshold), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(left_leaf_vector), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(right_leaf_vector));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_tree_leaves_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int tree_num);
extern "C" SEXP _stochtree_get_tree_leaves_active_forest_cpp(SEXP active_forest, SEXP tree_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_tree_leaves_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_tree_split_counts_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int tree_num, int num_features);
extern "C" SEXP _stochtree_get_tree_split_counts_active_forest_cpp(SEXP active_forest, SEXP tree_num, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_tree_split_counts_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(tree_num), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_overall_split_counts_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int num_features);
extern "C" SEXP _stochtree_get_overall_split_counts_active_forest_cpp(SEXP active_forest, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_overall_split_counts_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
cpp11::writable::integers get_granular_split_count_array_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, int num_features);
extern "C" SEXP _stochtree_get_granular_split_count_array_active_forest_cpp(SEXP active_forest, SEXP num_features) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_granular_split_count_array_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<int>>(num_features)));
  END_CPP11
}
// forest.cpp
void initialize_forest_model_active_forest_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestTracker> tracker, cpp11::doubles init_values, int leaf_model_int);
extern "C" SEXP _stochtree_initialize_forest_model_active_forest_cpp(SEXP data, SEXP residual, SEXP active_forest, SEXP tracker, SEXP init_values, SEXP leaf_model_int) {
  BEGIN_CPP11
    initialize_forest_model_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(init_values), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_model_int));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void adjust_residual_active_forest_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestTracker> tracker, bool requires_basis, bool add);
extern "C" SEXP _stochtree_adjust_residual_active_forest_cpp(SEXP data, SEXP residual, SEXP active_forest, SEXP tracker, SEXP requires_basis, SEXP add) {
  BEGIN_CPP11
    adjust_residual_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<bool>>(requires_basis), cpp11::as_cpp<cpp11::decay_t<bool>>(add));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void propagate_basis_update_active_forest_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestTracker> tracker);
extern "C" SEXP _stochtree_propagate_basis_update_active_forest_cpp(SEXP data, SEXP residual, SEXP active_forest, SEXP tracker) {
  BEGIN_CPP11
    propagate_basis_update_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void reset_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestContainer> forest_samples, int forest_num);
extern "C" SEXP _stochtree_reset_active_forest_cpp(SEXP active_forest, SEXP forest_samples, SEXP forest_num) {
  BEGIN_CPP11
    reset_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void reset_forest_model_cpp(cpp11::external_pointer<StochTree::ForestTracker> forest_tracker, cpp11::external_pointer<StochTree::TreeEnsemble> forest, cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, bool is_mean_model);
extern "C" SEXP _stochtree_reset_forest_model_cpp(SEXP forest_tracker, SEXP forest, SEXP data, SEXP residual, SEXP is_mean_model) {
  BEGIN_CPP11
    reset_forest_model_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(forest_tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<bool>>(is_mean_model));
    return R_NilValue;
  END_CPP11
}
// forest.cpp
void root_reset_active_forest_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest);
extern "C" SEXP _stochtree_root_reset_active_forest_cpp(SEXP active_forest) {
  BEGIN_CPP11
    root_reset_active_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest));
    return R_NilValue;
  END_CPP11
}
// kernel.cpp
int forest_container_get_max_leaf_index_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_container, int forest_num);
extern "C" SEXP _stochtree_forest_container_get_max_leaf_index_cpp(SEXP forest_container, SEXP forest_num) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_container_get_max_leaf_index_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_container), cpp11::as_cpp<cpp11::decay_t<int>>(forest_num)));
  END_CPP11
}
// kernel.cpp
cpp11::writable::integers_matrix<> compute_leaf_indices_cpp(cpp11::external_pointer<StochTree::ForestContainer> forest_container, cpp11::doubles_matrix<> covariates, cpp11::integers forest_nums);
extern "C" SEXP _stochtree_compute_leaf_indices_cpp(SEXP forest_container, SEXP covariates, SEXP forest_nums) {
  BEGIN_CPP11
    return cpp11::as_sexp(compute_leaf_indices_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_container), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(covariates), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(forest_nums)));
  END_CPP11
}
// sampler.cpp
void sample_gfr_one_iteration_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestTracker> tracker, cpp11::external_pointer<StochTree::TreePrior> split_prior, cpp11::external_pointer<std::mt19937> rng, cpp11::integers sweep_indices, cpp11::integers feature_types, int cutpoint_grid_size, cpp11::doubles_matrix<> leaf_model_scale_input, cpp11::doubles variable_weights, double a_forest, double b_forest, double global_variance, int leaf_model_int, bool keep_forest, int num_features_subsample, int num_threads);
extern "C" SEXP _stochtree_sample_gfr_one_iteration_cpp(SEXP data, SEXP residual, SEXP forest_samples, SEXP active_forest, SEXP tracker, SEXP split_prior, SEXP rng, SEXP sweep_indices, SEXP feature_types, SEXP cutpoint_grid_size, SEXP leaf_model_scale_input, SEXP variable_weights, SEXP a_forest, SEXP b_forest, SEXP global_variance, SEXP leaf_model_int, SEXP keep_forest, SEXP num_features_subsample, SEXP num_threads) {
  BEGIN_CPP11
    sample_gfr_one_iteration_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(split_prior), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(sweep_indices), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(feature_types), cpp11::as_cpp<cpp11::decay_t<int>>(cutpoint_grid_size), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(leaf_model_scale_input), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(variable_weights), cpp11::as_cpp<cpp11::decay_t<double>>(a_forest), cpp11::as_cpp<cpp11::decay_t<double>>(b_forest), cpp11::as_cpp<cpp11::decay_t<double>>(global_variance), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_model_int), cpp11::as_cpp<cpp11::decay_t<bool>>(keep_forest), cpp11::as_cpp<cpp11::decay_t<int>>(num_features_subsample), cpp11::as_cpp<cpp11::decay_t<int>>(num_threads));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
void sample_mcmc_one_iteration_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::ForestContainer> forest_samples, cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<StochTree::ForestTracker> tracker, cpp11::external_pointer<StochTree::TreePrior> split_prior, cpp11::external_pointer<std::mt19937> rng, cpp11::integers sweep_indices, cpp11::integers feature_types, int cutpoint_grid_size, cpp11::doubles_matrix<> leaf_model_scale_input, cpp11::doubles variable_weights, double a_forest, double b_forest, double global_variance, int leaf_model_int, bool keep_forest, int num_threads);
extern "C" SEXP _stochtree_sample_mcmc_one_iteration_cpp(SEXP data, SEXP residual, SEXP forest_samples, SEXP active_forest, SEXP tracker, SEXP split_prior, SEXP rng, SEXP sweep_indices, SEXP feature_types, SEXP cutpoint_grid_size, SEXP leaf_model_scale_input, SEXP variable_weights, SEXP a_forest, SEXP b_forest, SEXP global_variance, SEXP leaf_model_int, SEXP keep_forest, SEXP num_threads) {
  BEGIN_CPP11
    sample_mcmc_one_iteration_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(split_prior), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(sweep_indices), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(feature_types), cpp11::as_cpp<cpp11::decay_t<int>>(cutpoint_grid_size), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles_matrix<>>>(leaf_model_scale_input), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(variable_weights), cpp11::as_cpp<cpp11::decay_t<double>>(a_forest), cpp11::as_cpp<cpp11::decay_t<double>>(b_forest), cpp11::as_cpp<cpp11::decay_t<double>>(global_variance), cpp11::as_cpp<cpp11::decay_t<int>>(leaf_model_int), cpp11::as_cpp<cpp11::decay_t<bool>>(keep_forest), cpp11::as_cpp<cpp11::decay_t<int>>(num_threads));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
double sample_sigma2_one_iteration_cpp(cpp11::external_pointer<StochTree::ColumnVector> residual, cpp11::external_pointer<StochTree::ForestDataset> dataset, cpp11::external_pointer<std::mt19937> rng, double a, double b);
extern "C" SEXP _stochtree_sample_sigma2_one_iteration_cpp(SEXP residual, SEXP dataset, SEXP rng, SEXP a, SEXP b) {
  BEGIN_CPP11
    return cpp11::as_sexp(sample_sigma2_one_iteration_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(residual), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(dataset), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng), cpp11::as_cpp<cpp11::decay_t<double>>(a), cpp11::as_cpp<cpp11::decay_t<double>>(b)));
  END_CPP11
}
// sampler.cpp
double sample_tau_one_iteration_cpp(cpp11::external_pointer<StochTree::TreeEnsemble> active_forest, cpp11::external_pointer<std::mt19937> rng, double a, double b);
extern "C" SEXP _stochtree_sample_tau_one_iteration_cpp(SEXP active_forest, SEXP rng, SEXP a, SEXP b) {
  BEGIN_CPP11
    return cpp11::as_sexp(sample_tau_one_iteration_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreeEnsemble>>>(active_forest), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng), cpp11::as_cpp<cpp11::decay_t<double>>(a), cpp11::as_cpp<cpp11::decay_t<double>>(b)));
  END_CPP11
}
// sampler.cpp
cpp11::external_pointer<std::mt19937> rng_cpp(int random_seed);
extern "C" SEXP _stochtree_rng_cpp(SEXP random_seed) {
  BEGIN_CPP11
    return cpp11::as_sexp(rng_cpp(cpp11::as_cpp<cpp11::decay_t<int>>(random_seed)));
  END_CPP11
}
// sampler.cpp
cpp11::external_pointer<StochTree::TreePrior> tree_prior_cpp(double alpha, double beta, int min_samples_leaf, int max_depth);
extern "C" SEXP _stochtree_tree_prior_cpp(SEXP alpha, SEXP beta, SEXP min_samples_leaf, SEXP max_depth) {
  BEGIN_CPP11
    return cpp11::as_sexp(tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<double>>(alpha), cpp11::as_cpp<cpp11::decay_t<double>>(beta), cpp11::as_cpp<cpp11::decay_t<int>>(min_samples_leaf), cpp11::as_cpp<cpp11::decay_t<int>>(max_depth)));
  END_CPP11
}
// sampler.cpp
void update_alpha_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr, double alpha);
extern "C" SEXP _stochtree_update_alpha_tree_prior_cpp(SEXP tree_prior_ptr, SEXP alpha) {
  BEGIN_CPP11
    update_alpha_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr), cpp11::as_cpp<cpp11::decay_t<double>>(alpha));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
void update_beta_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr, double beta);
extern "C" SEXP _stochtree_update_beta_tree_prior_cpp(SEXP tree_prior_ptr, SEXP beta) {
  BEGIN_CPP11
    update_beta_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr), cpp11::as_cpp<cpp11::decay_t<double>>(beta));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
void update_min_samples_leaf_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr, int min_samples_leaf);
extern "C" SEXP _stochtree_update_min_samples_leaf_tree_prior_cpp(SEXP tree_prior_ptr, SEXP min_samples_leaf) {
  BEGIN_CPP11
    update_min_samples_leaf_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(min_samples_leaf));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
void update_max_depth_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr, int max_depth);
extern "C" SEXP _stochtree_update_max_depth_tree_prior_cpp(SEXP tree_prior_ptr, SEXP max_depth) {
  BEGIN_CPP11
    update_max_depth_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr), cpp11::as_cpp<cpp11::decay_t<int>>(max_depth));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
double get_alpha_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr);
extern "C" SEXP _stochtree_get_alpha_tree_prior_cpp(SEXP tree_prior_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_alpha_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr)));
  END_CPP11
}
// sampler.cpp
double get_beta_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr);
extern "C" SEXP _stochtree_get_beta_tree_prior_cpp(SEXP tree_prior_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_beta_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr)));
  END_CPP11
}
// sampler.cpp
int get_min_samples_leaf_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr);
extern "C" SEXP _stochtree_get_min_samples_leaf_tree_prior_cpp(SEXP tree_prior_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_min_samples_leaf_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr)));
  END_CPP11
}
// sampler.cpp
int get_max_depth_tree_prior_cpp(cpp11::external_pointer<StochTree::TreePrior> tree_prior_ptr);
extern "C" SEXP _stochtree_get_max_depth_tree_prior_cpp(SEXP tree_prior_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_max_depth_tree_prior_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::TreePrior>>>(tree_prior_ptr)));
  END_CPP11
}
// sampler.cpp
cpp11::external_pointer<StochTree::ForestTracker> forest_tracker_cpp(cpp11::external_pointer<StochTree::ForestDataset> data, cpp11::integers feature_types, int num_trees, StochTree::data_size_t n);
extern "C" SEXP _stochtree_forest_tracker_cpp(SEXP data, SEXP feature_types, SEXP num_trees, SEXP n) {
  BEGIN_CPP11
    return cpp11::as_sexp(forest_tracker_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(feature_types), cpp11::as_cpp<cpp11::decay_t<int>>(num_trees), cpp11::as_cpp<cpp11::decay_t<StochTree::data_size_t>>(n)));
  END_CPP11
}
// sampler.cpp
cpp11::writable::doubles get_cached_forest_predictions_cpp(cpp11::external_pointer<StochTree::ForestTracker> tracker_ptr);
extern "C" SEXP _stochtree_get_cached_forest_predictions_cpp(SEXP tracker_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_cached_forest_predictions_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestTracker>>>(tracker_ptr)));
  END_CPP11
}
// sampler.cpp
cpp11::writable::integers sample_without_replacement_integer_cpp(cpp11::integers population_vector, cpp11::doubles sampling_probs, int sample_size);
extern "C" SEXP _stochtree_sample_without_replacement_integer_cpp(SEXP population_vector, SEXP sampling_probs, SEXP sample_size) {
  BEGIN_CPP11
    return cpp11::as_sexp(sample_without_replacement_integer_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(population_vector), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(sampling_probs), cpp11::as_cpp<cpp11::decay_t<int>>(sample_size)));
  END_CPP11
}
// sampler.cpp
cpp11::external_pointer<StochTree::OrdinalSampler> ordinal_sampler_cpp();
extern "C" SEXP _stochtree_ordinal_sampler_cpp() {
  BEGIN_CPP11
    return cpp11::as_sexp(ordinal_sampler_cpp());
  END_CPP11
}
// sampler.cpp
void ordinal_sampler_update_latent_variables_cpp(cpp11::external_pointer<StochTree::OrdinalSampler> sampler_ptr, cpp11::external_pointer<StochTree::ForestDataset> data_ptr, cpp11::external_pointer<StochTree::ColumnVector> outcome_ptr, cpp11::external_pointer<std::mt19937> rng_ptr);
extern "C" SEXP _stochtree_ordinal_sampler_update_latent_variables_cpp(SEXP sampler_ptr, SEXP data_ptr, SEXP outcome_ptr, SEXP rng_ptr) {
  BEGIN_CPP11
    ordinal_sampler_update_latent_variables_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::OrdinalSampler>>>(sampler_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(outcome_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng_ptr));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
void ordinal_sampler_update_gamma_params_cpp(cpp11::external_pointer<StochTree::OrdinalSampler> sampler_ptr, cpp11::external_pointer<StochTree::ForestDataset> data_ptr, cpp11::external_pointer<StochTree::ColumnVector> outcome_ptr, double alpha_gamma, double beta_gamma, double gamma_0, cpp11::external_pointer<std::mt19937> rng_ptr);
extern "C" SEXP _stochtree_ordinal_sampler_update_gamma_params_cpp(SEXP sampler_ptr, SEXP data_ptr, SEXP outcome_ptr, SEXP alpha_gamma, SEXP beta_gamma, SEXP gamma_0, SEXP rng_ptr) {
  BEGIN_CPP11
    ordinal_sampler_update_gamma_params_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::OrdinalSampler>>>(sampler_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ColumnVector>>>(outcome_ptr), cpp11::as_cpp<cpp11::decay_t<double>>(alpha_gamma), cpp11::as_cpp<cpp11::decay_t<double>>(beta_gamma), cpp11::as_cpp<cpp11::decay_t<double>>(gamma_0), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<std::mt19937>>>(rng_ptr));
    return R_NilValue;
  END_CPP11
}
// sampler.cpp
void ordinal_sampler_update_cumsum_exp_cpp(cpp11::external_pointer<StochTree::OrdinalSampler> sampler_ptr, cpp11::external_pointer<StochTree::ForestDataset> data_ptr);
extern "C" SEXP _stochtree_ordinal_sampler_update_cumsum_exp_cpp(SEXP sampler_ptr, SEXP data_ptr) {
  BEGIN_CPP11
    ordinal_sampler_update_cumsum_exp_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::OrdinalSampler>>>(sampler_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestDataset>>>(data_ptr));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
cpp11::external_pointer<nlohmann::json> init_json_cpp();
extern "C" SEXP _stochtree_init_json_cpp() {
  BEGIN_CPP11
    return cpp11::as_sexp(init_json_cpp());
  END_CPP11
}
// serialization.cpp
void json_add_double_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, double field_value);
extern "C" SEXP _stochtree_json_add_double_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_double_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<double>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_double_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, double field_value);
extern "C" SEXP _stochtree_json_add_double_cpp(SEXP json_ptr, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_double_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<double>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_integer_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, int field_value);
extern "C" SEXP _stochtree_json_add_integer_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_integer_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<int>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_integer_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, int field_value);
extern "C" SEXP _stochtree_json_add_integer_cpp(SEXP json_ptr, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_integer_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<int>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_bool_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, bool field_value);
extern "C" SEXP _stochtree_json_add_bool_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_bool_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<bool>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_bool_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, bool field_value);
extern "C" SEXP _stochtree_json_add_bool_cpp(SEXP json_ptr, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_bool_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<bool>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_vector_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, cpp11::doubles field_vector);
extern "C" SEXP _stochtree_json_add_vector_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_vector) {
  BEGIN_CPP11
    json_add_vector_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(field_vector));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_vector_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, cpp11::doubles field_vector);
extern "C" SEXP _stochtree_json_add_vector_cpp(SEXP json_ptr, SEXP field_name, SEXP field_vector) {
  BEGIN_CPP11
    json_add_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<cpp11::doubles>>(field_vector));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_integer_vector_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, cpp11::integers field_vector);
extern "C" SEXP _stochtree_json_add_integer_vector_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_vector) {
  BEGIN_CPP11
    json_add_integer_vector_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(field_vector));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_integer_vector_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, cpp11::integers field_vector);
extern "C" SEXP _stochtree_json_add_integer_vector_cpp(SEXP json_ptr, SEXP field_name, SEXP field_vector) {
  BEGIN_CPP11
    json_add_integer_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(field_vector));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_string_vector_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, cpp11::strings field_vector);
extern "C" SEXP _stochtree_json_add_string_vector_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_vector) {
  BEGIN_CPP11
    json_add_string_vector_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(field_vector));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_string_vector_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, cpp11::strings field_vector);
extern "C" SEXP _stochtree_json_add_string_vector_cpp(SEXP json_ptr, SEXP field_name, SEXP field_vector) {
  BEGIN_CPP11
    json_add_string_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<cpp11::strings>>(field_vector));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_string_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name, std::string field_value);
extern "C" SEXP _stochtree_json_add_string_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_string_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_add_string_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name, std::string field_value);
extern "C" SEXP _stochtree_json_add_string_cpp(SEXP json_ptr, SEXP field_name, SEXP field_value) {
  BEGIN_CPP11
    json_add_string_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_value));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
bool json_contains_field_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_contains_field_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_contains_field_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
bool json_contains_field_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_contains_field_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_contains_field_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
double json_extract_double_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_double_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_double_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
double json_extract_double_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_double_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_double_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
int json_extract_integer_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_integer_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_integer_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
int json_extract_integer_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_integer_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_integer_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
bool json_extract_bool_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_bool_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_bool_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
bool json_extract_bool_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_bool_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_bool_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
std::string json_extract_string_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_string_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_string_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
std::string json_extract_string_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_string_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_string_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
cpp11::writable::doubles json_extract_vector_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_vector_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_vector_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
cpp11::writable::doubles json_extract_vector_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_vector_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
cpp11::writable::integers json_extract_integer_vector_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_integer_vector_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_integer_vector_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
cpp11::writable::integers json_extract_integer_vector_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_integer_vector_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_integer_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
cpp11::writable::strings json_extract_string_vector_subfolder_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string subfolder_name, std::string field_name);
extern "C" SEXP _stochtree_json_extract_string_vector_subfolder_cpp(SEXP json_ptr, SEXP subfolder_name, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_string_vector_subfolder_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(subfolder_name), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
cpp11::writable::strings json_extract_string_vector_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string field_name);
extern "C" SEXP _stochtree_json_extract_string_vector_cpp(SEXP json_ptr, SEXP field_name) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_extract_string_vector_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(field_name)));
  END_CPP11
}
// serialization.cpp
std::string json_add_forest_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, cpp11::external_pointer<StochTree::ForestContainer> forest_samples);
extern "C" SEXP _stochtree_json_add_forest_cpp(SEXP json_ptr, SEXP forest_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_add_forest_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::ForestContainer>>>(forest_samples)));
  END_CPP11
}
// serialization.cpp
void json_increment_rfx_count_cpp(cpp11::external_pointer<nlohmann::json> json_ptr);
extern "C" SEXP _stochtree_json_increment_rfx_count_cpp(SEXP json_ptr) {
  BEGIN_CPP11
    json_increment_rfx_count_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
std::string json_add_rfx_container_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, cpp11::external_pointer<StochTree::RandomEffectsContainer> rfx_samples);
extern "C" SEXP _stochtree_json_add_rfx_container_cpp(SEXP json_ptr, SEXP rfx_samples) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_add_rfx_container_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::RandomEffectsContainer>>>(rfx_samples)));
  END_CPP11
}
// serialization.cpp
std::string json_add_rfx_label_mapper_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, cpp11::external_pointer<StochTree::LabelMapper> label_mapper);
extern "C" SEXP _stochtree_json_add_rfx_label_mapper_cpp(SEXP json_ptr, SEXP label_mapper) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_add_rfx_label_mapper_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<StochTree::LabelMapper>>>(label_mapper)));
  END_CPP11
}
// serialization.cpp
std::string json_add_rfx_groupids_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, cpp11::integers groupids);
extern "C" SEXP _stochtree_json_add_rfx_groupids_cpp(SEXP json_ptr, SEXP groupids) {
  BEGIN_CPP11
    return cpp11::as_sexp(json_add_rfx_groupids_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<cpp11::integers>>(groupids)));
  END_CPP11
}
// serialization.cpp
std::string get_json_string_cpp(cpp11::external_pointer<nlohmann::json> json_ptr);
extern "C" SEXP _stochtree_get_json_string_cpp(SEXP json_ptr) {
  BEGIN_CPP11
    return cpp11::as_sexp(get_json_string_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr)));
  END_CPP11
}
// serialization.cpp
void json_save_file_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string filename);
extern "C" SEXP _stochtree_json_save_file_cpp(SEXP json_ptr, SEXP filename) {
  BEGIN_CPP11
    json_save_file_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_load_file_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string filename);
extern "C" SEXP _stochtree_json_load_file_cpp(SEXP json_ptr, SEXP filename) {
  BEGIN_CPP11
    json_load_file_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(filename));
    return R_NilValue;
  END_CPP11
}
// serialization.cpp
void json_load_string_cpp(cpp11::external_pointer<nlohmann::json> json_ptr, std::string json_string);
extern "C" SEXP _stochtree_json_load_string_cpp(SEXP json_ptr, SEXP json_string) {
  BEGIN_CPP11
    json_load_string_cpp(cpp11::as_cpp<cpp11::decay_t<cpp11::external_pointer<nlohmann::json>>>(json_ptr), cpp11::as_cpp<cpp11::decay_t<std::string>>(json_string));
    return R_NilValue;
  END_CPP11
}

extern "C" {
static const R_CallMethodDef CallEntries[] = {
    {"_stochtree_active_forest_cpp",                                   (DL_FUNC) &_stochtree_active_forest_cpp,                                    4},
    {"_stochtree_add_numeric_split_tree_value_active_forest_cpp",      (DL_FUNC) &_stochtree_add_numeric_split_tree_value_active_forest_cpp,       7},
    {"_stochtree_add_numeric_split_tree_value_forest_container_cpp",   (DL_FUNC) &_stochtree_add_numeric_split_tree_value_forest_container_cpp,    8},
    {"_stochtree_add_numeric_split_tree_vector_active_forest_cpp",     (DL_FUNC) &_stochtree_add_numeric_split_tree_vector_active_forest_cpp,      7},
    {"_stochtree_add_numeric_split_tree_vector_forest_container_cpp",  (DL_FUNC) &_stochtree_add_numeric_split_tree_vector_forest_container_cpp,   8},
    {"_stochtree_add_sample_forest_container_cpp",                     (DL_FUNC) &_stochtree_add_sample_forest_container_cpp,                      1},
    {"_stochtree_add_sample_value_forest_container_cpp",               (DL_FUNC) &_stochtree_add_sample_value_forest_container_cpp,                2},
    {"_stochtree_add_sample_vector_forest_container_cpp",              (DL_FUNC) &_stochtree_add_sample_vector_forest_container_cpp,               2},
    {"_stochtree_add_to_column_vector_cpp",                            (DL_FUNC) &_stochtree_add_to_column_vector_cpp,                             2},
    {"_stochtree_add_to_forest_forest_container_cpp",                  (DL_FUNC) &_stochtree_add_to_forest_forest_container_cpp,                   3},
    {"_stochtree_adjust_residual_active_forest_cpp",                   (DL_FUNC) &_stochtree_adjust_residual_active_forest_cpp,                    6},
    {"_stochtree_adjust_residual_forest_container_cpp",                (DL_FUNC) &_stochtree_adjust_residual_forest_container_cpp,                 7},
    {"_stochtree_all_roots_active_forest_cpp",                         (DL_FUNC) &_stochtree_all_roots_active_forest_cpp,                          1},
    {"_stochtree_all_roots_forest_container_cpp",                      (DL_FUNC) &_stochtree_all_roots_forest_container_cpp,                       2},
    {"_stochtree_average_max_depth_active_forest_cpp",                 (DL_FUNC) &_stochtree_average_max_depth_active_forest_cpp,                  1},
    {"_stochtree_average_max_depth_forest_container_cpp",              (DL_FUNC) &_stochtree_average_max_depth_forest_container_cpp,               1},
    {"_stochtree_combine_forests_forest_container_cpp",                (DL_FUNC) &_stochtree_combine_forests_forest_container_cpp,                 2},
    {"_stochtree_compute_leaf_indices_cpp",                            (DL_FUNC) &_stochtree_compute_leaf_indices_cpp,                             3},
    {"_stochtree_create_column_vector_cpp",                            (DL_FUNC) &_stochtree_create_column_vector_cpp,                             1},
    {"_stochtree_create_forest_dataset_cpp",                           (DL_FUNC) &_stochtree_create_forest_dataset_cpp,                            0},
    {"_stochtree_create_rfx_dataset_cpp",                              (DL_FUNC) &_stochtree_create_rfx_dataset_cpp,                               0},
    {"_stochtree_dataset_has_basis_cpp",                               (DL_FUNC) &_stochtree_dataset_has_basis_cpp,                                1},
    {"_stochtree_dataset_has_variance_weights_cpp",                    (DL_FUNC) &_stochtree_dataset_has_variance_weights_cpp,                     1},
    {"_stochtree_dataset_num_basis_cpp",                               (DL_FUNC) &_stochtree_dataset_num_basis_cpp,                                1},
    {"_stochtree_dataset_num_covariates_cpp",                          (DL_FUNC) &_stochtree_dataset_num_covariates_cpp,                           1},
    {"_stochtree_dataset_num_rows_cpp",                                (DL_FUNC) &_stochtree_dataset_num_rows_cpp,                                 1},
    {"_stochtree_ensemble_average_max_depth_forest_container_cpp",     (DL_FUNC) &_stochtree_ensemble_average_max_depth_forest_container_cpp,      2},
    {"_stochtree_ensemble_tree_max_depth_active_forest_cpp",           (DL_FUNC) &_stochtree_ensemble_tree_max_depth_active_forest_cpp,            2},
    {"_stochtree_ensemble_tree_max_depth_forest_container_cpp",        (DL_FUNC) &_stochtree_ensemble_tree_max_depth_forest_container_cpp,         3},
    {"_stochtree_forest_add_constant_cpp",                             (DL_FUNC) &_stochtree_forest_add_constant_cpp,                              2},
    {"_stochtree_forest_container_append_from_json_cpp",               (DL_FUNC) &_stochtree_forest_container_append_from_json_cpp,                3},
    {"_stochtree_forest_container_append_from_json_string_cpp",        (DL_FUNC) &_stochtree_forest_container_append_from_json_string_cpp,         3},
    {"_stochtree_forest_container_cpp",                                (DL_FUNC) &_stochtree_forest_container_cpp,                                 4},
    {"_stochtree_forest_container_from_json_cpp",                      (DL_FUNC) &_stochtree_forest_container_from_json_cpp,                       2},
    {"_stochtree_forest_container_from_json_string_cpp",               (DL_FUNC) &_stochtree_forest_container_from_json_string_cpp,                2},
    {"_stochtree_forest_container_get_max_leaf_index_cpp",             (DL_FUNC) &_stochtree_forest_container_get_max_leaf_index_cpp,              2},
    {"_stochtree_forest_dataset_add_auxiliary_dimension_cpp",          (DL_FUNC) &_stochtree_forest_dataset_add_auxiliary_dimension_cpp,           2},
    {"_stochtree_forest_dataset_add_basis_cpp",                        (DL_FUNC) &_stochtree_forest_dataset_add_basis_cpp,                         2},
    {"_stochtree_forest_dataset_add_covariates_cpp",                   (DL_FUNC) &_stochtree_forest_dataset_add_covariates_cpp,                    2},
    {"_stochtree_forest_dataset_add_weights_cpp",                      (DL_FUNC) &_stochtree_forest_dataset_add_weights_cpp,                       2},
    {"_stochtree_forest_dataset_get_auxiliary_data_value_cpp",         (DL_FUNC) &_stochtree_forest_dataset_get_auxiliary_data_value_cpp,          3},
    {"_stochtree_forest_dataset_get_auxiliary_data_vector_cpp",        (DL_FUNC) &_stochtree_forest_dataset_get_auxiliary_data_vector_cpp,         2},
    {"_stochtree_forest_dataset_get_basis_cpp",                        (DL_FUNC) &_stochtree_forest_dataset_get_basis_cpp,                         1},
    {"_stochtree_forest_dataset_get_covariates_cpp",                   (DL_FUNC) &_stochtree_forest_dataset_get_covariates_cpp,                    1},
    {"_stochtree_forest_dataset_get_variance_weights_cpp",             (DL_FUNC) &_stochtree_forest_dataset_get_variance_weights_cpp,              1},
    {"_stochtree_forest_dataset_has_auxiliary_dimension_cpp",          (DL_FUNC) &_stochtree_forest_dataset_has_auxiliary_dimension_cpp,           2},
    {"_stochtree_forest_dataset_set_auxiliary_data_value_cpp",         (DL_FUNC) &_stochtree_forest_dataset_set_auxiliary_data_value_cpp,          4},
    {"_stochtree_forest_dataset_update_basis_cpp",                     (DL_FUNC) &_stochtree_forest_dataset_update_basis_cpp,                      2},
    {"_stochtree_forest_dataset_update_var_weights_cpp",               (DL_FUNC) &_stochtree_forest_dataset_update_var_weights_cpp,                3},
    {"_stochtree_forest_merge_cpp",                                    (DL_FUNC) &_stochtree_forest_merge_cpp,                                     2},
    {"_stochtree_forest_multiply_constant_cpp",                        (DL_FUNC) &_stochtree_forest_multiply_constant_cpp,                         2},
    {"_stochtree_forest_tracker_cpp",                                  (DL_FUNC) &_stochtree_forest_tracker_cpp,                                   4},
    {"_stochtree_get_alpha_tree_prior_cpp",                            (DL_FUNC) &_stochtree_get_alpha_tree_prior_cpp,                             1},
    {"_stochtree_get_beta_tree_prior_cpp",                             (DL_FUNC) &_stochtree_get_beta_tree_prior_cpp,                              1},
    {"_stochtree_get_cached_forest_predictions_cpp",                   (DL_FUNC) &_stochtree_get_cached_forest_predictions_cpp,                    1},
    {"_stochtree_get_forest_split_counts_forest_container_cpp",        (DL_FUNC) &_stochtree_get_forest_split_counts_forest_container_cpp,         3},
    {"_stochtree_get_granular_split_count_array_active_forest_cpp",    (DL_FUNC) &_stochtree_get_granular_split_count_array_active_forest_cpp,     2},
    {"_stochtree_get_granular_split_count_array_forest_container_cpp", (DL_FUNC) &_stochtree_get_granular_split_count_array_forest_container_cpp,  2},
    {"_stochtree_get_json_string_cpp",                                 (DL_FUNC) &_stochtree_get_json_string_cpp,                                  1},
    {"_stochtree_get_max_depth_tree_prior_cpp",                        (DL_FUNC) &_stochtree_get_max_depth_tree_prior_cpp,                         1},
    {"_stochtree_get_min_samples_leaf_tree_prior_cpp",                 (DL_FUNC) &_stochtree_get_min_samples_leaf_tree_prior_cpp,                  1},
    {"_stochtree_get_overall_split_counts_active_forest_cpp",          (DL_FUNC) &_stochtree_get_overall_split_counts_active_forest_cpp,           2},
    {"_stochtree_get_overall_split_counts_forest_container_cpp",       (DL_FUNC) &_stochtree_get_overall_split_counts_forest_container_cpp,        2},
    {"_stochtree_get_residual_cpp",                                    (DL_FUNC) &_stochtree_get_residual_cpp,                                     1},
    {"_stochtree_get_tree_leaves_active_forest_cpp",                   (DL_FUNC) &_stochtree_get_tree_leaves_active_forest_cpp,                    2},
    {"_stochtree_get_tree_leaves_forest_container_cpp",                (DL_FUNC) &_stochtree_get_tree_leaves_forest_container_cpp,                 3},
    {"_stochtree_get_tree_split_counts_active_forest_cpp",             (DL_FUNC) &_stochtree_get_tree_split_counts_active_forest_cpp,              3},
    {"_stochtree_get_tree_split_counts_forest_container_cpp",          (DL_FUNC) &_stochtree_get_tree_split_counts_forest_container_cpp,           4},
    {"_stochtree_init_json_cpp",                                       (DL_FUNC) &_stochtree_init_json_cpp,                                        0},
    {"_stochtree_initialize_forest_model_active_forest_cpp",           (DL_FUNC) &_stochtree_initialize_forest_model_active_forest_cpp,            6},
    {"_stochtree_initialize_forest_model_cpp",                         (DL_FUNC) &_stochtree_initialize_forest_model_cpp,                          6},
    {"_stochtree_is_categorical_split_node_forest_container_cpp",      (DL_FUNC) &_stochtree_is_categorical_split_node_forest_container_cpp,       4},
    {"_stochtree_is_exponentiated_active_forest_cpp",                  (DL_FUNC) &_stochtree_is_exponentiated_active_forest_cpp,                   1},
    {"_stochtree_is_exponentiated_forest_container_cpp",               (DL_FUNC) &_stochtree_is_exponentiated_forest_container_cpp,                1},
    {"_stochtree_is_leaf_constant_active_forest_cpp",                  (DL_FUNC) &_stochtree_is_leaf_constant_active_forest_cpp,                   1},
    {"_stochtree_is_leaf_constant_forest_container_cpp",               (DL_FUNC) &_stochtree_is_leaf_constant_forest_container_cpp,                1},
    {"_stochtree_is_leaf_node_forest_container_cpp",                   (DL_FUNC) &_stochtree_is_leaf_node_forest_container_cpp,                    4},
    {"_stochtree_is_numeric_split_node_forest_container_cpp",          (DL_FUNC) &_stochtree_is_numeric_split_node_forest_container_cpp,           4},
    {"_stochtree_json_add_bool_cpp",                                   (DL_FUNC) &_stochtree_json_add_bool_cpp,                                    3},
    {"_stochtree_json_add_bool_subfolder_cpp",                         (DL_FUNC) &_stochtree_json_add_bool_subfolder_cpp,                          4},
    {"_stochtree_json_add_double_cpp",                                 (DL_FUNC) &_stochtree_json_add_double_cpp,                                  3},
    {"_stochtree_json_add_double_subfolder_cpp",                       (DL_FUNC) &_stochtree_json_add_double_subfolder_cpp,                        4},
    {"_stochtree_json_add_forest_cpp",                                 (DL_FUNC) &_stochtree_json_add_forest_cpp,                                  2},
    {"_stochtree_json_add_integer_cpp",                                (DL_FUNC) &_stochtree_json_add_integer_cpp,                                 3},
    {"_stochtree_json_add_integer_subfolder_cpp",                      (DL_FUNC) &_stochtree_json_add_integer_subfolder_cpp,                       4},
    {"_stochtree_json_add_integer_vector_cpp",                         (DL_FUNC) &_stochtree_json_add_integer_vector_cpp,                          3},
    {"_stochtree_json_add_integer_vector_subfolder_cpp",               (DL_FUNC) &_stochtree_json_add_integer_vector_subfolder_cpp,                4},
    {"_stochtree_json_add_rfx_container_cpp",                          (DL_FUNC) &_stochtree_json_add_rfx_container_cpp,                           2},
    {"_stochtree_json_add_rfx_groupids_cpp",                           (DL_FUNC) &_stochtree_json_add_rfx_groupids_cpp,                            2},
    {"_stochtree_json_add_rfx_label_mapper_cpp",                       (DL_FUNC) &_stochtree_json_add_rfx_label_mapper_cpp,                        2},
    {"_stochtree_json_add_string_cpp",                                 (DL_FUNC) &_stochtree_json_add_string_cpp,                                  3},
    {"_stochtree_json_add_string_subfolder_cpp",                       (DL_FUNC) &_stochtree_json_add_string_subfolder_cpp,                        4},
    {"_stochtree_json_add_string_vector_cpp",                          (DL_FUNC) &_stochtree_json_add_string_vector_cpp,                           3},
    {"_stochtree_json_add_string_vector_subfolder_cpp",                (DL_FUNC) &_stochtree_json_add_string_vector_subfolder_cpp,                 4},
    {"_stochtree_json_add_vector_cpp",                                 (DL_FUNC) &_stochtree_json_add_vector_cpp,                                  3},
    {"_stochtree_json_add_vector_subfolder_cpp",                       (DL_FUNC) &_stochtree_json_add_vector_subfolder_cpp,                        4},
    {"_stochtree_json_contains_field_cpp",                             (DL_FUNC) &_stochtree_json_contains_field_cpp,                              2},
    {"_stochtree_json_contains_field_subfolder_cpp",                   (DL_FUNC) &_stochtree_json_contains_field_subfolder_cpp,                    3},
    {"_stochtree_json_extract_bool_cpp",                               (DL_FUNC) &_stochtree_json_extract_bool_cpp,                                2},
    {"_stochtree_json_extract_bool_subfolder_cpp",                     (DL_FUNC) &_stochtree_json_extract_bool_subfolder_cpp,                      3},
    {"_stochtree_json_extract_double_cpp",                             (DL_FUNC) &_stochtree_json_extract_double_cpp,                              2},
    {"_stochtree_json_extract_double_subfolder_cpp",                   (DL_FUNC) &_stochtree_json_extract_double_subfolder_cpp,                    3},
    {"_stochtree_json_extract_integer_cpp",                            (DL_FUNC) &_stochtree_json_extract_integer_cpp,                             2},
    {"_stochtree_json_extract_integer_subfolder_cpp",                  (DL_FUNC) &_stochtree_json_extract_integer_subfolder_cpp,                   3},
    {"_stochtree_json_extract_integer_vector_cpp",                     (DL_FUNC) &_stochtree_json_extract_integer_vector_cpp,                      2},
    {"_stochtree_json_extract_integer_vector_subfolder_cpp",           (DL_FUNC) &_stochtree_json_extract_integer_vector_subfolder_cpp,            3},
    {"_stochtree_json_extract_string_cpp",                             (DL_FUNC) &_stochtree_json_extract_string_cpp,                              2},
    {"_stochtree_json_extract_string_subfolder_cpp",                   (DL_FUNC) &_stochtree_json_extract_string_subfolder_cpp,                    3},
    {"_stochtree_json_extract_string_vector_cpp",                      (DL_FUNC) &_stochtree_json_extract_string_vector_cpp,                       2},
    {"_stochtree_json_extract_string_vector_subfolder_cpp",            (DL_FUNC) &_stochtree_json_extract_string_vector_subfolder_cpp,             3},
    {"_stochtree_json_extract_vector_cpp",                             (DL_FUNC) &_stochtree_json_extract_vector_cpp,                              2},
    {"_stochtree_json_extract_vector_subfolder_cpp",                   (DL_FUNC) &_stochtree_json_extract_vector_subfolder_cpp,                    3},
    {"_stochtree_json_increment_rfx_count_cpp",                        (DL_FUNC) &_stochtree_json_increment_rfx_count_cpp,                         1},
    {"_stochtree_json_load_file_cpp",                                  (DL_FUNC) &_stochtree_json_load_file_cpp,                                   2},
    {"_stochtree_json_load_forest_container_cpp",                      (DL_FUNC) &_stochtree_json_load_forest_container_cpp,                       2},
    {"_stochtree_json_load_string_cpp",                                (DL_FUNC) &_stochtree_json_load_string_cpp,                                 2},
    {"_stochtree_json_save_file_cpp",                                  (DL_FUNC) &_stochtree_json_save_file_cpp,                                   2},
    {"_stochtree_json_save_forest_container_cpp",                      (DL_FUNC) &_stochtree_json_save_forest_container_cpp,                       2},
    {"_stochtree_leaf_dimension_active_forest_cpp",                    (DL_FUNC) &_stochtree_leaf_dimension_active_forest_cpp,                     1},
    {"_stochtree_leaf_dimension_forest_container_cpp",                 (DL_FUNC) &_stochtree_leaf_dimension_forest_container_cpp,                  1},
    {"_stochtree_leaf_values_forest_container_cpp",                    (DL_FUNC) &_stochtree_leaf_values_forest_container_cpp,                     4},
    {"_stochtree_leaves_forest_container_cpp",                         (DL_FUNC) &_stochtree_leaves_forest_container_cpp,                          3},
    {"_stochtree_left_child_node_forest_container_cpp",                (DL_FUNC) &_stochtree_left_child_node_forest_container_cpp,                 4},
    {"_stochtree_mean_cpp",                                            (DL_FUNC) &_stochtree_mean_cpp,                                             1},
    {"_stochtree_multiply_forest_forest_container_cpp",                (DL_FUNC) &_stochtree_multiply_forest_forest_container_cpp,                 3},
    {"_stochtree_node_depth_forest_container_cpp",                     (DL_FUNC) &_stochtree_node_depth_forest_container_cpp,                      4},
    {"_stochtree_nodes_forest_container_cpp",                          (DL_FUNC) &_stochtree_nodes_forest_container_cpp,                           3},
    {"_stochtree_num_leaf_parents_forest_container_cpp",               (DL_FUNC) &_stochtree_num_leaf_parents_forest_container_cpp,                3},
    {"_stochtree_num_leaves_ensemble_forest_container_cpp",            (DL_FUNC) &_stochtree_num_leaves_ensemble_forest_container_cpp,             2},
    {"_stochtree_num_leaves_forest_container_cpp",                     (DL_FUNC) &_stochtree_num_leaves_forest_container_cpp,                      3},
    {"_stochtree_num_nodes_forest_container_cpp",                      (DL_FUNC) &_stochtree_num_nodes_forest_container_cpp,                       3},
    {"_stochtree_num_samples_forest_container_cpp",                    (DL_FUNC) &_stochtree_num_samples_forest_container_cpp,                     1},
    {"_stochtree_num_split_nodes_forest_container_cpp",                (DL_FUNC) &_stochtree_num_split_nodes_forest_container_cpp,                 3},
    {"_stochtree_num_trees_active_forest_cpp",                         (DL_FUNC) &_stochtree_num_trees_active_forest_cpp,                          1},
    {"_stochtree_num_trees_forest_container_cpp",                      (DL_FUNC) &_stochtree_num_trees_forest_container_cpp,                       1},
    {"_stochtree_ordinal_sampler_cpp",                                 (DL_FUNC) &_stochtree_ordinal_sampler_cpp,                                  0},
    {"_stochtree_ordinal_sampler_update_cumsum_exp_cpp",               (DL_FUNC) &_stochtree_ordinal_sampler_update_cumsum_exp_cpp,                2},
    {"_stochtree_ordinal_sampler_update_gamma_params_cpp",             (DL_FUNC) &_stochtree_ordinal_sampler_update_gamma_params_cpp,              7},
    {"_stochtree_ordinal_sampler_update_latent_variables_cpp",         (DL_FUNC) &_stochtree_ordinal_sampler_update_latent_variables_cpp,          4},
    {"_stochtree_overwrite_column_vector_cpp",                         (DL_FUNC) &_stochtree_overwrite_column_vector_cpp,                          2},
    {"_stochtree_parent_node_forest_container_cpp",                    (DL_FUNC) &_stochtree_parent_node_forest_container_cpp,                     4},
    {"_stochtree_predict_active_forest_cpp",                           (DL_FUNC) &_stochtree_predict_active_forest_cpp,                            2},
    {"_stochtree_predict_forest_cpp",                                  (DL_FUNC) &_stochtree_predict_forest_cpp,                                   2},
    {"_stochtree_predict_forest_raw_cpp",                              (DL_FUNC) &_stochtree_predict_forest_raw_cpp,                               2},
    {"_stochtree_predict_forest_raw_single_forest_cpp",                (DL_FUNC) &_stochtree_predict_forest_raw_single_forest_cpp,                 3},
    {"_stochtree_predict_forest_raw_single_tree_cpp",                  (DL_FUNC) &_stochtree_predict_forest_raw_single_tree_cpp,                   4},
    {"_stochtree_predict_raw_active_forest_cpp",                       (DL_FUNC) &_stochtree_predict_raw_active_forest_cpp,                        2},
    {"_stochtree_propagate_basis_update_active_forest_cpp",            (DL_FUNC) &_stochtree_propagate_basis_update_active_forest_cpp,             4},
    {"_stochtree_propagate_basis_update_forest_container_cpp",         (DL_FUNC) &_stochtree_propagate_basis_update_forest_container_cpp,          5},
    {"_stochtree_propagate_trees_column_vector_cpp",                   (DL_FUNC) &_stochtree_propagate_trees_column_vector_cpp,                    2},
    {"_stochtree_remove_sample_forest_container_cpp",                  (DL_FUNC) &_stochtree_remove_sample_forest_container_cpp,                   2},
    {"_stochtree_reset_active_forest_cpp",                             (DL_FUNC) &_stochtree_reset_active_forest_cpp,                              3},
    {"_stochtree_reset_forest_model_cpp",                              (DL_FUNC) &_stochtree_reset_forest_model_cpp,                               5},
    {"_stochtree_reset_rfx_model_cpp",                                 (DL_FUNC) &_stochtree_reset_rfx_model_cpp,                                  3},
    {"_stochtree_reset_rfx_tracker_cpp",                               (DL_FUNC) &_stochtree_reset_rfx_tracker_cpp,                                4},
    {"_stochtree_rfx_container_append_from_json_cpp",                  (DL_FUNC) &_stochtree_rfx_container_append_from_json_cpp,                   3},
    {"_stochtree_rfx_container_append_from_json_string_cpp",           (DL_FUNC) &_stochtree_rfx_container_append_from_json_string_cpp,            3},
    {"_stochtree_rfx_container_cpp",                                   (DL_FUNC) &_stochtree_rfx_container_cpp,                                    2},
    {"_stochtree_rfx_container_delete_sample_cpp",                     (DL_FUNC) &_stochtree_rfx_container_delete_sample_cpp,                      2},
    {"_stochtree_rfx_container_from_json_cpp",                         (DL_FUNC) &_stochtree_rfx_container_from_json_cpp,                          2},
    {"_stochtree_rfx_container_from_json_string_cpp",                  (DL_FUNC) &_stochtree_rfx_container_from_json_string_cpp,                   2},
    {"_stochtree_rfx_container_get_alpha_cpp",                         (DL_FUNC) &_stochtree_rfx_container_get_alpha_cpp,                          1},
    {"_stochtree_rfx_container_get_beta_cpp",                          (DL_FUNC) &_stochtree_rfx_container_get_beta_cpp,                           1},
    {"_stochtree_rfx_container_get_sigma_cpp",                         (DL_FUNC) &_stochtree_rfx_container_get_sigma_cpp,                          1},
    {"_stochtree_rfx_container_get_xi_cpp",                            (DL_FUNC) &_stochtree_rfx_container_get_xi_cpp,                             1},
    {"_stochtree_rfx_container_num_components_cpp",                    (DL_FUNC) &_stochtree_rfx_container_num_components_cpp,                     1},
    {"_stochtree_rfx_container_num_groups_cpp",                        (DL_FUNC) &_stochtree_rfx_container_num_groups_cpp,                         1},
    {"_stochtree_rfx_container_num_samples_cpp",                       (DL_FUNC) &_stochtree_rfx_container_num_samples_cpp,                        1},
    {"_stochtree_rfx_container_predict_cpp",                           (DL_FUNC) &_stochtree_rfx_container_predict_cpp,                            3},
    {"_stochtree_rfx_dataset_add_basis_cpp",                           (DL_FUNC) &_stochtree_rfx_dataset_add_basis_cpp,                            2},
    {"_stochtree_rfx_dataset_add_group_labels_cpp",                    (DL_FUNC) &_stochtree_rfx_dataset_add_group_labels_cpp,                     2},
    {"_stochtree_rfx_dataset_add_weights_cpp",                         (DL_FUNC) &_stochtree_rfx_dataset_add_weights_cpp,                          2},
    {"_stochtree_rfx_dataset_get_basis_cpp",                           (DL_FUNC) &_stochtree_rfx_dataset_get_basis_cpp,                            1},
    {"_stochtree_rfx_dataset_get_group_labels_cpp",                    (DL_FUNC) &_stochtree_rfx_dataset_get_group_labels_cpp,                     1},
    {"_stochtree_rfx_dataset_get_variance_weights_cpp",                (DL_FUNC) &_stochtree_rfx_dataset_get_variance_weights_cpp,                 1},
    {"_stochtree_rfx_dataset_has_basis_cpp",                           (DL_FUNC) &_stochtree_rfx_dataset_has_basis_cpp,                            1},
    {"_stochtree_rfx_dataset_has_group_labels_cpp",                    (DL_FUNC) &_stochtree_rfx_dataset_has_group_labels_cpp,                     1},
    {"_stochtree_rfx_dataset_has_variance_weights_cpp",                (DL_FUNC) &_stochtree_rfx_dataset_has_variance_weights_cpp,                 1},
    {"_stochtree_rfx_dataset_num_basis_cpp",                           (DL_FUNC) &_stochtree_rfx_dataset_num_basis_cpp,                            1},
    {"_stochtree_rfx_dataset_num_rows_cpp",                            (DL_FUNC) &_stochtree_rfx_dataset_num_rows_cpp,                             1},
    {"_stochtree_rfx_dataset_update_basis_cpp",                        (DL_FUNC) &_stochtree_rfx_dataset_update_basis_cpp,                         2},
    {"_stochtree_rfx_dataset_update_group_labels_cpp",                 (DL_FUNC) &_stochtree_rfx_dataset_update_group_labels_cpp,                  2},
    {"_stochtree_rfx_dataset_update_var_weights_cpp",                  (DL_FUNC) &_stochtree_rfx_dataset_update_var_weights_cpp,                   3},
    {"_stochtree_rfx_group_ids_from_json_cpp",                         (DL_FUNC) &_stochtree_rfx_group_ids_from_json_cpp,                          2},
    {"_stochtree_rfx_group_ids_from_json_string_cpp",                  (DL_FUNC) &_stochtree_rfx_group_ids_from_json_string_cpp,                   2},
    {"_stochtree_rfx_label_mapper_cpp",                                (DL_FUNC) &_stochtree_rfx_label_mapper_cpp,                                 1},
    {"_stochtree_rfx_label_mapper_from_json_cpp",                      (DL_FUNC) &_stochtree_rfx_label_mapper_from_json_cpp,                       2},
    {"_stochtree_rfx_label_mapper_from_json_string_cpp",               (DL_FUNC) &_stochtree_rfx_label_mapper_from_json_string_cpp,                2},
    {"_stochtree_rfx_label_mapper_to_list_cpp",                        (DL_FUNC) &_stochtree_rfx_label_mapper_to_list_cpp,                         1},
    {"_stochtree_rfx_model_cpp",                                       (DL_FUNC) &_stochtree_rfx_model_cpp,                                        2},
    {"_stochtree_rfx_model_predict_cpp",                               (DL_FUNC) &_stochtree_rfx_model_predict_cpp,                                3},
    {"_stochtree_rfx_model_sample_random_effects_cpp",                 (DL_FUNC) &_stochtree_rfx_model_sample_random_effects_cpp,                  8},
    {"_stochtree_rfx_model_set_group_parameter_covariance_cpp",        (DL_FUNC) &_stochtree_rfx_model_set_group_parameter_covariance_cpp,         2},
    {"_stochtree_rfx_model_set_group_parameters_cpp",                  (DL_FUNC) &_stochtree_rfx_model_set_group_parameters_cpp,                   2},
    {"_stochtree_rfx_model_set_variance_prior_scale_cpp",              (DL_FUNC) &_stochtree_rfx_model_set_variance_prior_scale_cpp,               2},
    {"_stochtree_rfx_model_set_variance_prior_shape_cpp",              (DL_FUNC) &_stochtree_rfx_model_set_variance_prior_shape_cpp,               2},
    {"_stochtree_rfx_model_set_working_parameter_covariance_cpp",      (DL_FUNC) &_stochtree_rfx_model_set_working_parameter_covariance_cpp,       2},
    {"_stochtree_rfx_model_set_working_parameter_cpp",                 (DL_FUNC) &_stochtree_rfx_model_set_working_parameter_cpp,                  2},
    {"_stochtree_rfx_tracker_cpp",                                     (DL_FUNC) &_stochtree_rfx_tracker_cpp,                                      1},
    {"_stochtree_rfx_tracker_get_unique_group_ids_cpp",                (DL_FUNC) &_stochtree_rfx_tracker_get_unique_group_ids_cpp,                 1},
    {"_stochtree_right_child_node_forest_container_cpp",               (DL_FUNC) &_stochtree_right_child_node_forest_container_cpp,                4},
    {"_stochtree_rng_cpp",                                             (DL_FUNC) &_stochtree_rng_cpp,                                              1},
    {"_stochtree_root_reset_active_forest_cpp",                        (DL_FUNC) &_stochtree_root_reset_active_forest_cpp,                         1},
    {"_stochtree_root_reset_rfx_tracker_cpp",                          (DL_FUNC) &_stochtree_root_reset_rfx_tracker_cpp,                           4},
    {"_stochtree_sample_gfr_one_iteration_cpp",                        (DL_FUNC) &_stochtree_sample_gfr_one_iteration_cpp,                        19},
    {"_stochtree_sample_mcmc_one_iteration_cpp",                       (DL_FUNC) &_stochtree_sample_mcmc_one_iteration_cpp,                       18},
    {"_stochtree_sample_sigma2_one_iteration_cpp",                     (DL_FUNC) &_stochtree_sample_sigma2_one_iteration_cpp,                      5},
    {"_stochtree_sample_tau_one_iteration_cpp",                        (DL_FUNC) &_stochtree_sample_tau_one_iteration_cpp,                         4},
    {"_stochtree_sample_without_replacement_integer_cpp",              (DL_FUNC) &_stochtree_sample_without_replacement_integer_cpp,               3},
    {"_stochtree_sd_cpp",                                              (DL_FUNC) &_stochtree_sd_cpp,                                               1},
    {"_stochtree_set_leaf_value_active_forest_cpp",                    (DL_FUNC) &_stochtree_set_leaf_value_active_forest_cpp,                     2},
    {"_stochtree_set_leaf_value_forest_container_cpp",                 (DL_FUNC) &_stochtree_set_leaf_value_forest_container_cpp,                  2},
    {"_stochtree_set_leaf_vector_active_forest_cpp",                   (DL_FUNC) &_stochtree_set_leaf_vector_active_forest_cpp,                    2},
    {"_stochtree_set_leaf_vector_forest_container_cpp",                (DL_FUNC) &_stochtree_set_leaf_vector_forest_container_cpp,                 2},
    {"_stochtree_split_categories_forest_container_cpp",               (DL_FUNC) &_stochtree_split_categories_forest_container_cpp,                4},
    {"_stochtree_split_index_forest_container_cpp",                    (DL_FUNC) &_stochtree_split_index_forest_container_cpp,                     4},
    {"_stochtree_split_theshold_forest_container_cpp",                 (DL_FUNC) &_stochtree_split_theshold_forest_container_cpp,                  4},
    {"_stochtree_subtract_from_column_vector_cpp",                     (DL_FUNC) &_stochtree_subtract_from_column_vector_cpp,                      2},
    {"_stochtree_sum_cpp",                                             (DL_FUNC) &_stochtree_sum_cpp,                                              1},
    {"_stochtree_sum_leaves_squared_ensemble_forest_container_cpp",    (DL_FUNC) &_stochtree_sum_leaves_squared_ensemble_forest_container_cpp,     2},
    {"_stochtree_tree_prior_cpp",                                      (DL_FUNC) &_stochtree_tree_prior_cpp,                                       4},
    {"_stochtree_update_alpha_tree_prior_cpp",                         (DL_FUNC) &_stochtree_update_alpha_tree_prior_cpp,                          2},
    {"_stochtree_update_beta_tree_prior_cpp",                          (DL_FUNC) &_stochtree_update_beta_tree_prior_cpp,                           2},
    {"_stochtree_update_max_depth_tree_prior_cpp",                     (DL_FUNC) &_stochtree_update_max_depth_tree_prior_cpp,                      2},
    {"_stochtree_update_min_samples_leaf_tree_prior_cpp",              (DL_FUNC) &_stochtree_update_min_samples_leaf_tree_prior_cpp,               2},
    {"_stochtree_var_cpp",                                             (DL_FUNC) &_stochtree_var_cpp,                                              1},
    {NULL, NULL, 0}
};
}

extern "C" attribute_visible void R_init_stochtree(DllInfo* dll){
  R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
  R_useDynamicSymbols(dll, FALSE);
  R_forceSymbols(dll, TRUE);
}
