20 #include <iostream.hpp>
25 #if (defined(_MSC_VER) && (_MSC_VER < 1900))\
26 || (defined(__cplusplus) && (__cplusplus < 201103L))
29 constexpr
int M1 = 714025;
35 #if (defined(_MSC_VER) && (_MSC_VER < 1900))\
36 || (defined(__cplusplus) && (__cplusplus < 201103L))
39 constexpr
float RM1 = 1.0f /
M1;
46 #if (defined(_MSC_VER) && (_MSC_VER < 1900))\
47 || (defined(__cplusplus) && (__cplusplus < 201103L))
50 constexpr
int M2 = 243000;
56 #if (defined(_MSC_VER) && (_MSC_VER < 1900))\
57 || (defined(__cplusplus) && (__cplusplus < 201103L))
60 constexpr
float RM2 = 1.0f /
M2;
63 double auto_rand(
long int& idum,
int reset);
65 double randn(
long int& n);
86 static long ix1,ix2,ix3;
96 if (idum < 0 || iff == 0)
110 for (
int j=1;j<=107;j++)
116 long int iu = (
long int)(ix2 *
RM2);
128 long j = 1 + ((107*ix3)/
M3);
129 if (j > 107 || j < 1) cerr <<
" Error in random number generator\n";
166 if (p < 0.0 || p > 1.0)
168 cerr <<
"Error in dvar_vector::fill_randbi proportions of"
169 " successes must lie between 0 and 1.\n";
236 (*this)(i) =
randn(nn);
double auto_rand(long int &idum, int reset)
Random number generator.
void fill_randn_ni(long int &n)
Description not yet available.
void reinitialize_auto_rand()
Description not yet available.
void fill_randn(const random_number_generator &rng)
Description not yet available.
int indexmin() const
Get minimum valid index.
void fill_randn(long int &n)
Fill matrix with random numbers.
void fill_randu_ni(long int &n)
Description not yet available.
void fill_randu(long int &n)
Fill vector with random numbers.
void colfill_randn(const int &j, long int &n)
Fill random numbers into specified column j of matrix.
void fill_randn(long int &n)
Fill vector with random numbers.
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void fill_randu(long int &n)
Fill matrix with random numbers.
int indexmax() const
Get maximum valid index.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void fill_randbi(long int &n, double)
Fill vector with binary random numbers.
d3_array cos(const d3_array &arr3)
Returns d3_array results with computed cos from elements in arr3.
double randn(const random_number_generator &rng)
Normal number generator.
void fill_randn_ni(long int &n)
Description not yet available.
void colfill_randu(const int &j, long int &n)
Fill random numbers into specified column j of matrix.
void rowfill_randn(const int &i, long int &n)
Fill random numbers into specified row i of matrix.
void fill_randu(const random_number_generator &rng)
Description not yet available.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void rowfill_randu(const int &i, long int &n)
Fill random numbers into specified row i of matrix.
void fill_randu_ni(long int &n)
Description not yet available.