NOMAD Source  Version 4.0.0 Beta
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LHS Class Reference

Latin Hypercube Sampling class. More...

#include <LHS.hpp>

Collaboration diagram for LHS:

Public Member Functions

 LHS (const size_t n, const size_t p, const ArrayOfDouble lowerBound, const ArrayOfDouble upperBound, const int seed=2920)
 Constructor. More...
 
int getSeed (void) const
 Get seed for random generation. More...
 
void setSeed (const int seed)
 Set seed for random generation. More...
 
ArrayOfDouble getLowerBound () const
 Get lower bound. More...
 
void setLowerBound (const ArrayOfDouble lowerBound)
 Set lower bound. More...
 
ArrayOfDouble getUpperBound (void) const
 Get upper bound. More...
 
void setUpperBound (const ArrayOfDouble upperBound)
 Set upper bound. More...
 
std::vector< PointSample () const
 Do the sampling. More...
 

Static Public Member Functions

static std::vector< size_t > Permutation (const size_t p)
 Random permutation of the vector (1, 2, .., p) More...
 

Private Attributes

size_t _n
 dimension More...
 
size_t _p
 number of samples More...
 
ArrayOfDouble _lowerBound
 lower bounds More...
 
ArrayOfDouble _upperBound
 upper bounds More...
 
int _seed
 seed More...
 

Detailed Description

Latin Hypercube Sampling class.

Input: n dimension p number of desired samples lowerBound and upperBound of type ArrayOfDouble indicating lower and upper bounds. Must be completely defined. seed (optional)

Output: p points of dimension n, distributed in the l x u hyper-rectangle of R^n

Definition at line 24 of file LHS.hpp.

Constructor & Destructor Documentation

LHS::LHS ( const size_t  n,
const size_t  p,
const ArrayOfDouble  lowerBound,
const ArrayOfDouble  upperBound,
const int  seed = 2920 
)
explicit

Constructor.

Parameters
nDimension – IN.
pNumber of samples – IN.
lowerBoundLower bounds – IN.
upperBoundUpper bounds – IN.
seedSeed – IN (Opt) (default = 2920).

Member Function Documentation

ArrayOfDouble LHS::getLowerBound ( ) const
inline

Get lower bound.

Returns
Lower bound as ArrayOfDouble.

Definition at line 64 of file LHS.hpp.

64 { return _lowerBound; }
ArrayOfDouble _lowerBound
lower bounds
Definition: LHS.hpp:29
int LHS::getSeed ( void  ) const
inline

Get seed for random generation.

Returns
Seed.

Definition at line 52 of file LHS.hpp.

52 { return _seed; }
int _seed
seed
Definition: LHS.hpp:31
ArrayOfDouble LHS::getUpperBound ( void  ) const
inline

Get upper bound.

Returns
Upper bound as ArrayOfDouble.

Definition at line 76 of file LHS.hpp.

76 { return _upperBound; }
ArrayOfDouble _upperBound
upper bounds
Definition: LHS.hpp:30
static std::vector<size_t> LHS::Permutation ( const size_t  p)
static

Random permutation of the vector (1, 2, .., p)

Parameters
pNumber of positive integers elements in series – .
Returns
Vector of positive integers
std::vector<Point> LHS::Sample ( ) const

Do the sampling.

Returns
A vector Points.
void LHS::setLowerBound ( const ArrayOfDouble  lowerBound)
inline

Set lower bound.

Parameters
lowerBoundAn ArrayOfDouble for lower bound – .

Definition at line 70 of file LHS.hpp.

70 { _lowerBound = lowerBound; }
ArrayOfDouble _lowerBound
lower bounds
Definition: LHS.hpp:29
void LHS::setSeed ( const int  seed)
inline

Set seed for random generation.

Parameters
seedRandom generation seed – IN.

Definition at line 58 of file LHS.hpp.

58 { _seed = seed; }
int _seed
seed
Definition: LHS.hpp:31
void LHS::setUpperBound ( const ArrayOfDouble  upperBound)
inline

Set upper bound.

Parameters
upperBoundAn ArrayOfDouble for upper bound – .

Definition at line 82 of file LHS.hpp.

82 { _upperBound = upperBound; }
ArrayOfDouble _upperBound
upper bounds
Definition: LHS.hpp:30

Member Data Documentation

ArrayOfDouble LHS::_lowerBound
private

lower bounds

Definition at line 29 of file LHS.hpp.

size_t LHS::_n
private

dimension

Definition at line 27 of file LHS.hpp.

size_t LHS::_p
private

number of samples

Definition at line 28 of file LHS.hpp.

int LHS::_seed
private

seed

Definition at line 31 of file LHS.hpp.

ArrayOfDouble LHS::_upperBound
private

upper bounds

Definition at line 30 of file LHS.hpp.


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