20 #if !defined(__MITSUBA_CORE_RANDOM_H_)
21 #define __MITSUBA_CORE_RANDOM_H_
23 #include <mitsuba/mitsuba.h>
113 void seed(uint64_t value = 5489ULL);
116 void seed(
Random *random);
123 void seed(uint64_t *values, uint64_t length);
126 uint64_t nextULong();
132 size_t nextSize(
size_t n);
138 Float nextStandardNormal();
149 template <
typename Iterator>
void shuffle(Iterator it1, Iterator it2) {
150 for (Iterator it = it2 - 1; it > it1; --it)
151 std::iter_swap(it, it1 + nextSize((
size_t) (it-it1)));
Random number generator based on SIMD-oriented Fast Mersenne Twister
Definition: random.h:88
Base class of all reference-counted objects with serialization support.
Definition: serialization.h:35
virtual void serialize(Stream *stream, InstanceManager *manager) const =0
Serialize this object to a stream.
#define MTS_EXPORT_CORE
Definition: getopt.h:29
void shuffle(Iterator it1, Iterator it2)
Draw a uniformly distributed permutation and permute the given STL container.
Definition: random.h:149
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Coordinates the serialization and unserialization of object graphs.
Definition: serialization.h:65