From c184c9e3cc06bb4ab0f6fb791bac78a05baa2bf4 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 7 Oct 2024 13:43:16 -0400 Subject: [PATCH] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/mcmc/chains.hpp | 2 +- .../mcmc/compute_potential_scale_reduction_test.cpp | 1 - .../unit/analyze/mcmc/split_rank_normalized_ess_test.cpp | 4 +--- .../unit/analyze/mcmc/split_rank_normalized_rhat_test.cpp | 8 +++++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 1cb7ed66fe..fdccc53cf5 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -625,7 +625,7 @@ class chains { Eigen::MatrixXd chains(n_kept_samples, n_chains); for (size_t i = 0; i < n_chains; ++i) { auto bottom_rows = samples_(i).col(index).bottomRows(n_kept_samples); - chains.col(i) = bottom_rows.eval(); + chains.col(i) = bottom_rows.eval(); } return analyze::split_rank_normalized_rhat(chains); } diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 47f31fc856..65d5c15a81 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -224,7 +224,6 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_constant) { << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } - TEST_F(ComputeRhat, compute_potential_scale_reduction_nan) { std::vector param_names{"a"}; stan::mcmc::chains<> chains(param_names); diff --git a/src/test/unit/analyze/mcmc/split_rank_normalized_ess_test.cpp b/src/test/unit/analyze/mcmc/split_rank_normalized_ess_test.cpp index 475ac522df..654a2fd168 100644 --- a/src/test/unit/analyze/mcmc/split_rank_normalized_ess_test.cpp +++ b/src/test/unit/analyze/mcmc/split_rank_normalized_ess_test.cpp @@ -23,14 +23,13 @@ TEST(RankNormalizedEss, compute_split_rank_normalized_ess) { eight_schools_2 = stan::io::stan_csv_reader::parse(eight_schools_2_stream, &out); eight_schools_2_stream.close(); - + // test against R implementation in pkg posterior (via cmdstanr) Eigen::VectorXd ess_8_schools_bulk(10); ess_8_schools_bulk << 348, 370, 600, 638, 765, 608, 629, 274, 517, 112; Eigen::VectorXd ess_8_schools_tail(10); ess_8_schools_tail << 845, 858, 874, 726, 620, 753, 826, 628, 587, 108; - Eigen::MatrixXd chains(eight_schools_1.samples.rows(), 2); for (size_t i = 0; i < 10; ++i) { chains.col(0) = eight_schools_1.samples.col(i + 7); @@ -57,7 +56,6 @@ TEST(RankNormalizedEss, short_chains_fail) { eight_schools_5iters_2 = stan::io::stan_csv_reader::parse(eight_schools_5iters_2_stream, &out); eight_schools_5iters_2_stream.close(); - Eigen::MatrixXd chains(eight_schools_5iters_1.samples.rows(), 2); for (size_t i = 0; i < 10; ++i) { diff --git a/src/test/unit/analyze/mcmc/split_rank_normalized_rhat_test.cpp b/src/test/unit/analyze/mcmc/split_rank_normalized_rhat_test.cpp index db967a87bc..f0a46f2530 100644 --- a/src/test/unit/analyze/mcmc/split_rank_normalized_rhat_test.cpp +++ b/src/test/unit/analyze/mcmc/split_rank_normalized_rhat_test.cpp @@ -53,10 +53,12 @@ TEST(RankNormalizedRhat, const_fail) { bernoulli_const_2 = stan::io::stan_csv_reader::parse(bernoulli_const_2_stream, &out); bernoulli_const_2_stream.close(); - + Eigen::MatrixXd chains(bernoulli_const_1.samples.rows(), 2); - chains.col(0) = bernoulli_const_1.samples.col(bernoulli_const_1.samples.cols() - 1); - chains.col(1) = bernoulli_const_2.samples.col(bernoulli_const_2.samples.cols() - 1); + chains.col(0) + = bernoulli_const_1.samples.col(bernoulli_const_1.samples.cols() - 1); + chains.col(1) + = bernoulli_const_2.samples.col(bernoulli_const_2.samples.cols() - 1); auto rhat = stan::analyze::split_rank_normalized_rhat(chains); EXPECT_TRUE(std::isnan(rhat.first)); EXPECT_TRUE(std::isnan(rhat.second));