mirror of https://github.com/CGAL/cgal
Merge pull request #843 from afabri/Random_print_seed-GF
Print the seed of CGAL::default_random
This commit is contained in:
commit
617d5f2856
|
|
@ -343,10 +343,11 @@ endif()
|
||||||
# CGAL-4.6 : 11.0.0 (int->size_t in CGAL_ImageIO)
|
# 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.7 : 11.0.1 (Nothing different in CGAL compiled libraries.)
|
||||||
# CGAL-4.8 : 11.0.2 (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
|
# ¹) According to http://upstream-tracker.org/versions/cgal.html
|
||||||
|
|
||||||
set( CGAL_SONAME_VERSION "11" )
|
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_SONAME_VERSION=${CGAL_SONAME_VERSION}" )
|
||||||
message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" )
|
message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" )
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,11 @@ Random( )
|
||||||
std::time_t s;
|
std::time_t s;
|
||||||
std::time( &s);
|
std::time( &s);
|
||||||
seed = (unsigned int)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
|
// initialize random numbers generator
|
||||||
rng.seed(static_cast<boost::int32_t>(seed));
|
rng.seed(static_cast<boost::int32_t>(seed));
|
||||||
random_value = get_int(0, 1<<15);
|
random_value = get_int(0, 1<<15);
|
||||||
|
|
@ -62,6 +66,7 @@ Random( unsigned int seed)
|
||||||
random_value = get_int(0, 1<<15);
|
random_value = get_int(0, 1<<15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// seed
|
// seed
|
||||||
CGAL_INLINE_FUNCTION
|
CGAL_INLINE_FUNCTION
|
||||||
unsigned int
|
unsigned int
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
Random default_random;
|
Random default_random;
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue