30 #include <boost/random/mersenne_twister.hpp> 31 #include <gtest/gtest.h> 37 namespace boost_random =
boost;
39 namespace boost_random = boost::random;
44 boost_random::mt19937 gen;
46 std::vector<int32_t> sample;
47 swri_math_util::GetUniformRandomSample<boost_random::mt19937>(gen, 0, 100, 10, sample);
49 EXPECT_EQ(10, sample.size());
51 swri_math_util::GetUniformRandomSample<boost_random::mt19937>(gen, 0, 100, 90, sample);
52 EXPECT_EQ(90, sample.size());
55 TEST(RandomTests, RandomGenerator)
59 std::vector<int32_t> sample;
62 EXPECT_EQ(10, sample.size());
65 EXPECT_EQ(90, sample.size());
69 int main(
int argc,
char **argv)
71 testing::InitGoogleTest(&argc, argv);
73 return RUN_ALL_TESTS();
int main(int argc, char **argv)
void GetUniformRandomSample(RNG &rng, int32_t min, int32_t max, int32_t count, std::vector< int32_t > &sample)
void GetUniformRandomSample(int32_t min, int32_t max, int32_t count, std::vector< int32_t > &sample)
TEST(RandomTests, GetUniformRandomSample)