Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Licensing
---------
The Stan math library, core Stan code, and CmdStan are licensed under new BSD. RStan and PyStan are licensed under GPLv3, with other interfaces having other open-source licenses.

Note that the Stan math library depends on the Intel TBB library which is licensed under the Apache 2.0 license. This dependency implies an additional restriction as compared to the new BSD lincense alone. The Apache 2.0 license is incompatible with GPL-2 licensed code if distributed as a unitary binary. You may refer to the Licensing page on the [Stan wiki](https://github.com/stan-dev/stan/wiki/Stan-Licensing).
Note that the Stan math library depends on the Intel TBB library which is licensed under the Apache 2.0 license. This dependency implies an additional restriction as compared to the new BSD license alone. The Apache 2.0 license is incompatible with GPL-2 licensed code if distributed as a unitary binary. You may refer to the Licensing page on the [Stan wiki](https://github.com/stan-dev/stan/wiki/Stan-Licensing).
8 changes: 4 additions & 4 deletions src/stan/mcmc/chainset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class chainset {

public:
/* Construct a chainset from a single sample.
* Throws execption if sample is empty.
* Throws exception if sample is empty.
*/
explicit chainset(const stan::io::stan_csv& stan_csv) {
if (chains_.size() > 0) {
Expand All @@ -53,7 +53,7 @@ class chainset {
}

/* Construct a chainset from a set of samples.
* Throws execption if sample column names and shapes don't match.
* Throws exception if sample column names and shapes don't match.
*/
explicit chainset(const std::vector<stan::io::stan_csv>& stan_csv) {
if (stan_csv.empty())
Expand Down Expand Up @@ -472,7 +472,7 @@ class chainset {
/**
* Compute autocorrelation for one column of one chain.
* Throws exception if column index is out of bounds.
* Autocorrelation is computed using Stan math library implmentation.
* Autocorrelation is computed using Stan math library implementation.
*
* @param chain chain index
* @param index column index
Expand All @@ -490,7 +490,7 @@ class chainset {
/**
* Compute autocorrelation for one column of one chain.
* Throws exception if column index is out of bounds.
* Autocorrelation is computed using Stan math library implmentation.
* Autocorrelation is computed using Stan math library implementation.
*
* @param chain chain index
* @param name column name
Expand Down
40 changes: 20 additions & 20 deletions src/test/unit/io/deserializer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ TEST(deserializer_vector, complex_read) {
EXPECT_EQ(4, y.rows());
EXPECT_EQ(1, y.cols());
EXPECT_EQ(4, y.size());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y[i].real());
++sentinal;
EXPECT_FLOAT_EQ(sentinal, y[i].imag());
++sentinal;
EXPECT_FLOAT_EQ(sentinel, y[i].real());
++sentinel;
EXPECT_FLOAT_EQ(sentinel, y[i].imag());
++sentinel;
}

double z = deserializer.read<double>();
Expand Down Expand Up @@ -144,12 +144,12 @@ TEST(deserializer_row_vector, complex_read) {
EXPECT_EQ(1, y.rows());
EXPECT_EQ(4, y.cols());
EXPECT_EQ(4, y.size());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y[i].real());
++sentinal;
EXPECT_FLOAT_EQ(sentinal, y[i].imag());
++sentinal;
EXPECT_FLOAT_EQ(sentinel, y[i].real());
++sentinel;
EXPECT_FLOAT_EQ(sentinel, y[i].imag());
++sentinel;
}

double z = deserializer.read<double>();
Expand Down Expand Up @@ -198,12 +198,12 @@ TEST(deserializer_matrix, complex_read) {
eig_mat y = deserializer.read<eig_mat>(3, 2);
EXPECT_EQ(3, y.rows());
EXPECT_EQ(2, y.cols());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y(i).real());
sentinal++;
EXPECT_FLOAT_EQ(sentinal, y(i).imag());
sentinal++;
EXPECT_FLOAT_EQ(sentinel, y(i).real());
sentinel++;
EXPECT_FLOAT_EQ(sentinel, y(i).imag());
sentinel++;
}
}

Expand Down Expand Up @@ -243,12 +243,12 @@ TEST(deserializer_array, complex_read) {
using complex_array = std::vector<std::complex<double>>;
complex_array y = deserializer.read<complex_array>(4);
EXPECT_EQ(4, y.size());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y[i].real());
++sentinal;
EXPECT_FLOAT_EQ(sentinal, y[i].imag());
++sentinal;
EXPECT_FLOAT_EQ(sentinel, y[i].real());
++sentinel;
EXPECT_FLOAT_EQ(sentinel, y[i].imag());
++sentinel;
}

double z = deserializer.read<double>();
Expand Down
40 changes: 20 additions & 20 deletions src/test/unit/io/deserializer_var_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ TEST(deserializer_vector, complex_read) {
EXPECT_EQ(4, y.rows());
EXPECT_EQ(1, y.cols());
EXPECT_EQ(4, y.size());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y[i].real().val());
++sentinal;
EXPECT_FLOAT_EQ(sentinal, y[i].imag().val());
++sentinal;
EXPECT_FLOAT_EQ(sentinel, y[i].real().val());
++sentinel;
EXPECT_FLOAT_EQ(sentinel, y[i].imag().val());
++sentinel;
}

stan::math::var z = deserializer.read<stan::math::var>();
Expand Down Expand Up @@ -147,12 +147,12 @@ TEST(deserializer_row_vector, complex_read) {
EXPECT_EQ(1, y.rows());
EXPECT_EQ(4, y.cols());
EXPECT_EQ(4, y.size());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y[i].real().val());
++sentinal;
EXPECT_FLOAT_EQ(sentinal, y[i].imag().val());
++sentinal;
EXPECT_FLOAT_EQ(sentinel, y[i].real().val());
++sentinel;
EXPECT_FLOAT_EQ(sentinel, y[i].imag().val());
++sentinel;
}

stan::math::var z = deserializer.read<stan::math::var>();
Expand Down Expand Up @@ -202,12 +202,12 @@ TEST(deserializer_matrix, complex_read) {
eig_mat y = deserializer.read<eig_mat>(3, 2);
EXPECT_EQ(3, y.rows());
EXPECT_EQ(2, y.cols());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y(i).real().val());
sentinal++;
EXPECT_FLOAT_EQ(sentinal, y(i).imag().val());
sentinal++;
EXPECT_FLOAT_EQ(sentinel, y(i).real().val());
sentinel++;
EXPECT_FLOAT_EQ(sentinel, y(i).imag().val());
sentinel++;
}
}

Expand Down Expand Up @@ -248,12 +248,12 @@ TEST(deserializer_array, complex_read) {
using complex_array = std::vector<std::complex<stan::math::var>>;
complex_array y = deserializer.read<complex_array>(4);
EXPECT_EQ(4, y.size());
double sentinal = 7;
double sentinel = 7;
for (int i = 0; i < y.size(); ++i) {
EXPECT_FLOAT_EQ(sentinal, y[i].real().val());
++sentinal;
EXPECT_FLOAT_EQ(sentinal, y[i].imag().val());
++sentinal;
EXPECT_FLOAT_EQ(sentinel, y[i].real().val());
++sentinel;
EXPECT_FLOAT_EQ(sentinel, y[i].imag().val());
++sentinel;
}

stan::math::var z = deserializer.read<stan::math::var>();
Expand Down
72 changes: 36 additions & 36 deletions src/test/unit/io/serializer_stdvector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ TEST(serializer_stdvec_vector, write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
int sentinal = 0;
int sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 10U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j]);
++sentinal;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j]);
++sentinel;
}
}
}
Expand All @@ -41,14 +41,14 @@ TEST(serializer_stdvec_vector, complex_write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 10U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j].real())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i][j].imag())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
sentinal += 2;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j].real())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i][j].imag())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
sentinel += 2;
}
}
}
Expand All @@ -66,11 +66,11 @@ TEST(serializer_stdvec_rowvector, write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
int sentinal = 0;
int sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 10U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j]);
++sentinal;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j]);
++sentinel;
}
}
}
Expand All @@ -90,14 +90,14 @@ TEST(serializer_stdvec_rowvector, complex_write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 10U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j].real())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i][j].imag())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
sentinal += 2;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j].real())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i][j].imag())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
sentinel += 2;
}
}
}
Expand All @@ -116,11 +116,11 @@ TEST(serializer_stdvec_matrix, write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
int sentinal = 0;
int sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 16U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i](j));
++sentinal;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i](j));
++sentinel;
}
}
}
Expand All @@ -140,14 +140,14 @@ TEST(serializer_stdvec_matrix, complex_write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 16U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i](j).real())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i](j).imag())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
sentinal += 2;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i](j).real())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i](j).imag())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
sentinel += 2;
}
}
}
Expand All @@ -164,11 +164,11 @@ TEST(serializer_stdvec_stdvector, write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
int sentinal = 0;
int sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 10U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j]);
++sentinal;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j]);
++sentinel;
}
}
}
Expand All @@ -187,14 +187,14 @@ TEST(serializer_stdvec_stdvector, complex_write) {
}
stan::io::serializer<double> serializer(theta);
serializer.write(x_stdvec);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 2U; ++i) {
for (size_t j = 0; j < 10U; ++j) {
EXPECT_FLOAT_EQ(theta[sentinal], x_stdvec[i][j].real())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinal + 1], x_stdvec[i][j].imag())
<< "For idx: " << sentinal << " i: " << i << "j: " << j << "\n";
sentinal += 2;
EXPECT_FLOAT_EQ(theta[sentinel], x_stdvec[i][j].real())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
EXPECT_FLOAT_EQ(theta[sentinel + 1], x_stdvec[i][j].imag())
<< "For idx: " << sentinel << " i: " << i << "j: " << j << "\n";
sentinel += 2;
}
}
}
32 changes: 16 additions & 16 deletions src/test/unit/io/serializer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ TEST(serializer_vector, complex_write) {

stan::io::serializer<double> serializer(theta);
serializer.write(x);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 20U; i += 2) {
EXPECT_FLOAT_EQ(theta[i], x[sentinal].real());
EXPECT_FLOAT_EQ(theta[i + 1], x[sentinal].imag());
++sentinal;
EXPECT_FLOAT_EQ(theta[i], x[sentinel].real());
EXPECT_FLOAT_EQ(theta[i + 1], x[sentinel].imag());
++sentinel;
}
EXPECT_THROW(serializer.write(4), std::runtime_error);
}
Expand Down Expand Up @@ -94,11 +94,11 @@ TEST(serializer_rowvector, complex_write) {

stan::io::serializer<double> serializer(theta);
serializer.write(x);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 20U; i += 2) {
EXPECT_FLOAT_EQ(theta[i], x[sentinal].real());
EXPECT_FLOAT_EQ(theta[i + 1], x[sentinal].imag());
++sentinal;
EXPECT_FLOAT_EQ(theta[i], x[sentinel].real());
EXPECT_FLOAT_EQ(theta[i + 1], x[sentinel].imag());
++sentinel;
}
EXPECT_THROW(serializer.write(4), std::runtime_error);
}
Expand Down Expand Up @@ -129,11 +129,11 @@ TEST(serializer_matrix, complex_write) {

stan::io::serializer<double> serializer(theta);
serializer.write(x);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 32U; i += 2) {
EXPECT_FLOAT_EQ(theta[i], x(sentinal).real());
EXPECT_FLOAT_EQ(theta[i + 1], x(sentinal).imag());
++sentinal;
EXPECT_FLOAT_EQ(theta[i], x(sentinel).real());
EXPECT_FLOAT_EQ(theta[i + 1], x(sentinel).imag());
++sentinel;
}
EXPECT_THROW(serializer.write(4), std::runtime_error);
}
Expand Down Expand Up @@ -164,11 +164,11 @@ TEST(serializer_stdvector, complex_write) {

stan::io::serializer<double> serializer(theta);
serializer.write(x);
Eigen::Index sentinal = 0;
Eigen::Index sentinel = 0;
for (size_t i = 0; i < 20U; i += 2) {
EXPECT_FLOAT_EQ(theta[i], x[sentinal].real());
EXPECT_FLOAT_EQ(theta[i + 1], x[sentinal].imag());
++sentinal;
EXPECT_FLOAT_EQ(theta[i], x[sentinel].real());
EXPECT_FLOAT_EQ(theta[i + 1], x[sentinel].imag());
++sentinel;
}
EXPECT_THROW(serializer.write(4), std::runtime_error);
}
Expand Down
Loading
Loading