IMP logo
IMP Reference Guide  2.6.0
The Integrative Modeling Platform
random.h
Go to the documentation of this file.
1 /**
2  * \file IMP/random.h \brief Random number generators used by IMP.
3  *
4  * Copyright 2007-2016 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPKERNEL_RANDOM_H
9 #define IMPKERNEL_RANDOM_H
10 
11 #include <IMP/kernel_config.h>
12 #include <IMP/Vector.h>
13 #include <boost/random/mersenne_twister.hpp>
14 
15 IMPKERNEL_BEGIN_NAMESPACE
16 
17 #ifndef SWIG // the RNG is defined explicitly in pyext/IMP_kernel.random.i
18 typedef ::boost::mt19937 RandomNumberGenerator;
19 
20 //! A shared non-GPU random number generator
21 /** The random number generator is seeded based on command line specified flag.
22  Otherwise, the default seed is retrieved from among either
23  boost::random_device, `/dev/urandom`, or the system clock, based on which
24  method is available in this priority order.
25 
26 This generator can be used by the
27 [Boost.Random](http://www.boost.org/doc/libs/1_39_0/libs/random/index.html)
28 distributions.
29  */
30 extern IMPKERNELEXPORT RandomNumberGenerator random_number_generator;
31 #endif
32 
33 //! Return the initial random seed.
34 IMPKERNELEXPORT boost::uint64_t get_random_seed();
35 
36 
37 IMPKERNEL_END_NAMESPACE
38 
39 #endif /* IMPKERNEL_RANDOM_H */
boost::uint64_t get_random_seed()
Return the initial random seed.
A class for storing lists of IMP items.
RandomNumberGenerator random_number_generator
A shared non-GPU random number generator.