Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::InverseSquareDistribution< RealType > Class Template Reference

Sample \( 1/x^2 \) over a given domain. More...

#include <InverseSquareDistribution.hh>

Public Types

Type aliases
using real_type = RealType
 
using result_type = real_type
 

Public Member Functions

CELER_FUNCTION InverseSquareDistribution (real_type a, real_type b)
 Construct on the interval [a, b). More...
 
template<class Generator >
CELER_FUNCTION result_type operator() (Generator &rng) const
 
template<class Generator >
CELER_FUNCTION auto operator() (Generator &rng) const -> result_type
 Sample a random number according to the distribution.
 

Detailed Description

template<class RealType = ::celeritas::real_type>
class celeritas::InverseSquareDistribution< RealType >

Sample \( 1/x^2 \) over a given domain.

This distribution is defined on a positive range \( [a, b) \) and has the normalized PDF:

\[ f(x; a, b) = \frac{a b}{x^2 (b - a)} \quad \mathrm{for} \ a \le x < b \]

which integrated into a CDF and inverted gives a sample:

\[ x = \frac{a b}{a + \xi (b - a)} \]

Constructor & Destructor Documentation

◆ InverseSquareDistribution()

template<class RealType >
CELER_FUNCTION celeritas::InverseSquareDistribution< RealType >::InverseSquareDistribution ( real_type  a,
real_type  b 
)
inline

Construct on the interval [a, b).

As with UniformRealDistribution, it is allowable for the two bounds to be out of order.


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