33 #ifndef MADNESS_MISC_RAN_H__INCLUDED
34 #define MADNESS_MISC_RAN_H__INCLUDED
78 volatile double*
const u;
79 unsigned int simple_state;
83 unsigned int simple();
86 Random(
unsigned int seed = 5461);
92 if (cur >= r) generate();
101 if (cur >= r) generate();
103 const double* ucur =
const_cast<const double*
>(u) + cur;
104 for (
int i=0; i<ndo; ++i) v[i] = (
T)(ucur[i]);
153 for (
int i=0; i<n; ++i) t[i] = RandomValue<T>();
165 #endif // MADNESS_MISC_RAN_H__INCLUDED
Random(unsigned int seed=5461)
Definition: ran.cc:71
int cur
Definition: ran.h:47
Mutex that is applied/released at start/end of a scope.
Definition: worldmutex.h:186
Mutex using pthread mutex operations.
Definition: worldmutex.h:94
std::complex< double > double_complex
Definition: lineplot.cc:16
float_complex RandomValue< float_complex >()
Random float_complex.
Definition: ran.cc:246
static void test()
Test the generator.
Definition: ran.cc:182
void RandomVector< float >(int n, float *t)
Definition: ran.cc:262
int RandomValue< int >()
Random int.
Definition: ran.cc:250
float RandomValue< float >()
Random float.
Definition: ran.cc:238
double u[1279]
Definition: ran.h:48
void RandomVector(int n, T *t)
Definition: ran.h:152
std::complex< double > double_complex
Definition: ran.h:41
void RandomVector< double >(int n, double *t)
Definition: ran.cc:258
T RandomValue()
Random value that wraps the default Fibonacci generator.
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
void RandomVector< float_complex >(int n, float_complex *t)
Definition: ran.cc:270
void RandomVector< double_complex >(int n, double_complex *t)
Definition: ran.cc:266
const mpreal min(const mpreal &x, const mpreal &y)
Definition: mpreal.h:2675
Implements Dqueue, Thread, ThreadBase and ThreadPool.
RandomState getstate() const
Returns full state of the generator.
Definition: ran.cc:167
double RandomValue< double >()
Random double.
Definition: ran.cc:234
void setstate(const RandomState &s)
Restores state of the generator.
Definition: ran.cc:175
long RandomValue< long >()
Random long.
Definition: ran.cc:254
double_complex RandomValue< double_complex >()
Random double_complex.
Definition: ran.cc:242
virtual ~Random()
Definition: ran.cc:127
std::complex< float > float_complex
Definition: ran.h:40
void getbytes(int n, unsigned char *restrict v)
Returns vector of random bytes in [0,256)
Definition: ran.cc:154
Random default_random_generator
The default random number stream.
Definition: ran.cc:231
#define restrict
Definition: config.h:403
A random number generator (portable, vectorized, and thread-safe)
Definition: ran.h:72
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
void getv(int n, T *restrict v)
Returns a vector of uniform doubles in [0,1)
Definition: ran.h:98