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 26, 2024
1 parent ed7f0a0 commit bd8941e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
14 changes: 7 additions & 7 deletions src/stan/io/stan_csv_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ class stan_csv_reader {
if (cols == -1) {
cols = current_cols;
} else if (cols != current_cols) {
std::stringstream msg;
msg << "Error: expected " << cols << " columns, but found "
<< current_cols << " instead for row " << rows + 1;
throw std::invalid_argument(msg.str());
std::stringstream msg;
msg << "Error: expected " << cols << " columns, but found "
<< current_cols << " instead for row " << rows + 1;
throw std::invalid_argument(msg.str());
}
rows++;
}
Expand Down Expand Up @@ -397,9 +397,9 @@ class stan_csv_reader {
int expected_samples = data.metadata.num_samples / data.metadata.thin;
if (expected_samples != data.samples.rows()) {
std::stringstream msg;
msg << "Error reading samples, expecting " << expected_samples << " samples, found "
<< data.samples.rows();
throw std::invalid_argument(msg.str());
msg << "Error reading samples, expecting " << expected_samples
<< " samples, found " << data.samples.rows();
throw std::invalid_argument(msg.str());
}
}
return data;
Expand Down
6 changes: 3 additions & 3 deletions src/stan/mcmc/chainset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using Eigen::Dynamic;
* Checks that a Stan CSV file contains both a header row
* and a set of draws from the posterior.
* Throws exception if either are missing.
*
*
* @param stan_csv parsed csv file object
*/
void validate_sample(const stan::io::stan_csv& stan_csv) {
Expand All @@ -46,7 +46,7 @@ void validate_sample(const stan::io::stan_csv& stan_csv) {

/**
* Reports the expected number of post-warmup draws in the CSV output file.
*
*
* @param stan_csv parsed csv file object
* @return expected number of draws
*/
Expand All @@ -64,7 +64,7 @@ size_t thinned_samples(const stan::io::stan_csv& stan_csv) {
*
* @note samples are stored in column major, i.e., each column corresponds to
* an output variable (element).
*
*
*/
class chainset {
private:
Expand Down
6 changes: 3 additions & 3 deletions src/test/unit/io/stan_csv_reader_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class StanIoStanCsvReader : public testing::Test {
bernoulli_thin_stream.open(
"src/test/unit/io/test_csv_files/bernoulli_thin.csv");
bernoulli_trunc_stream.open(
"src/test/unit/io/test_csv_files/bernoulli_corrupt.csv");
"src/test/unit/io/test_csv_files/bernoulli_corrupt.csv");
bernoulli_warmup_stream.open(
"src/test/unit/io/test_csv_files/bernoulli_warmup.csv");
missing_draws_stream.open(
Expand Down Expand Up @@ -571,10 +571,10 @@ TEST_F(StanIoStanCsvReader, missing_data) {
stan::io::stan_csv missing_draws;
std::stringstream out;
EXPECT_THROW(stan::io::stan_csv_reader::parse(missing_draws_stream, &out),
std::invalid_argument);
std::invalid_argument);
stan::io::stan_csv bernoulli_trunc;
EXPECT_THROW(stan::io::stan_csv_reader::parse(bernoulli_trunc_stream, &out),
std::invalid_argument);
std::invalid_argument);
}

TEST_F(StanIoStanCsvReader, thinned_data) {
Expand Down
24 changes: 12 additions & 12 deletions src/test/unit/mcmc/chainset_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class McmcChains : public testing::Test {
"src/test/unit/mcmc/test_csv_files/eight_schools_5iters_2.csv",
std::ifstream::in);

if (!bernoulli_500_stream
|| !bernoulli_default_stream || !bernoulli_thin_stream
|| !bernoulli_warmup_stream || !bernoulli_zeta_stream
|| !eight_schools_1_stream || !eight_schools_2_stream
|| !eight_schools_5iters_1_stream || !eight_schools_5iters_2_stream) {
if (!bernoulli_500_stream || !bernoulli_default_stream
|| !bernoulli_thin_stream || !bernoulli_warmup_stream
|| !bernoulli_zeta_stream || !eight_schools_1_stream
|| !eight_schools_2_stream || !eight_schools_5iters_1_stream
|| !eight_schools_5iters_2_stream) {
FAIL() << "Failed to open one or more test files";
}
bernoulli_500_stream.seekg(0, std::ios::beg);
Expand Down Expand Up @@ -91,14 +91,14 @@ class McmcChains : public testing::Test {

std::stringstream out;

std::ifstream bernoulli_500_stream,
bernoulli_default_stream, bernoulli_thin_stream, bernoulli_warmup_stream,
bernoulli_zeta_stream, eight_schools_1_stream, eight_schools_2_stream,
eight_schools_5iters_1_stream, eight_schools_5iters_2_stream;
std::ifstream bernoulli_500_stream, bernoulli_default_stream,
bernoulli_thin_stream, bernoulli_warmup_stream, bernoulli_zeta_stream,
eight_schools_1_stream, eight_schools_2_stream,
eight_schools_5iters_1_stream, eight_schools_5iters_2_stream;

stan::io::stan_csv bernoulli_500, bernoulli_default,
bernoulli_thin, bernoulli_warmup, bernoulli_zeta, eight_schools_1,
eight_schools_2, eight_schools_5iters_1, eight_schools_5iters_2;
stan::io::stan_csv bernoulli_500, bernoulli_default, bernoulli_thin,
bernoulli_warmup, bernoulli_zeta, eight_schools_1, eight_schools_2,
eight_schools_5iters_1, eight_schools_5iters_2;
};

TEST_F(McmcChains, constructor) {
Expand Down

0 comments on commit bd8941e

Please sign in to comment.