Skip to content

Commit

Permalink
Aligning with Riley's Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RylieWeaver committed Aug 5, 2024
1 parent 68b2064 commit 35e639e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test/test_basic_rng/test_sample_indices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TestSampleIndices : public ::testing::Test
static void test_iid_uniform_smoke(int64_t N, int64_t k, uint32_t seed) {
RNGState state(seed);
std::vector<int64_t> samples(k, -1);
RandBLAS::util::sample_indices_iid_uniform(N, samples.data(), k, state);
RandBLAS::util::sample_indices_iid_uniform(N, k, samples.data(), state);
int64_t* data = samples.data();
for (int64_t i = 0; i < k; ++i) {
ASSERT_LT(data[i], N);
Expand All @@ -65,7 +65,6 @@ class TestSampleIndices : public ::testing::Test
static void index_set_kolmogorov_smirnov_tester(
std::vector<int64_t> &samples, std::vector<float> &true_cdf, double critical_value
) {
auto num_samples = (int) samples.size();
auto N = (int64_t) true_cdf.size();
std::vector<float> sample_cdf(N, 0.0);
for (int64_t s : samples)
Expand All @@ -79,13 +78,6 @@ class TestSampleIndices : public ::testing::Test
ASSERT_LT(diff, critical_value);
}
return;

RNGState state(seed);
std::vector<int64_t> samples(num_samples, -1);
RandBLAS::util::sample_indices_iid_uniform(N, num_samples, samples.data(), state);

index_set_kolmogorov_smirnov_tester(samples, true_cdf, critical_value);
return;
}

static void test_iid_uniform_kolmogorov_smirnov(int64_t N, double significance, int64_t num_samples, uint32_t seed) {
Expand All @@ -97,7 +89,7 @@ class TestSampleIndices : public ::testing::Test

RNGState state(seed);
std::vector<int64_t> samples(num_samples, -1);
RandBLAS::util::sample_indices_iid_uniform(N, samples.data(), num_samples, state);
RandBLAS::util::sample_indices_iid_uniform(N, num_samples, samples.data(), state);

index_set_kolmogorov_smirnov_tester(samples, true_cdf, critical_value);
return;
Expand Down

0 comments on commit 35e639e

Please sign in to comment.