From 7f42c0114b32cd49787179fc628af206358f0fde Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 28 May 2024 14:44:34 -0400 Subject: [PATCH] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/services/util/initialize.hpp | 5 ++--- src/test/unit/services/instrumented_callbacks.hpp | 6 ++++-- src/test/unit/services/util/fail_init_test.cpp | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/stan/services/util/initialize.hpp b/src/stan/services/util/initialize.hpp index d585f73dac..a6467ae394 100644 --- a/src/stan/services/util/initialize.hpp +++ b/src/stan/services/util/initialize.hpp @@ -228,8 +228,8 @@ std::vector initialize(Model& model, const InitContext& init, RNG& rng, std::stringstream msg; msg << "Partial user-specified initialization failed. " "Initialization of non user specified parameters " - "between (-" << init_radius << ", " << init_radius - << ") failed after" + "between (-" + << init_radius << ", " << init_radius << ") failed after" << " " << MAX_INIT_TRIES << " attempts. "; logger.error(msg); logger.error( @@ -255,7 +255,6 @@ std::vector initialize(Model& model, const InitContext& init, RNG& rng, " Try specifying initial values," " reducing ranges of constrained values," " or reparameterizing the model."); - } throw std::domain_error("Initialization failed."); } diff --git a/src/test/unit/services/instrumented_callbacks.hpp b/src/test/unit/services/instrumented_callbacks.hpp index 9ed91a4c67..6b10126b1e 100644 --- a/src/test/unit/services/instrumented_callbacks.hpp +++ b/src/test/unit/services/instrumented_callbacks.hpp @@ -281,10 +281,12 @@ class instrumented_logger : public stan::callbacks::logger { count++; return count; } -public: + + public: std::vector return_all_logs() { std::vector all_logs; - all_logs.reserve(debug_.size() + info_.size() + warn_.size() + error_.size() + fatal_.size() + 5); + all_logs.reserve(debug_.size() + info_.size() + warn_.size() + error_.size() + + fatal_.size() + 5); all_logs.emplace_back("DEBUG"); all_logs.insert(all_logs.end(), debug_.begin(), debug_.end()); all_logs.emplace_back("INFO"); diff --git a/src/test/unit/services/util/fail_init_test.cpp b/src/test/unit/services/util/fail_init_test.cpp index 1e0a0f8e29..a840bceae7 100644 --- a/src/test/unit/services/util/fail_init_test.cpp +++ b/src/test/unit/services/util/fail_init_test.cpp @@ -43,8 +43,8 @@ TEST_F(ServicesUtilInitialize, model_throws__full_init) { double init_radius = 2; bool print_timing = false; EXPECT_THROW( - stan::services::util::initialize(model, init_context, rng, - init_radius, print_timing, logger, init), + stan::services::util::initialize(model, init_context, rng, init_radius, + print_timing, logger, init), std::domain_error); auto blah = logger.return_all_logs(); for (auto&& m : blah) {