mirror of https://github.com/CGAL/cgal
No need for a constructor just for default_random
This commit is contained in:
parent
79f54a6c7c
commit
ef624f92de
|
|
@ -66,7 +66,6 @@ public:
|
|||
// creation
|
||||
CGAL_EXPORT Random( );
|
||||
CGAL_EXPORT Random( unsigned int seed);
|
||||
CGAL_EXPORT Random(char*);
|
||||
|
||||
// seed
|
||||
CGAL_EXPORT unsigned int get_seed ( ) const;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -63,24 +67,6 @@ Random( unsigned int seed)
|
|||
}
|
||||
|
||||
|
||||
CGAL_INLINE_FUNCTION
|
||||
Random::
|
||||
Random(char* )
|
||||
: val(0)
|
||||
{
|
||||
// get system's time
|
||||
std::time_t s;
|
||||
std::time( &s);
|
||||
seed = (unsigned int)s;
|
||||
|
||||
#if defined( CGAL_TEST_SUITE ) || defined( CGAL_PRINT_SEED )
|
||||
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);
|
||||
}
|
||||
|
||||
// seed
|
||||
CGAL_INLINE_FUNCTION
|
||||
unsigned int
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
Random default_random = Random("default");
|
||||
Random default_random;
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue