diff --git a/src/forest.cpp b/src/forest.cpp index 77c615348..e19fb1e15 100644 --- a/src/forest.cpp +++ b/src/forest.cpp @@ -496,7 +496,7 @@ void initialize_forest_model_cpp(cpp11::external_pointerNumTrees(); - double init_val; + double init_val = 0.0; std::vector init_value_vector; if ((model_type == StochTree::ModelType::kConstantLeafGaussian) || (model_type == StochTree::ModelType::kUnivariateRegressionLeafGaussian) || @@ -812,7 +812,7 @@ void initialize_forest_model_active_forest_cpp(cpp11::external_pointerNumTrees(); - double init_val; + double init_val = 0.0; std::vector init_value_vector; if ((model_type == StochTree::ModelType::kConstantLeafGaussian) || (model_type == StochTree::ModelType::kUnivariateRegressionLeafGaussian) || diff --git a/src/sampler.cpp b/src/sampler.cpp index f356d968a..90a957a38 100644 --- a/src/sampler.cpp +++ b/src/sampler.cpp @@ -56,7 +56,7 @@ void sample_gfr_one_iteration_cpp(cpp11::external_pointer