IMP  2.1.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-2013 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.hpp>
13 
14 IMPBASE_BEGIN_NAMESPACE
15 typedef ::boost::rand48 RandomNumberGenerator;
16 //! A shared random number generator
17 /** The random number generator is seeded based of of the current time. To
18  provide a better seed or use a constant seed call
19  random_number_generator.seed(x) with a 32 bit int or a 64 bit unsigned int.
20 
21  This generator can be used by the
22 \external{http://www.boost.org/doc/libs/1_39_0/libs/random/index.html,
23 Boost.Random}
24  distributions.
25  */
26 extern IMPBASEEXPORT RandomNumberGenerator random_number_generator;
27 
28 /** Return the initial random seed.
29  */
30 IMPBASEEXPORT boost::uint64_t get_random_seed();
31 
32 IMPBASE_END_NAMESPACE
33 
34 #endif /* IMPBASE_RANDOM_H */
RandomNumberGenerator random_number_generator
A shared random number generator.
boost::uint64_t get_random_seed()