Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68787 - trunk/libs/random/test
From: steven_at_[hidden]
Date: 2011-02-11 16:09:47


Author: steven_watanabe
Date: 2011-02-11 16:09:46 EST (Fri, 11 Feb 2011)
New Revision: 68787
URL: http://svn.boost.org/trac/boost/changeset/68787

Log:
Reduce the default number of trials, so the tests complete in a reasonable amount of time.
Text files modified:
   trunk/libs/random/test/test_negative_binomial.cpp | 1 -
   trunk/libs/random/test/test_real_distribution.ipp | 9 ++++-----
   2 files changed, 4 insertions(+), 6 deletions(-)

Modified: trunk/libs/random/test/test_negative_binomial.cpp
==============================================================================
--- trunk/libs/random/test/test_negative_binomial.cpp (original)
+++ trunk/libs/random/test/test_negative_binomial.cpp 2011-02-11 16:09:46 EST (Fri, 11 Feb 2011)
@@ -26,6 +26,5 @@
 #define BOOST_RANDOM_ARG2_DEFAULT 1000.0
 #define BOOST_RANDOM_ARG2_DISTRIBUTION(n) boost::uniform_01<>()
 #define BOOST_RANDOM_DISTRIBUTION_MAX n
-#define BOOST_RANDOM_P_CUTOFF 0.995
 
 #include "test_real_distribution.ipp"

Modified: trunk/libs/random/test/test_real_distribution.ipp
==============================================================================
--- trunk/libs/random/test/test_real_distribution.ipp (original)
+++ trunk/libs/random/test/test_real_distribution.ipp 2011-02-11 16:09:46 EST (Fri, 11 Feb 2011)
@@ -44,7 +44,7 @@
 #ifdef BOOST_RANDOM_ARG2_TYPE
              BOOST_RANDOM_ARG2_TYPE BOOST_RANDOM_ARG2_NAME,
 #endif
- long long max) {
+ long long max, boost::mt19937& gen) {
     std::cout << "running " BOOST_PP_STRINGIZE(BOOST_RANDOM_DISTRIBUTION_NAME) "("
         << BOOST_RANDOM_ARG1_NAME;
 #ifdef BOOST_RANDOM_ARG2_NAME
@@ -55,7 +55,6 @@
     BOOST_MATH_DISTRIBUTION expected BOOST_MATH_DISTRIBUTION_INIT;
     
     BOOST_RANDOM_DISTRIBUTION dist BOOST_RANDOM_DISTRIBUTION_INIT;
- boost::mt19937 gen;
 
 #ifdef BOOST_RANDOM_DISTRIBUTION_MAX
 
@@ -116,7 +115,7 @@
 #ifdef BOOST_RANDOM_ARG2_NAME
             d2(gen),
 #endif
- trials)) {
+ trials, gen)) {
             ++errors;
         }
     }
@@ -152,12 +151,12 @@
 }
 
 int main(int argc, char** argv) {
- int repeat = 10;
+ int repeat = 1;
     BOOST_RANDOM_ARG1_TYPE max_arg1 = BOOST_RANDOM_ARG1_DEFAULT;
 #ifdef BOOST_RANDOM_ARG2_TYPE
     BOOST_RANDOM_ARG2_TYPE max_arg2 = BOOST_RANDOM_ARG2_DEFAULT;
 #endif
- long long trials = 1000000;
+ long long trials = 100000;
 
     if(argc > 0) {
         --argc;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk