SST  14.1.0
StructuralSimulationToolkit
SST::RNG::UniformDistribution Class Reference

Creates a Uniform distribution for use within SST. More...

#include "sst/core/rng/uniform.h"

Inheritance diagram for SST::RNG::UniformDistribution:
SST::RNG::RandomDistribution SST::Core::Serialization::serializable SST::Core::Serialization::serializable_base

Public Member Functions

 UniformDistribution (const uint32_t probsCount)
 Creates an uniform distribution with a specific number of bins. More...
 
 UniformDistribution (const uint32_t probsCount, SST::RNG::Random *baseDist)
 Creates a Uniform distribution with a specific number of bins and user supplied random number generator. More...
 
 ~UniformDistribution ()
 Destroys the distribution and will delete locally allocated RNGs.
 
double getNextDouble () override
 Gets the next (random) double value in the distribution. More...
 
 UniformDistribution ()
 Default constructor. More...
 
void serialize_order (SST::Core::Serialization::serializer &ser) override
 Serialization function for checkpoint.
 
- Public Member Functions inherited from SST::RNG::RandomDistribution
virtual ~RandomDistribution ()
 Destroys the distribution.
 
 RandomDistribution ()
 Creates the base (abstract) class of a distribution.
 
virtual void serialize_order (SST::Core::Serialization::serializer &UNUSED(ser)) override
 
- Public Member Functions inherited from SST::Core::Serialization::serializable_base
virtual const char * cls_name () const =0
 
virtual uint32_t cls_id () const =0
 
virtual std::string serialization_name () const =0
 

Data Fields

ImplementSerializable(SST::RNG::UniformDistribution) protected const bool deleteDistrib
 Serialization macro. More...
 
const uint32_t probCount
 Count of discrete probabilities.
 
double probPerBin
 Range 0..1 split into discrete bins.
 

Additional Inherited Members

- Static Public Attributes inherited from SST::Core::Serialization::serializable
static constexpr uint32_t NullClsId = std::numeric_limits<uint32_t>::max()
 
- Static Public Attributes inherited from SST::Core::Serialization::serializable_base
static constexpr uint32_t NullClsId = std::numeric_limits<uint32_t>::max()
 
- Protected Types inherited from SST::Core::Serialization::serializable_base
enum  cxn_flag_t { ConstructorFlag }
 
- Static Protected Member Functions inherited from SST::Core::Serialization::serializable_base
static void serializable_abort (uint32_t line, const char *file, const char *func, const char *obj)
 

Detailed Description

Creates a Uniform distribution for use within SST.

This distribution is the same across platforms and compilers.

Constructor & Destructor Documentation

◆ UniformDistribution() [1/3]

SST::RNG::UniformDistribution::UniformDistribution ( const uint32_t  probsCount)
inline

Creates an uniform distribution with a specific number of bins.

Parameters
probsCountNumber of probability bins in this distribution

◆ UniformDistribution() [2/3]

SST::RNG::UniformDistribution::UniformDistribution ( const uint32_t  probsCount,
SST::RNG::Random baseDist 
)
inline

Creates a Uniform distribution with a specific number of bins and user supplied random number generator.

Parameters
probsCountNumber of probability bins in the distribution
baseDistThe base random number generator to take the distribution from.

◆ UniformDistribution() [3/3]

SST::RNG::UniformDistribution::UniformDistribution ( )
inline

Default constructor.

FOR SERIALIZATION ONLY.

Member Function Documentation

◆ getNextDouble()

double SST::RNG::UniformDistribution::getNextDouble ( )
inlineoverridevirtual

Gets the next (random) double value in the distribution.

Returns
The next random double from the distribution, this is the double converted of the index where the probability is located

Implements SST::RNG::RandomDistribution.

Field Documentation

◆ deleteDistrib

ImplementSerializable (SST::RNG::UniformDistribution) protected const bool SST::RNG::UniformDistribution::deleteDistrib

Serialization macro.

Sets the base random number generator for the distribution. Controls whether the base distribution should be deleted when this class is destructed.


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