NetDEM v1.0
Loading...
Searching...
No Matches
netdem::UniformDistribution Class Reference

Generates random numbers from a uniform distribution. More...

#include <distribution_uniform.hpp>

Inheritance diagram for netdem::UniformDistribution:
netdem::Distribution

Public Member Functions

 UniformDistribution ()
 Default constructor.
 
 UniformDistribution (double bound_min, double bound_max)
 Constructor that takes bounds as input parameters.
 
double Get () override
 Get a single random number from the uniform distribution.
 
VecXT< double > Get (int num) override
 Get multiple random numbers from the uniform distribution.
 
- Public Member Functions inherited from netdem::Distribution
virtual ~Distribution ()
 

Public Attributes

double bound_min
 Lower and upper bounds of the uniform distribution.
 
double bound_max
 

Detailed Description

Constructor & Destructor Documentation

◆ UniformDistribution() [1/2]

netdem::UniformDistribution::UniformDistribution ( )
inline

Default constructor.

This constructor initializes the lower and upper bounds of the uniform distribution to 0 and 1, respectively. It also initializes the random number generator and distribution.

◆ UniformDistribution() [2/2]

netdem::UniformDistribution::UniformDistribution ( double bound_min,
double bound_max )
inline

Constructor that takes bounds as input parameters.

This constructor initializes the lower and upper bounds of the uniform distribution to the values passed in via bound_min and bound_max, respectively. It also initializes the random number generator and distribution.

Parameters
bound_minThe lower bound of the uniform distribution.
bound_maxThe upper bound of the uniform distribution.

Member Function Documentation

◆ Get() [1/2]

double netdem::UniformDistribution::Get ( )
inlineoverridevirtual

◆ Get() [2/2]

VecXT< double > netdem::UniformDistribution::Get ( int num)
inlineoverridevirtual

Get multiple random numbers from the uniform distribution.

This method generates num random numbers from the uniform distribution and returns them as a vector.

Parameters
numThe number of random numbers to generate.
Returns
A vector containing num random numbers generated from the uniform distribution.

Implements netdem::Distribution.

Member Data Documentation

◆ bound_max

double netdem::UniformDistribution::bound_max

◆ bound_min

double netdem::UniformDistribution::bound_min

Lower and upper bounds of the uniform distribution.


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