BioCMAMC-ST
MC::Distributions::Normal< F > Struct Template Reference

Represents a normal (Gaussian) probability distribution. More...

#include <prng_extension.hpp>

Collaboration diagram for MC::Distributions::Normal< F >:
[legend]

Public Member Functions

template<class DeviceType >
KOKKOS_INLINE_FUNCTION F draw (Kokkos::Random_XorShift1024< DeviceType > &gen) const
 Draws a random sample from the distribution.
 
KOKKOS_INLINE_FUNCTION F mean () const
 Returns the mean of the distribution.
 
KOKKOS_INLINE_FUNCTION F var () const
 Returns the variance of the distribution.
 
KOKKOS_INLINE_FUNCTION F stddev () const
 Returns the standard deviation of the distribution.
 
KOKKOS_INLINE_FUNCTION F skewness () const
 Returns the skewness of the distribution.
 

Static Public Member Functions

template<class DeviceType >
static KOKKOS_INLINE_FUNCTION F draw_from (Kokkos::Random_XorShift1024< DeviceType > &gen, F mu, F sigma)
 Static method to draw a sample from N(μ, σ).
 

Public Attributes

mu
 Mean.
 
sigma
 Standard deviation.
 

Detailed Description

template<FloatingPointType F>
struct MC::Distributions::Normal< F >

Represents a normal (Gaussian) probability distribution.

The normal distribution is parameterized by a mean and a standard deviation. It supports random sampling, computing statistical properties.

Template Parameters
FFloating-point type (must satisfy FloatingPointType).

Member Function Documentation

◆ draw()

template<FloatingPointType F>
template<class DeviceType >
KOKKOS_INLINE_FUNCTION F MC::Distributions::Normal< F >::draw ( Kokkos::Random_XorShift1024< DeviceType > & gen) const
inline

Draws a random sample from the distribution.

Template Parameters
DeviceTypeThe Kokkos execution device.
Parameters
genKokkos random number generator.
Returns
A normally distributed random sample.
Here is the call graph for this function:

◆ draw_from()

template<FloatingPointType F>
template<class DeviceType >
static KOKKOS_INLINE_FUNCTION F MC::Distributions::Normal< F >::draw_from ( Kokkos::Random_XorShift1024< DeviceType > & gen,
F mu,
F sigma )
inlinestatic

Static method to draw a sample from N(μ, σ).

Template Parameters
DeviceTypeThe Kokkos execution device.
Parameters
genKokkos random number generator.
muMean of the distribution.
sigmaStandard deviation of the distribution.
Returns
A normally distributed random sample.
Here is the caller graph for this function:

◆ mean()

template<FloatingPointType F>
KOKKOS_INLINE_FUNCTION F MC::Distributions::Normal< F >::mean ( ) const
inline

Returns the mean of the distribution.

Returns
Mean (μ).

◆ skewness()

template<FloatingPointType F>
KOKKOS_INLINE_FUNCTION F MC::Distributions::Normal< F >::skewness ( ) const
inline

Returns the skewness of the distribution.

Returns
Skewness (always 0 for a normal distribution).

◆ stddev()

template<FloatingPointType F>
KOKKOS_INLINE_FUNCTION F MC::Distributions::Normal< F >::stddev ( ) const
inline

Returns the standard deviation of the distribution.

Returns
Standard deviation (σ).

◆ var()

template<FloatingPointType F>
KOKKOS_INLINE_FUNCTION F MC::Distributions::Normal< F >::var ( ) const
inline

Returns the variance of the distribution.

Returns
Variance (σ²).

Member Data Documentation

◆ mu

Mean.

◆ sigma

template<FloatingPointType F>
F MC::Distributions::Normal< F >::sigma

Standard deviation.


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