32#ifndef MADNESS_MISC_RAN_H__INCLUDED
33#define MADNESS_MISC_RAN_H__INCLUDED
85 Random(
unsigned int seed = 5461);
97 void getv(
int n,
T * MADNESS_RESTRICT
v) {
101 int ndo = std::min(n,
r-
cur);
102 const double* ucur =
const_cast<const double*
>(
u) +
cur;
103 for (
int i=0; i<ndo; ++i)
v[i] = (
T)(ucur[i]);
111 void getbytes(
int n,
unsigned char * MADNESS_RESTRICT
v);
152 for (
int i=0; i<n; ++i) t[i] = RandomValue<T>();
std::complex< double > double_complex
Definition cfft.h:14
Mutex using pthread mutex operations.
Definition worldmutex.h:131
A random number generator (portable, vectorized, and thread-safe)
Definition ran.h:71
void getbytes(int n, unsigned char *MADNESS_RESTRICT v)
Returns vector of random bytes in [0,256)
Definition ran.cc:154
const double beta
Definition ran.h:75
unsigned int simple_state
Definition ran.h:78
double *const u
Definition ran.h:77
const int s
Definition ran.h:74
static void test()
Test the generator.
Definition ran.cc:182
virtual ~Random()
Definition ran.cc:127
void setstate(const RandomState &s)
Restores state of the generator.
Definition ran.cc:175
void getv(int n, T *MADNESS_RESTRICT v)
Returns a vector of uniform doubles in [0,1)
Definition ran.h:97
RandomState getstate() const
Returns full state of the generator.
Definition ran.cc:167
unsigned int simple()
Definition ran.cc:66
double get()
Definition ran.h:89
const int r
Definition ran.h:73
int cur
Definition ran.h:76
void generate()
Definition ran.cc:45
Mutex that is applied/released at start/end of a scope.
Definition worldmutex.h:239
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
static const double v
Definition hatom_sf_dirac.cc:20
Macros and tools pertaining to the configuration of MADNESS.
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
void RandomVector(int n, T *t)
Definition ran.h:151
float RandomValue< float >()
Random float.
Definition ran.cc:238
double RandomValue< double >()
Random double.
Definition ran.cc:234
void RandomVector< float >(int n, float *t)
Definition ran.cc:262
long RandomValue< long >()
Random long.
Definition ran.cc:254
int RandomValue< int >()
Random int.
Definition ran.cc:250
float_complex RandomValue< float_complex >()
Random float_complex.
Definition ran.cc:246
double_complex RandomValue< double_complex >()
Random double_complex.
Definition ran.cc:242
void RandomVector< float_complex >(int n, float_complex *t)
Definition ran.cc:270
T RandomValue()
Random value that wraps the default Fibonacci generator.
void RandomVector< double >(int n, double *t)
Definition ran.cc:258
void RandomVector< double_complex >(int n, double_complex *t)
Definition ran.cc:266
Random default_random_generator
The default random number stream.
Definition ran.cc:231
std::complex< double > double_complex
Definition ran.h:40
std::complex< float > float_complex
Definition ran.h:39
double u[1279]
Definition ran.h:47
int cur
Definition ran.h:46
Implements Dqueue, Thread, ThreadBase and ThreadPool.