OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Uniform< T > Class Template Reference

#include <Uniform.h>

Inheritance diagram for Uniform< T >:
Collaboration diagram for Uniform< T >:

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 (std::shared_ptr< SampleIndividual > &ind, size_t i)
void allocate (const CmdArguments_t &, const Comm::Bundle_t &comm)
getNext ()

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 ( T lower,
T upper )
inline

Definition at line 40 of file Uniform.h.

References dist_m, RNGInstance_m, and seed_m.

◆ Uniform() [2/2]

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

Definition at line 46 of file Uniform.h.

References dist_m, RNGInstance_m, and seed_m.

◆ ~Uniform()

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

Definition at line 52 of file Uniform.h.

References RNGStream::deleteInstance(), and 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, RNGInstance_m, and seed_m.

Here is the call graph for this function:

◆ create()

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

Implements SamplingMethod.

Definition at line 57 of file Uniform.h.

References dist_m, and RNGInstance_m.

◆ getNext()

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

Definition at line 66 of file Uniform.h.

References dist_m, and RNGInstance_m.

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 create(), getNext(), Uniform(), and Uniform().

◆ RNGInstance_m

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

Definition at line 73 of file Uniform.h.

Referenced by allocate(), create(), getNext(), Uniform(), Uniform(), and ~Uniform().

◆ seed_m

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

Definition at line 75 of file Uniform.h.

Referenced by allocate(), Uniform(), and Uniform().


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