Skip to main content

Constant Distribution

The Constant distribution returns a constant value. This can be used in situations where the user may not want to apply a distribution. The constant value is provided by the user.

Constructor

ConstantDistribution(double v);

Parameters

  • v (double) The constant value this distribution will prodcue.

getNextDouble

double getNextDouble();

Return the next double in the distribution.

Parameters

  • returns (double) The next double in the distribution

getMean

double getMean();

Return the mean of the distribution, in this case, the constant value.

Parameters

  • returns (double) The mean of the distribution

Example

SST::RNG::ConstantDistribution* dist = new SST::RNG::ConstantDistribution(5.0);

double next;
next = dist->getNextDouble();
#include <sst/core/rng/constant.h>