OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Types | Public Member Functions | Private Attributes | List of all members
Uniform< T > Class Template Reference

#include <Uniform.h>

Inheritance diagram for Uniform< T >:
Inheritance graph
[legend]
Collaboration diagram for Uniform< T >:
Collaboration graph
[legend]

Public Types

typedef std::conditional< std::is_integral< T >::value, std::uniform_int_distribution< T >, std::uniform_real_distribution< T > >::type dist_t
 

Public Member Functions

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

Private Attributes

dist_t dist_m
 
RNGStreamRNGInstance_m
 
std::size_t seed_m
 

Detailed Description

template<typename T>
class Uniform< T >

Definition at line 30 of file Uniform.h.

Member Typedef Documentation

◆ dist_t

template<typename T >
typedef std::conditional<std::is_integral<T>::value,std::uniform_int_distribution<T>,std::uniform_real_distribution<T>>::type Uniform< T >::dist_t

Definition at line 38 of file Uniform.h.

Constructor & Destructor Documentation

◆ Uniform() [1/2]

template<typename T >
Uniform< T >::Uniform ( lower,
upper 
)
inline

Definition at line 40 of file Uniform.h.

◆ Uniform() [2/2]

template<typename T >
Uniform< T >::Uniform ( lower,
upper,
std::size_t  seed 
)
inline

Definition at line 46 of file Uniform.h.

◆ ~Uniform()

template<typename T >
Uniform< T >::~Uniform ( )
inline

Definition at line 52 of file Uniform.h.

References RNGStream::deleteInstance(), and Uniform< T >::RNGInstance_m.

Here is the call graph for this function:

Member Function Documentation

◆ allocate()

template<typename T >
void Uniform< T >::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 61 of file Uniform.h.

References RNGStream::getInstance(), Comm::Bundle_t::island_id, Uniform< T >::RNGInstance_m, and Uniform< T >::seed_m.

Referenced by SampleRandomizedSequence< T >::allocate().

Here is the call graph for this function:

◆ create()

template<typename T >
void Uniform< T >::create ( boost::shared_ptr< SampleIndividual > &  ind,
size_t  i 
)
inlinevirtual

Implements SamplingMethod.

Definition at line 57 of file Uniform.h.

References Uniform< T >::dist_m, RNGStream::getNext(), and Uniform< T >::RNGInstance_m.

Here is the call graph for this function:

◆ getNext()

template<typename T >
T Uniform< T >::getNext ( )
inline

Definition at line 66 of file Uniform.h.

References Uniform< T >::dist_m, RNGStream::getNext(), and Uniform< T >::RNGInstance_m.

Referenced by SampleRandomizedSequence< T >::create().

Here is the call graph for this function:

Member Data Documentation

◆ dist_m

template<typename T >
dist_t Uniform< T >::dist_m
private

Definition at line 71 of file Uniform.h.

Referenced by Uniform< T >::create(), and Uniform< T >::getNext().

◆ RNGInstance_m

template<typename T >
RNGStream* Uniform< T >::RNGInstance_m
private

◆ seed_m

template<typename T >
std::size_t Uniform< T >::seed_m
private

Definition at line 75 of file Uniform.h.

Referenced by Uniform< T >::allocate().


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