|
Latin Hypercube Samples (lhs)
1.0
R, C++, and Rcpp code to generate Latin hypercube samples
|
#include <runif.h>
Public Member Functions | |
| RUnif () | |
| RUnif (int is, int js, int ks, int ls) | |
| void | seed (int is, int js, int ks, int ls) |
| void | seed (SeedSet &seedSet) |
| SeedSet | getSeedSet () |
| void | runif (std::vector< double > &x, int n) |
Static Public Member Functions | |
| static int | mod (int a, int b) |
Marsaglia - Zaman universal random number generator.
reinitialization: call seed(is,js,ks,ls), with integer arguments from 1 to 168, not all 1.
generate n uniform random numbers and store in x(n): call ranums(x,n).
Transliterated from FORTRAN to C by Art Owen, 4 March 1993.
| oacpp::RUnif::RUnif | ( | ) |
Constructor
| oacpp::RUnif::RUnif | ( | int | is, |
| int | js, | ||
| int | ks, | ||
| int | ls | ||
| ) |
Constructor with individual seeds
| SeedSet oacpp::RUnif::getSeedSet | ( | ) |
Get the seed set
|
static |
a mod b
| a | base |
| b | modulus |
| void oacpp::RUnif::runif | ( | std::vector< double > & | x, |
| int | n | ||
| ) |
random uniform number generator
| x | a double vector to contain the random numbers |
| n | the length of the vector |
| void oacpp::RUnif::seed | ( | int | is, |
| int | js, | ||
| int | ks, | ||
| int | ls | ||
| ) |
sets seed integers, rejects invalid input
| is | seed |
| js | seed |
| ks | seed |
| ls | seed |
| void oacpp::RUnif::seed | ( | SeedSet & | seedSet | ) |
Set the seeds to equal the numbers in the seedSet
| seedSet | a set of four seeds |