@@ -516,6 +516,34 @@ extern "C" SEXP _stochtree_root_reset_rfx_tracker_cpp(SEXP tracker, SEXP dataset
516516 return R_NilValue;
517517 END_CPP11
518518}
519+ // R_utils.cpp
520+ double sum_cpp (cpp11::doubles x);
521+ extern " C" SEXP _stochtree_sum_cpp (SEXP x) {
522+ BEGIN_CPP11
523+ return cpp11::as_sexp (sum_cpp (cpp11::as_cpp<cpp11::decay_t <cpp11::doubles>>(x)));
524+ END_CPP11
525+ }
526+ // R_utils.cpp
527+ double mean_cpp (cpp11::doubles x);
528+ extern " C" SEXP _stochtree_mean_cpp (SEXP x) {
529+ BEGIN_CPP11
530+ return cpp11::as_sexp (mean_cpp (cpp11::as_cpp<cpp11::decay_t <cpp11::doubles>>(x)));
531+ END_CPP11
532+ }
533+ // R_utils.cpp
534+ double var_cpp (cpp11::doubles x);
535+ extern " C" SEXP _stochtree_var_cpp (SEXP x) {
536+ BEGIN_CPP11
537+ return cpp11::as_sexp (var_cpp (cpp11::as_cpp<cpp11::decay_t <cpp11::doubles>>(x)));
538+ END_CPP11
539+ }
540+ // R_utils.cpp
541+ double sd_cpp (cpp11::doubles x);
542+ extern " C" SEXP _stochtree_sd_cpp (SEXP x) {
543+ BEGIN_CPP11
544+ return cpp11::as_sexp (sd_cpp (cpp11::as_cpp<cpp11::decay_t <cpp11::doubles>>(x)));
545+ END_CPP11
546+ }
519547// forest.cpp
520548cpp11::external_pointer<StochTree::TreeEnsemble> active_forest_cpp (int num_trees, int output_dimension, bool is_leaf_constant, bool is_exponentiated);
521549extern " C" SEXP _stochtree_active_forest_cpp (SEXP num_trees, SEXP output_dimension, SEXP is_leaf_constant, SEXP is_exponentiated) {
@@ -1700,6 +1728,7 @@ static const R_CallMethodDef CallEntries[] = {
17001728 {" _stochtree_leaf_values_forest_container_cpp" , (DL_FUNC) &_stochtree_leaf_values_forest_container_cpp, 4 },
17011729 {" _stochtree_leaves_forest_container_cpp" , (DL_FUNC) &_stochtree_leaves_forest_container_cpp, 3 },
17021730 {" _stochtree_left_child_node_forest_container_cpp" , (DL_FUNC) &_stochtree_left_child_node_forest_container_cpp, 4 },
1731+ {" _stochtree_mean_cpp" , (DL_FUNC) &_stochtree_mean_cpp, 1 },
17031732 {" _stochtree_multiply_forest_forest_container_cpp" , (DL_FUNC) &_stochtree_multiply_forest_forest_container_cpp, 3 },
17041733 {" _stochtree_node_depth_forest_container_cpp" , (DL_FUNC) &_stochtree_node_depth_forest_container_cpp, 4 },
17051734 {" _stochtree_nodes_forest_container_cpp" , (DL_FUNC) &_stochtree_nodes_forest_container_cpp, 3 },
@@ -1781,6 +1810,7 @@ static const R_CallMethodDef CallEntries[] = {
17811810 {" _stochtree_sample_sigma2_one_iteration_cpp" , (DL_FUNC) &_stochtree_sample_sigma2_one_iteration_cpp, 5 },
17821811 {" _stochtree_sample_tau_one_iteration_cpp" , (DL_FUNC) &_stochtree_sample_tau_one_iteration_cpp, 4 },
17831812 {" _stochtree_sample_without_replacement_integer_cpp" , (DL_FUNC) &_stochtree_sample_without_replacement_integer_cpp, 3 },
1813+ {" _stochtree_sd_cpp" , (DL_FUNC) &_stochtree_sd_cpp, 1 },
17841814 {" _stochtree_set_leaf_value_active_forest_cpp" , (DL_FUNC) &_stochtree_set_leaf_value_active_forest_cpp, 2 },
17851815 {" _stochtree_set_leaf_value_forest_container_cpp" , (DL_FUNC) &_stochtree_set_leaf_value_forest_container_cpp, 2 },
17861816 {" _stochtree_set_leaf_vector_active_forest_cpp" , (DL_FUNC) &_stochtree_set_leaf_vector_active_forest_cpp, 2 },
@@ -1789,12 +1819,14 @@ static const R_CallMethodDef CallEntries[] = {
17891819 {" _stochtree_split_index_forest_container_cpp" , (DL_FUNC) &_stochtree_split_index_forest_container_cpp, 4 },
17901820 {" _stochtree_split_theshold_forest_container_cpp" , (DL_FUNC) &_stochtree_split_theshold_forest_container_cpp, 4 },
17911821 {" _stochtree_subtract_from_column_vector_cpp" , (DL_FUNC) &_stochtree_subtract_from_column_vector_cpp, 2 },
1822+ {" _stochtree_sum_cpp" , (DL_FUNC) &_stochtree_sum_cpp, 1 },
17921823 {" _stochtree_sum_leaves_squared_ensemble_forest_container_cpp" , (DL_FUNC) &_stochtree_sum_leaves_squared_ensemble_forest_container_cpp, 2 },
17931824 {" _stochtree_tree_prior_cpp" , (DL_FUNC) &_stochtree_tree_prior_cpp, 4 },
17941825 {" _stochtree_update_alpha_tree_prior_cpp" , (DL_FUNC) &_stochtree_update_alpha_tree_prior_cpp, 2 },
17951826 {" _stochtree_update_beta_tree_prior_cpp" , (DL_FUNC) &_stochtree_update_beta_tree_prior_cpp, 2 },
17961827 {" _stochtree_update_max_depth_tree_prior_cpp" , (DL_FUNC) &_stochtree_update_max_depth_tree_prior_cpp, 2 },
17971828 {" _stochtree_update_min_samples_leaf_tree_prior_cpp" , (DL_FUNC) &_stochtree_update_min_samples_leaf_tree_prior_cpp, 2 },
1829+ {" _stochtree_var_cpp" , (DL_FUNC) &_stochtree_var_cpp, 1 },
17981830 {NULL , NULL , 0 }
17991831};
18001832}
0 commit comments