Skip to content

Commit

Permalink
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-buildbot committed Sep 27, 2024
1 parent 324a617 commit d0222b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/stan/io/stan_csv_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class stan_csv_reader {
*
* Throws exception if contents can't be parsed into header + data rows.
*
* Emits warning message
* Emits warning message
*
* @param[in] in input stream to parse
* @param[out] out output stream to send messages
Expand Down
23 changes: 12 additions & 11 deletions src/stan/mcmc/chainset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace stan {
namespace mcmc {
using Eigen::Dynamic;

/**
* An <code>mcmc::chainset</code> object manages the post-warmup draws
* across a set of MCMC chains, which all have the same number of samples.
Expand Down Expand Up @@ -77,19 +77,19 @@ class chainset {
std::stringstream ss;
for (size_t i = 1; i < stan_csv.size(); ++i) {
if (stan_csv[i].header.size() != param_names_.size()) {
ss << "Error: chain " << (i + 1) << " missing or extra columns.";
ss << "Error: chain " << (i + 1) << " missing or extra columns.";
throw std::invalid_argument(ss.str());
}
for (int j = 0; j < param_names_.size(); j++) {
if (param_names_[j] != stan_csv[i].header[j]) {
ss << "Error: chain " << (i + 1) << " header column " << (j + 1)
<< " doesn't match chain 1 header, found: " << stan_csv[i].header[j]
<< " expecting: " << param_names_[j];
throw std::invalid_argument(ss.str());
}
if (param_names_[j] != stan_csv[i].header[j]) {
ss << "Error: chain " << (i + 1) << " header column " << (j + 1)
<< " doesn't match chain 1 header, found: "
<< stan_csv[i].header[j] << " expecting: " << param_names_[j];
throw std::invalid_argument(ss.str());
}
}
if (stan_csv[i].samples.rows() != num_samples_) {
ss << "Error: chain " << (i + 1) << ", missing or extra rows.";
ss << "Error: chain " << (i + 1) << ", missing or extra rows.";
throw std::invalid_argument(ss.str());
}
chains_.push_back(stan_csv[i].samples);
Expand Down Expand Up @@ -361,7 +361,7 @@ class chainset {
}
return quantiles;
}

/**
* Compute the quantile values of the specified parameter
* for a set of specified probabilities.
Expand Down Expand Up @@ -469,7 +469,8 @@ class chainset {
double ess_s2 = analyze::split_rank_normalized_ess(s2).first;
double ess_sd = std::min(ess_s, ess_s2);
return sd(index)
* std::sqrt(stan::math::e() * std::pow(1 - 1 / ess_sd, ess_sd - 1) - 1);
* std::sqrt(stan::math::e() * std::pow(1 - 1 / ess_sd, ess_sd - 1)
- 1);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/test/unit/io/stan_csv_reader_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ TEST_F(StanIoStanCsvReader, read_header_tuples) {

TEST_F(StanIoStanCsvReader, read_adaptation1) {
stan::io::stan_csv_adaptation adaptation;
stan::io::stan_csv_reader::read_adaptation(adaptation1_stream,
adaptation);
stan::io::stan_csv_reader::read_adaptation(adaptation1_stream, adaptation);

EXPECT_FLOAT_EQ(0.118745, adaptation.step_size);
ASSERT_EQ(47, adaptation.metric.size());
Expand Down Expand Up @@ -556,7 +555,6 @@ TEST_F(StanIoStanCsvReader, skip_warmup) {
ASSERT_NE(0, bernoulli_warmup.adaptation.step_size);
}


TEST_F(StanIoStanCsvReader, thinned_data) {
stan::io::stan_csv bernoulli_thin;
std::stringstream out;
Expand Down

0 comments on commit d0222b0

Please sign in to comment.