BioDynaMo  v1.03.58-27764645
Public Member Functions | Protected Member Functions | List of all members
bdm::DistributionRng< TSample > Class Template Referenceabstract

Random number generator that generates samples from a distribution. More...

#include <random.h>

Public Member Functions

 DistributionRng ()=default
 
 DistributionRng (TRootIOCtor *)
 
virtual ~DistributionRng ()=default
 
TSample Sample ()
 Draws a sample from the distribution. More...
 
MathArray< TSample, 2 > Sample2 ()
 
MathArray< TSample, 3 > Sample3 ()
 
template<uint64_t N>
MathArray< TSample, N > SampleArray ()
 

Protected Member Functions

virtual TSample SampleImpl (TRandom *rng)=0
 
virtual MathArray< TSample, 2 > Sample2Impl (TRandom *rng)
 
virtual MathArray< TSample, 3 > Sample3Impl (TRandom *rng)
 
 BDM_CLASS_DEF (DistributionRng, 1)
 

Detailed Description

template<typename TSample>
class bdm::DistributionRng< TSample >

Random number generator that generates samples from a distribution.

Definition at line 33 of file random.h.

Constructor & Destructor Documentation

◆ DistributionRng() [1/2]

template<typename TSample >
bdm::DistributionRng< TSample >::DistributionRng ( )
default

◆ DistributionRng() [2/2]

template<typename TSample >
bdm::DistributionRng< TSample >::DistributionRng ( TRootIOCtor *  )
inline

Definition at line 36 of file random.h.

◆ ~DistributionRng()

template<typename TSample >
virtual bdm::DistributionRng< TSample >::~DistributionRng ( )
virtualdefault

Member Function Documentation

◆ BDM_CLASS_DEF()

template<typename TSample >
bdm::DistributionRng< TSample >::BDM_CLASS_DEF ( DistributionRng< TSample >  ,
 
)
protected

◆ Sample()

template<typename TSample >
template int bdm::DistributionRng< TSample >::Sample ( )

Draws a sample from the distribution.

Definition at line 133 of file random.cc.

◆ Sample2()

template<typename TSample >
template MathArray< int, 2 > bdm::DistributionRng< TSample >::Sample2 ( )

Draws two samples from the distribution. For 1D distributions this function calls Sample() twice.

Definition at line 142 of file random.cc.

◆ Sample2Impl()

template<typename TSample >
template MathArray< int, 2 > bdm::DistributionRng< TSample >::Sample2Impl ( TRandom *  rng)
protectedvirtual

Reimplemented in bdm::UserDefinedDistRng3D, and bdm::UserDefinedDistRng2D.

Definition at line 151 of file random.cc.

◆ Sample3()

template<typename TSample >
template MathArray< int, 3 > bdm::DistributionRng< TSample >::Sample3 ( )

Draws three samples from the distribution. For 1D and 2D distributions this function calls Sample() three times.

Definition at line 159 of file random.cc.

◆ Sample3Impl()

template<typename TSample >
template MathArray< int, 3 > bdm::DistributionRng< TSample >::Sample3Impl ( TRandom *  rng)
protectedvirtual

Reimplemented in bdm::UserDefinedDistRng3D.

Definition at line 168 of file random.cc.

◆ SampleArray()

template<typename TSample >
template<uint64_t N>
MathArray<TSample, N> bdm::DistributionRng< TSample >::SampleArray ( )
inline

Returns an array of samples. Calls Sample() N times.

Definition at line 50 of file random.h.

◆ SampleImpl()

template<typename TSample >
virtual TSample bdm::DistributionRng< TSample >::SampleImpl ( TRandom *  rng)
protectedpure virtual

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