IMP  2.2.1
The Integrative Modeling Platform
base/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-2014 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  */
28 IMPBASEEXPORT boost::uint64_t get_random_seed();
29 
30 IMPBASE_END_NAMESPACE
31 
32 #endif /* IMPBASE_RANDOM_H */
RandomNumberGenerator random_number_generator
A shared random number generator.
boost::uint64_t get_random_seed()