NOMAD Source  Version 4.0.0 Beta
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)
 Constructor. 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...
 

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 68 of file LHS.hpp.

Constructor & Destructor Documentation

◆ LHS()

LHS::LHS ( const size_t  n,
const size_t  p,
const ArrayOfDouble  lowerBound,
const ArrayOfDouble  upperBound 
)
explicit

Constructor.

Parameters
nDimension – IN.
pNumber of samples – IN.
lowerBoundLower bounds – IN.
upperBoundUpper bounds – IN.

Member Function Documentation

◆ getLowerBound()

ArrayOfDouble LHS::getLowerBound ( ) const
inline

Get lower bound.

Returns
Lower bound as ArrayOfDouble.

Definition at line 93 of file LHS.hpp.

93 { return _lowerBound; }

◆ getUpperBound()

ArrayOfDouble LHS::getUpperBound ( void  ) const
inline

Get upper bound.

Returns
Upper bound as ArrayOfDouble.

Definition at line 105 of file LHS.hpp.

105 { return _upperBound; }

◆ Permutation()

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 – IN.
Returns
Vector of positive integers

◆ Sample()

std::vector<Point> LHS::Sample ( ) const

Do the sampling.

Returns
A vector Points.

◆ setLowerBound()

void LHS::setLowerBound ( const ArrayOfDouble  lowerBound)
inline

Set lower bound.

Parameters
lowerBoundAn ArrayOfDouble for lower bound – IN.

Definition at line 99 of file LHS.hpp.

99 { _lowerBound = lowerBound; }

◆ setUpperBound()

void LHS::setUpperBound ( const ArrayOfDouble  upperBound)
inline

Set upper bound.

Parameters
upperBoundAn ArrayOfDouble for upper bound – IN.

Definition at line 111 of file LHS.hpp.

111 { _upperBound = upperBound; }

Member Data Documentation

◆ _lowerBound

ArrayOfDouble LHS::_lowerBound
private

lower bounds

Definition at line 73 of file LHS.hpp.

◆ _n

size_t LHS::_n
private

dimension

Definition at line 71 of file LHS.hpp.

◆ _p

size_t LHS::_p
private

number of samples

Definition at line 72 of file LHS.hpp.

◆ _upperBound

ArrayOfDouble LHS::_upperBound
private

upper bounds

Definition at line 74 of file LHS.hpp.


The documentation for this class was generated from the following file:
LHS::_upperBound
ArrayOfDouble _upperBound
upper bounds
Definition: LHS.hpp:74
LHS::_lowerBound
ArrayOfDouble _lowerBound
lower bounds
Definition: LHS.hpp:73