From ec00c70af059e707d09653ff13e70818c0cd59bd Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Sun, 9 Oct 2022 09:31:18 -0700 Subject: [PATCH] Specify seed in random tests. --- test/test_chatterjee_correlation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_chatterjee_correlation.cpp b/test/test_chatterjee_correlation.cpp index d39a1a33a2..3443980eb9 100644 --- a/test/test_chatterjee_correlation.cpp +++ b/test/test_chatterjee_correlation.cpp @@ -86,7 +86,7 @@ void test_spots() template void test_threaded(ExecutionPolicy&& exec) { - std::vector x = boost::math::generate_random_vector(1024, 0); + std::vector x = boost::math::generate_random_vector(1024, 2); std::vector y = boost::math::generate_random_vector(1024, 1); std::sort(std::forward(exec), x.begin(), x.end()); @@ -105,7 +105,8 @@ void test_paper() constexpr Real two_pi = boost::math::constants::two_pi(); // Page 9 figure (a) y = x - std::vector x = boost::math::generate_random_uniform_vector(100, 0, -two_pi, two_pi); + size_t seed = 3; + std::vector x = boost::math::generate_random_uniform_vector(100, seed, -two_pi, two_pi); std::sort(x.begin(), x.end()); auto result = chatterjee_correlation(x, x); CHECK_MOLLIFIED_CLOSE(result, Real(0.970), 0.005);