From 1878b0e80b28994186bcfa5691a9509a3d00b194 Mon Sep 17 00:00:00 2001 From: chiricom Date: Thu, 13 Aug 2026 22:04:05 +0000 Subject: [PATCH] Initialize values more consistently --- src/forest.cpp | 4 ++-- src/sampler.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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