Orthogonal Array Library  1.0.0
Libray for generating orthogonal arrays based on Art Owen's oa library
All Classes Namespaces Files Functions Variables Typedefs Macros Pages
oacpp::RUnif Class Reference

Marsaglia - Zaman universal random number generator. More...

#include <runif.h>

Public Member Functions

 RUnif ()
 Constructor.
 
 RUnif (int is, int js, int ks, int ls)
 Constructor with individual seeds.
 
 RUnif (SeedSet seedSet)
 Constructor with a seed set.
 
void seed (int is, int js, int ks, int ls)
 sets seed integers, rejects invalid input More...
 
void seed (SeedSet seedSet)
 Set the seeds to equal the numbers in the seedSet. More...
 
SeedSet getSeedSet ()
 Get the seed set. More...
 
void runif (std::vector< double > &x, int n)
 random uniform number generator More...
 

Static Public Member Functions

static int mod (int a, int b)
 a mod b More...
 

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.

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: