From 098c65582115c5c42b62eb5aa2c7ac675863645e Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 4 Feb 2025 17:22:36 -0500 Subject: [PATCH] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/callbacks/stream_writer.hpp | 13 ++++++------- src/stan/callbacks/unique_stream_writer.hpp | 17 ++++++++--------- src/stan/callbacks/writer.hpp | 9 +++------ .../services/pathfinder/eight_schools_test.cpp | 13 ++++++++----- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/stan/callbacks/stream_writer.hpp b/src/stan/callbacks/stream_writer.hpp index 980f21cf7f..2df599b9d1 100644 --- a/src/stan/callbacks/stream_writer.hpp +++ b/src/stan/callbacks/stream_writer.hpp @@ -68,7 +68,7 @@ class stream_writer : public writer { output_ << comment_prefix_ << message << std::endl; } - /** + /** * Writes multiple rows and columns of values in csv format. * * Note: the precision of the output is determined by the settings @@ -90,8 +90,8 @@ class stream_writer : public writer { * @param[in] values A column vector of values. */ virtual void operator()(const Eigen::Matrix& values) { - output_ << values.transpose().format(CommaInitFmt); - } + output_ << values.transpose().format(CommaInitFmt); + } /** * Write a row of values in csv format @@ -102,9 +102,8 @@ class stream_writer : public writer { * @param[in] values A row vector of values. */ virtual void operator()(const Eigen::Matrix& values) { - output_ << values.format(CommaInitFmt); - } - + output_ << values.format(CommaInitFmt); + } /** * Checks if stream is valid. @@ -112,7 +111,7 @@ class stream_writer : public writer { virtual bool is_valid() const noexcept { return output_.good(); } private: - /** + /** * Comma formatter for writing Eigen matrices */ Eigen::IOFormat CommaInitFmt{ diff --git a/src/stan/callbacks/unique_stream_writer.hpp b/src/stan/callbacks/unique_stream_writer.hpp index f149f516cb..f55f93281e 100644 --- a/src/stan/callbacks/unique_stream_writer.hpp +++ b/src/stan/callbacks/unique_stream_writer.hpp @@ -103,11 +103,11 @@ class unique_stream_writer final : public writer { * @param[in] values A column vector of values. */ virtual void operator()(const Eigen::Matrix& values) { - if (output_ == nullptr) { - return; - } - *output_ << values.transpose().format(CommaInitFmt); + if (output_ == nullptr) { + return; } + *output_ << values.transpose().format(CommaInitFmt); + } /** * Write a row of values in csv format @@ -118,12 +118,11 @@ class unique_stream_writer final : public writer { * @param[in] values A row vector of values. */ virtual void operator()(const Eigen::Matrix& values) { - if (output_ == nullptr) { - return; - } - *output_ << values.format(CommaInitFmt); + if (output_ == nullptr) { + return; } - + *output_ << values.format(CommaInitFmt); + } /** * Writes the comment_prefix to the stream followed by a newline. diff --git a/src/stan/callbacks/writer.hpp b/src/stan/callbacks/writer.hpp index 85ccc08d02..85bba45045 100644 --- a/src/stan/callbacks/writer.hpp +++ b/src/stan/callbacks/writer.hpp @@ -61,8 +61,7 @@ class writer { * parameters in the rows and samples in the columns. The matrix is then * transposed for the output. */ - virtual void operator()( - const Eigen::Matrix& values) {} + virtual void operator()(const Eigen::Matrix& values) {} /** * Write a row of values in csv format. * @@ -71,8 +70,7 @@ class writer { * * @param[in] values A column vector of values. */ - virtual void operator()( - const Eigen::Matrix& values) {} + virtual void operator()(const Eigen::Matrix& values) {} /** * Write a row of values in csv format @@ -82,8 +80,7 @@ class writer { * * @param[in] values A row vector of values. */ - virtual void operator()( - const Eigen::Matrix& values) {} + virtual void operator()(const Eigen::Matrix& values) {} }; } // namespace callbacks diff --git a/src/test/unit/services/pathfinder/eight_schools_test.cpp b/src/test/unit/services/pathfinder/eight_schools_test.cpp index a729fb57dc..982f88acc9 100644 --- a/src/test/unit/services/pathfinder/eight_schools_test.cpp +++ b/src/test/unit/services/pathfinder/eight_schools_test.cpp @@ -168,11 +168,14 @@ TEST_F(ServicesPathfinderEightSchools, multi_output) { constexpr bool resample = true; std::unique_ptr empty_ostream(nullptr); stan::test::test_logger logger(std::move(empty_ostream)); - using unique_string_writer = stan::callbacks::unique_stream_writer; + using unique_string_writer + = stan::callbacks::unique_stream_writer; std::vector single_path_parameter_writer; - unique_string_writer parameter_writer{std::make_unique(), "# "}; + unique_string_writer parameter_writer{std::make_unique(), + "# "}; for (int i = 0; i < num_paths; ++i) { - single_path_parameter_writer.emplace_back(std::make_unique(), "# "); + single_path_parameter_writer.emplace_back( + std::make_unique(), "# "); } std::vector> single_path_diagnostic_writer(num_paths); @@ -188,8 +191,8 @@ TEST_F(ServicesPathfinderEightSchools, multi_output) { num_iterations, num_elbo_draws, num_draws, num_multi_draws, num_paths, save_iterations, refresh, callback, logger, std::vector(num_paths, init), - single_path_parameter_writer, single_path_diagnostic_writer, parameter_writer, - diagnostics, calculate_lp, resample); + single_path_parameter_writer, single_path_diagnostic_writer, + parameter_writer, diagnostics, calculate_lp, resample); auto str = parameter_writer.get_stream().str(); {