Latin Hypercube Samples (lhs)  1.0
R, C++, and Rcpp code to generate Latin hypercube samples
All Classes Namespaces Files Functions Variables Typedefs Macros Pages
oacpp::RUnif Class Reference

#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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RUnif() [1/2]

oacpp::RUnif::RUnif ( )

Constructor

◆ RUnif() [2/2]

oacpp::RUnif::RUnif ( int  is,
int  js,
int  ks,
int  ls 
)

Constructor with individual seeds

Member Function Documentation

◆ getSeedSet()

SeedSet oacpp::RUnif::getSeedSet ( )

Get the seed set

Returns
the SeedSet struct containing the seeds

◆ mod()

int oacpp::RUnif::mod ( int  a,
int  b 
)
static

a mod b

Parameters
abase
bmodulus
Returns
an integer result

◆ runif()

void oacpp::RUnif::runif ( std::vector< double > &  x,
int  n 
)

random uniform number generator

Parameters
xa double vector to contain the random numbers
nthe length of the vector

◆ seed() [1/2]

void oacpp::RUnif::seed ( int  is,
int  js,
int  ks,
int  ls 
)

sets seed integers, rejects invalid input

Parameters
isseed
jsseed
ksseed
lsseed

◆ seed() [2/2]

void oacpp::RUnif::seed ( SeedSet seedSet)

Set the seeds to equal the numbers in the seedSet

Parameters
seedSeta set of four seeds

The documentation for this class was generated from the following files: