Skip to content

Commit 9da4dc8

Browse files
committed
Move stan::rng_t decl to Math library for consistency
1 parent 0379951 commit 9da4dc8

File tree

72 files changed

+240
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+240
-228
lines changed

stan/math/prim/meta/rng_t.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef STAN_MATH_PRIM_META_RNG_T_HPP
2+
#define STAN_MATH_PRIM_META_RNG_T_HPP
3+
4+
#include <boost/random/mixmax.hpp>
5+
6+
namespace stan {
7+
8+
using rng_t = boost::random::mixmax;
9+
10+
} // namespace stan
11+
12+
#endif

test/unit/math/fwd/prob/lkj_corr_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
TEST(ProbDistributionsLkjCorr, fvar_double) {
77
using stan::math::fvar;
8-
boost::random::mixmax rng;
8+
stan::rng_t rng;
99
int K = 4;
1010
Eigen::Matrix<fvar<double>, Eigen::Dynamic, Eigen::Dynamic> Sigma(K, K);
1111
Sigma.setZero();
@@ -24,7 +24,7 @@ TEST(ProbDistributionsLkjCorr, fvar_double) {
2424

2525
TEST(ProbDistributionsLkjCorrCholesky, fvar_double) {
2626
using stan::math::fvar;
27-
boost::random::mixmax rng;
27+
stan::rng_t rng;
2828
int K = 4;
2929
Eigen::Matrix<fvar<double>, Eigen::Dynamic, Eigen::Dynamic> Sigma(K, K);
3030
Sigma.setZero();
@@ -43,7 +43,7 @@ TEST(ProbDistributionsLkjCorrCholesky, fvar_double) {
4343

4444
TEST(ProbDistributionsLkjCorr, fvar_fvar_double) {
4545
using stan::math::fvar;
46-
boost::random::mixmax rng;
46+
stan::rng_t rng;
4747
int K = 4;
4848
Eigen::Matrix<fvar<fvar<double> >, Eigen::Dynamic, Eigen::Dynamic> Sigma(K,
4949
K);
@@ -63,7 +63,7 @@ TEST(ProbDistributionsLkjCorr, fvar_fvar_double) {
6363

6464
TEST(ProbDistributionsLkjCorrCholesky, fvar_fvar_double) {
6565
using stan::math::fvar;
66-
boost::random::mixmax rng;
66+
stan::rng_t rng;
6767
int K = 4;
6868
Eigen::Matrix<fvar<fvar<double> >, Eigen::Dynamic, Eigen::Dynamic> Sigma(K,
6969
K);

test/unit/math/mix/prob/lkj_corr_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
TEST(ProbDistributionsLkjCorr, fvar_var) {
1010
using stan::math::fvar;
1111
using stan::math::var;
12-
boost::random::mixmax rng;
12+
stan::rng_t rng;
1313
int K = 4;
1414
Eigen::Matrix<fvar<var>, Eigen::Dynamic, Eigen::Dynamic> Sigma(K, K);
1515
Sigma.setZero();
@@ -31,7 +31,7 @@ TEST(ProbDistributionsLkjCorr, fvar_var) {
3131
TEST(ProbDistributionsLkjCorrCholesky, fvar_var) {
3232
using stan::math::fvar;
3333
using stan::math::var;
34-
boost::random::mixmax rng;
34+
stan::rng_t rng;
3535
int K = 4;
3636
Eigen::Matrix<fvar<var>, Eigen::Dynamic, Eigen::Dynamic> Sigma(K, K);
3737
Sigma.setZero();
@@ -54,7 +54,7 @@ TEST(ProbDistributionsLkjCorrCholesky, fvar_var) {
5454
TEST(ProbDistributionsLkjCorr, fvar_fvar_var) {
5555
using stan::math::fvar;
5656
using stan::math::var;
57-
boost::random::mixmax rng;
57+
stan::rng_t rng;
5858
int K = 4;
5959
Eigen::Matrix<fvar<fvar<var> >, Eigen::Dynamic, Eigen::Dynamic> Sigma(K, K);
6060
Sigma.setZero();
@@ -78,7 +78,7 @@ TEST(ProbDistributionsLkjCorr, fvar_fvar_var) {
7878
TEST(ProbDistributionsLkjCorrCholesky, fvar_fvar_var) {
7979
using stan::math::fvar;
8080
using stan::math::var;
81-
boost::random::mixmax rng;
81+
stan::rng_t rng;
8282
int K = 4;
8383
Eigen::Matrix<fvar<fvar<var> >, Eigen::Dynamic, Eigen::Dynamic> Sigma(K, K);
8484
Sigma.setZero();

test/unit/math/opencl/multiply_transpose_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <boost/random/mersenne_twister.hpp>
88
#include <gtest/gtest.h>
99
#include <algorithm>
10-
boost::random::mixmax rng;
10+
stan::rng_t rng;
1111

1212
TEST(MathMatrixOpenCL, multiply_transpose_exception_fail_zero) {
1313
stan::math::row_vector_d rv(0);

test/unit/math/opencl/prim/mdivide_left_tri_low_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TEST(MathMatrixCL, mdivide_left_tri_low_cl_exception) {
2929
}
3030

3131
void mdivide_left_tri_low_Ab_test(int size) {
32-
boost::random::mixmax rng;
32+
stan::rng_t rng;
3333
auto m1 = stan::math::matrix_d(size, size);
3434
for (int i = 0; i < size; i++) {
3535
for (int j = 0; j < i; j++) {
@@ -57,7 +57,7 @@ void mdivide_left_tri_low_Ab_test(int size) {
5757
}
5858

5959
void mdivide_left_tri_low_A_test(int size) {
60-
boost::random::mixmax rng;
60+
stan::rng_t rng;
6161
auto m1 = stan::math::matrix_d(size, size);
6262
for (int i = 0; i < size; i++) {
6363
for (int j = 0; j < i; j++) {

test/unit/math/opencl/prim/mdivide_right_tri_low_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TEST(MathMatrixCL, mdivide_right_tri_low_cl_exception) {
2929
}
3030

3131
void mdivide_right_tri_low_Ab_test(int size) {
32-
boost::random::mixmax rng;
32+
stan::rng_t rng;
3333
auto m1 = stan::math::matrix_d(size, size);
3434
for (int i = 0; i < size; i++) {
3535
for (int j = 0; j < i; j++) {

test/unit/math/opencl/tri_inverse_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TEST(MathMatrixCL, inverse_cl_exception) {
2525
}
2626

2727
void lower_inverse_test(int size) {
28-
boost::random::mixmax rng;
28+
stan::rng_t rng;
2929
auto m1 = stan::math::matrix_d(size, size);
3030
for (int i = 0; i < size; i++) {
3131
for (int j = 0; j < i; j++) {
@@ -56,7 +56,7 @@ void lower_inverse_test(int size) {
5656
}
5757

5858
void upper_inverse_test(int size) {
59-
boost::random::mixmax rng;
59+
stan::rng_t rng;
6060
auto m1 = stan::math::matrix_d(size, size);
6161
for (int i = 0; i < size; i++) {
6262
for (int j = 0; j < i; j++) {

test/unit/math/prim/fun/chol2inv_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TEST(MathMatrixPrimMat, chol2inv) {
2525
using stan::math::matrix_d;
2626
using stan::math::wishart_rng;
2727

28-
boost::random::mixmax rng;
28+
stan::rng_t rng;
2929
matrix_d I(3, 3);
3030
I.setZero();
3131
I.diagonal().setOnes();

test/unit/math/prim/prob/bernoulli_logit_glm_rng_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
TEST(ProbDistributionsBernoulliLogitGlm, vectorized) {
1010
using stan::math::bernoulli_logit_glm_rng;
1111
// Test scalar/vector combinations.
12-
boost::random::mixmax rng;
12+
stan::rng_t rng;
1313

1414
Eigen::MatrixXd x(2, 3);
1515
x << 3.5, -1.5, 0.0, 2.0, 1.0, 3.0;
@@ -70,7 +70,7 @@ TEST(ProbDistributionsBernoulliLogitGlm, vectorized) {
7070
TEST(ProbDistributionsBernoulliLogitGlm, errorCheck) {
7171
using stan::math::bernoulli_logit_glm_rng;
7272
// Check errors for nonfinite and wrong sizes.
73-
boost::random::mixmax rng;
73+
stan::rng_t rng;
7474

7575
int N = 3;
7676
int M = 2;
@@ -107,7 +107,7 @@ TEST(ProbDistributionsBernoulliLogitGlm, errorCheck) {
107107
TEST(ProbDistributionsBernoulliLogitGlm, marginalChiSquareGoodnessFitTest) {
108108
using stan::math::bernoulli_logit_glm_rng;
109109
// Check distribution of result.
110-
boost::random::mixmax rng;
110+
stan::rng_t rng;
111111
Eigen::MatrixXd x(2, 2);
112112
x << 3.5, -1.5, 2.0, -1.2;
113113
std::vector<double> alpha{2.0, 1.0};

test/unit/math/prim/prob/bernoulli_logit_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ TEST(ProbDistributionsBernoulliLogit, distributionCheck) {
3535
}
3636

3737
TEST(ProbDistributionsBernoulliLogit, error_check) {
38-
boost::random::mixmax rng;
38+
stan::rng_t rng;
3939

4040
EXPECT_NO_THROW(stan::math::bernoulli_logit_rng(-3.5, rng));
4141
EXPECT_THROW(
@@ -44,7 +44,7 @@ TEST(ProbDistributionsBernoulliLogit, error_check) {
4444
}
4545

4646
TEST(ProbDistributionsBernoulliLogit, logitChiSquareGoodnessFitTest) {
47-
boost::random::mixmax rng;
47+
stan::rng_t rng;
4848
// number of samples
4949
int N = 10000;
5050

0 commit comments

Comments
 (0)