IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
ippl::random::Distribution< T, Dim, DimP, DistributionFunctions > Class Template Reference

The class that represents a distribution. More...

#include <Distribution.h>

Public Member Functions

KOKKOS_INLINE_FUNCTION Distribution (const T *par_p)
 Constructor for the Distribution class.
 
KOKKOS_INLINE_FUNCTION ~Distribution ()
 Destructor for the Distribution class.
 
KOKKOS_INLINE_FUNCTION T getPdf (T x, unsigned int d) const
 A wrapper to change the signature arguments of pdf in each dimension d from (x, d, par) to (x, d).
 
KOKKOS_INLINE_FUNCTION T getCdf (T x, unsigned int d) const
 A wrapper to change the signature arguments of cdf in each dimension d from (x, d, par) to (x, d).
 
KOKKOS_INLINE_FUNCTION T getEstimate (T x, unsigned int d) const
 A wrapper to change the signature arguments of estimate in each dimension d from (x, d, par) to (x, d).
 
KOKKOS_INLINE_FUNCTION T getObjFunc (T x, unsigned int d, T u) const
 
KOKKOS_INLINE_FUNCTION T getDerObjFunc (T x, unsigned int d) const
 
KOKKOS_INLINE_FUNCTION T getFullPdf (ippl::Vector< T, Dim > x) const
 

Public Attributes

par_m [DimP]
 
DistributionFunctions::PDF pdf_m
 
DistributionFunctions::CDF cdf_m
 
DistributionFunctions::Estimate estimate_m
 

Detailed Description

template<typename T, unsigned Dim, unsigned DimP, typename DistributionFunctions>
class ippl::random::Distribution< T, Dim, DimP, DistributionFunctions >

The class that represents a distribution.

Template Parameters
TDatatype.
DimDimensionality of sample space.
DimPDimensionality of the parameter array.
PDFStruct type for the PDF (Probability Density Function).
CDFStruct type for the CDF (Cumulative Distribution Function).
ESTIMATEStruct type for the ESTIMATE function.

Constructor & Destructor Documentation

◆ Distribution()

template<typename T , unsigned Dim, unsigned DimP, typename DistributionFunctions >
KOKKOS_INLINE_FUNCTION ippl::random::Distribution< T, Dim, DimP, DistributionFunctions >::Distribution ( const T *  par_p)
inline

Constructor for the Distribution class.

Parameters
par_Pointer to the parameter array.

Member Function Documentation

◆ getDerObjFunc()

template<typename T , unsigned Dim, unsigned DimP, typename DistributionFunctions >
KOKKOS_INLINE_FUNCTION T ippl::random::Distribution< T, Dim, DimP, DistributionFunctions >::getDerObjFunc ( x,
unsigned int  d 
) const
inline
Returns
Derivative of the objective function that is used in inverse transform sampling, i.e. d(obj)/dx = pdf(x)

◆ getFullPdf()

template<typename T , unsigned Dim, unsigned DimP, typename DistributionFunctions >
KOKKOS_INLINE_FUNCTION T ippl::random::Distribution< T, Dim, DimP, DistributionFunctions >::getFullPdf ( ippl::Vector< T, Dim >  x) const
inline
Returns
Total pdf given uncorrelated pdf in each dimension. i.e. total_pdf = pdf(x_1) * pdf(x_2) * ... pdf(x_N).

◆ getObjFunc()

template<typename T , unsigned Dim, unsigned DimP, typename DistributionFunctions >
KOKKOS_INLINE_FUNCTION T ippl::random::Distribution< T, Dim, DimP, DistributionFunctions >::getObjFunc ( x,
unsigned int  d,
u 
) const
inline
Returns
Objective function that is used in inverse transform sampling, i.e. obj = cdf(x)-u. Here u is uniformly distributed on [0, 1] and x is the sample of target distribution.

Member Data Documentation

◆ par_m

template<typename T , unsigned Dim, unsigned DimP, typename DistributionFunctions >
T ippl::random::Distribution< T, Dim, DimP, DistributionFunctions >::par_m[DimP]
Parameters
par_mAn array of distribution parameters.
pdf_mPDF of the distribution class as a member functor.
cdf_mCDF of the distribution class as a member functor.
estimate_mEstimate of the initial guess for the sampling method as a member functor.

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