OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
LatinHyperCube Class Reference

#include <LatinHyperCube.h>

Inheritance diagram for LatinHyperCube:
Inheritance graph
[legend]
Collaboration diagram for LatinHyperCube:
Collaboration graph
[legend]

Public Types

typedef std::uniform_real_distribution< double > dist_t
 

Public Member Functions

 LatinHyperCube (double lower, double upper)
 
 LatinHyperCube (double lower, double upper, int seed)
 
 ~LatinHyperCube ()
 
void create (boost::shared_ptr< SampleIndividual > &ind, std::size_t i)
 
void allocate (const CmdArguments_t &args, const Comm::Bundle_t &comm)
 
- Public Member Functions inherited from SamplingMethod
virtual ~SamplingMethod ()
 
virtual void create (boost::shared_ptr< SampleIndividual > &ind, size_t i)=0
 

Private Member Functions

double map2domain_m (double val)
 
void fillBins_m (std::size_t nTotal, std::size_t nLocal, int startBin, std::size_t seed)
 

Private Attributes

std::deque< std::size_t > bin_m
 
double binsize_m
 
double upper_m
 
double lower_m
 
dist_t dist_m
 
RNGStreamRNGInstance_m
 
std::size_t seed_m
 

Detailed Description

Definition at line 30 of file LatinHyperCube.h.

Member Typedef Documentation

◆ dist_t

typedef std::uniform_real_distribution<double> LatinHyperCube::dist_t

Definition at line 34 of file LatinHyperCube.h.

Constructor & Destructor Documentation

◆ LatinHyperCube() [1/2]

LatinHyperCube::LatinHyperCube ( double  lower,
double  upper 
)
inline

Definition at line 36 of file LatinHyperCube.h.

◆ LatinHyperCube() [2/2]

LatinHyperCube::LatinHyperCube ( double  lower,
double  upper,
int  seed 
)
inline

Definition at line 45 of file LatinHyperCube.h.

◆ ~LatinHyperCube()

LatinHyperCube::~LatinHyperCube ( )
inline

Definition at line 54 of file LatinHyperCube.h.

References RNGStream::deleteInstance(), and RNGInstance_m.

Here is the call graph for this function:

Member Function Documentation

◆ allocate()

void LatinHyperCube::allocate ( const CmdArguments_t ,
const Comm::Bundle_t  
)
inlinevirtual

Allocate memory for sampling. Not every sampling method requires that.

This function is used to reduce memory since only the sampler ranks need these sampling methods.

Parameters
argssamler arguments
commsampler communicator

Reimplemented from SamplingMethod.

Definition at line 66 of file LatinHyperCube.h.

References binsize_m, fillBins_m(), RNGStream::getInstance(), Comm::Bundle_t::island_id, lower_m, RNGInstance_m, seed_m, and upper_m.

Here is the call graph for this function:

◆ create()

void LatinHyperCube::create ( boost::shared_ptr< SampleIndividual > &  ind,
std::size_t  i 
)
inline

Definition at line 59 of file LatinHyperCube.h.

References dist_m, RNGStream::getNext(), map2domain_m(), and RNGInstance_m.

Here is the call graph for this function:

◆ fillBins_m()

void LatinHyperCube::fillBins_m ( std::size_t  nTotal,
std::size_t  nLocal,
int  startBin,
std::size_t  seed 
)
inlineprivate

Definition at line 116 of file LatinHyperCube.h.

References bin_m, and Options::seed.

Referenced by allocate().

◆ map2domain_m()

double LatinHyperCube::map2domain_m ( double  val)
inlineprivate

Definition at line 99 of file LatinHyperCube.h.

References bin_m, binsize_m, and lower_m.

Referenced by create().

Member Data Documentation

◆ bin_m

std::deque<std::size_t> LatinHyperCube::bin_m
private

Definition at line 134 of file LatinHyperCube.h.

Referenced by fillBins_m(), and map2domain_m().

◆ binsize_m

double LatinHyperCube::binsize_m
private

Definition at line 135 of file LatinHyperCube.h.

Referenced by allocate(), and map2domain_m().

◆ dist_m

dist_t LatinHyperCube::dist_m
private

Definition at line 140 of file LatinHyperCube.h.

Referenced by create().

◆ lower_m

double LatinHyperCube::lower_m
private

Definition at line 138 of file LatinHyperCube.h.

Referenced by allocate(), and map2domain_m().

◆ RNGInstance_m

RNGStream* LatinHyperCube::RNGInstance_m
private

Definition at line 142 of file LatinHyperCube.h.

Referenced by allocate(), create(), and ~LatinHyperCube().

◆ seed_m

std::size_t LatinHyperCube::seed_m
private

Definition at line 144 of file LatinHyperCube.h.

Referenced by allocate().

◆ upper_m

double LatinHyperCube::upper_m
private

Definition at line 137 of file LatinHyperCube.h.

Referenced by allocate().


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