Merge pull request #843 from afabri/Random_print_seed-GF

Print the seed of CGAL::default_random
This commit is contained in:
Laurent Rineau 2016-04-01 11:02:54 +02:00
commit 617d5f2856
5 changed files with 37 additions and 3 deletions

View File

@ -343,10 +343,11 @@ endif()
# CGAL-4.6 : 11.0.0 (int->size_t in CGAL_ImageIO)
# CGAL-4.7 : 11.0.1 (Nothing different in CGAL compiled libraries.)
# CGAL-4.8 : 11.0.2 (Nothing different in CGAL compiled libraries.)
# CGAL-4.9 : 11.0.3 (Nothing different in CGAL compiled libraries.)
# ¹) According to http://upstream-tracker.org/versions/cgal.html
set( CGAL_SONAME_VERSION "11" )
set( CGAL_SOVERSION "11.0.2" )
set( CGAL_SOVERSION "11.0.3" )
message( STATUS "CGAL_SONAME_VERSION=${CGAL_SONAME_VERSION}" )
message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" )

View File

@ -46,7 +46,11 @@ Random( )
std::time_t s;
std::time( &s);
seed = (unsigned int)s;
#if defined( CGAL_TEST_SUITE ) || defined( CGAL_PRINT_SEED )
if(this == & get_default_random()){
std::cerr << "default_random::get_seed() = " << seed << std::endl;
}
#endif
// initialize random numbers generator
rng.seed(static_cast<boost::int32_t>(seed));
random_value = get_int(0, 1<<15);
@ -62,6 +66,7 @@ Random( unsigned int seed)
random_value = get_int(0, 1<<15);
}
// seed
CGAL_INLINE_FUNCTION
unsigned int

View File

@ -0,0 +1,14 @@
#ifndef CGAL_TEST_SUITE
# define CGAL_TEST_SUITE 1
#endif
#include <CGAL/Random.h>
int main()
{
int u = CGAL::get_default_random().get_int( 0, 1000);
if(u >= 0 || u <= 1000)
return 0;
else
return 1;
}

View File

@ -0,0 +1,14 @@
#ifdef CGAL_TEST_SUITE
# undef CGAL_TEST_SUITE
#endif
#include <CGAL/Random.h>
int main()
{
int u = CGAL::get_default_random().get_int( 0, 1000);
if(u >= 0 || u <= 1000)
return 0;
else
return 1;
}