IMP  2.4.0
The Integrative Modeling Platform
random.h
Go to the documentation of this file.
1 /**
2  * \file IMP/base/random.h \brief Random number generators used by IMP.
3  *
4  * Copyright 2007-2015 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPBASE_RANDOM_H
9 #define IMPBASE_RANDOM_H
10 
11 #include <IMP/base/base_config.h>
12 #include <boost/random/mersenne_twister.hpp>
13 
14 IMPBASE_BEGIN_NAMESPACE
15 typedef ::boost::mt19937 RandomNumberGenerator;
16 //! A shared random number generator
17 /** The random number generator is seeded based using the boost::random_device
18 if it is available or `/dev/urandom` if it is not.
19 
20 This generator can be used by the
21 [Boost.Random](http://www.boost.org/doc/libs/1_39_0/libs/random/index.html)
22 distributions.
23  */
24 extern IMPBASEEXPORT RandomNumberGenerator random_number_generator;
25 
26 //! Return the initial random seed.
27 IMPBASEEXPORT boost::uint64_t get_random_seed();
28 
29 IMPBASE_END_NAMESPACE
30 
31 #endif /* IMPBASE_RANDOM_H */
RandomNumberGenerator random_number_generator
A shared random number generator.
boost::uint64_t get_random_seed()
Return the initial random seed.