Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type Struct Reference

Parameter set for the distribution. More...

#include <PRNGDistribution.hpp>

Public Types

using distribution_type = PiecewiseConstantDistribution< RealType >
 

Public Member Functions

 param_type ()
 Default constructor. Creates uniform distribution over [0, 1).
 
template<typename InputIteratorB , typename InputIteratorW >
 param_type (InputIteratorB first_b, InputIteratorB last_b, InputIteratorW first_w)
 Constructs from interval boundaries and density weights.
 
template<typename UnaryOperation >
 param_type (std::initializer_list< RealType > bl, UnaryOperation fw)
 Constructs from interval boundaries and weight function.
 
template<typename UnaryOperation >
 param_type (size_t nw, RealType xmin, RealType xmax, UnaryOperation fw)
 Constructs with evenly-spaced intervals and weight function.
 
std::vector< RealType > intervals () const
 Returns the interval boundaries.
 
std::vector< double > densities () const
 Returns the density values for each interval.
 

Public Attributes

std::vector< RealType > m_int
 Interval boundaries.
 
std::vector< double > m_den
 Normalized densities for each interval.
 
std::vector< double > m_cp
 Cumulative probabilities for sampling.
 

Friends

class PiecewiseConstantDistribution< RealType >
 
bool operator== (const param_type &lhs, const param_type &rhs)
 
bool operator!= (const param_type &lhs, const param_type &rhs)
 

Detailed Description

template<typename RealType = double>
struct Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type

Parameter set for the distribution.

Stores interval boundaries, density values, and cumulative probabilities for efficient sampling.

Member Typedef Documentation

◆ distribution_type

template<typename RealType = double>
using Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::distribution_type = PiecewiseConstantDistribution<RealType>

Constructor & Destructor Documentation

◆ param_type() [1/4]

template<typename RealType = double>
Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::param_type ( )
inline

Default constructor. Creates uniform distribution over [0, 1).

◆ param_type() [2/4]

template<typename RealType = double>
template<typename InputIteratorB , typename InputIteratorW >
Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::param_type ( InputIteratorB  first_b,
InputIteratorB  last_b,
InputIteratorW  first_w 
)
inline

Constructs from interval boundaries and density weights.

The density for interval i is given by the i-th weight. Weights are normalized automatically.

Template Parameters
InputIteratorBIterator type for boundaries
InputIteratorWIterator type for weights
Parameters
first_bIterator to first boundary
last_bIterator past last boundary (n+1 boundaries for n intervals)
first_wIterator to first weight (n weights for n intervals)

◆ param_type() [3/4]

template<typename RealType = double>
template<typename UnaryOperation >
Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::param_type ( std::initializer_list< RealType >  bl,
UnaryOperation  fw 
)
inline

Constructs from interval boundaries and weight function.

Evaluates the weight function at the midpoint of each interval.

Template Parameters
UnaryOperationFunction type: RealType -> double
Parameters
blInitializer list of interval boundaries
fwWeight function evaluated at interval midpoints

◆ param_type() [4/4]

template<typename RealType = double>
template<typename UnaryOperation >
Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::param_type ( size_t  nw,
RealType  xmin,
RealType  xmax,
UnaryOperation  fw 
)
inline

Constructs with evenly-spaced intervals and weight function.

Creates nw intervals of equal width between xmin and xmax, evaluating the weight function at each interval's midpoint.

Template Parameters
UnaryOperationFunction type: RealType -> double
Parameters
nwNumber of intervals
xminMinimum boundary value
xmaxMaximum boundary value
fwWeight function evaluated at interval midpoints

Member Function Documentation

◆ densities()

template<typename RealType = double>
std::vector< double > Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::densities ( ) const
inline

Returns the density values for each interval.

Returns
Vector of normalized densities

◆ intervals()

template<typename RealType = double>
std::vector< RealType > Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::intervals ( ) const
inline

Returns the interval boundaries.

Returns
Vector of interval boundary values

Friends And Related Symbol Documentation

◆ operator!=

template<typename RealType = double>
bool operator!= ( const param_type lhs,
const param_type rhs 
)
friend

◆ operator==

template<typename RealType = double>
bool operator== ( const param_type lhs,
const param_type rhs 
)
friend

◆ PiecewiseConstantDistribution< RealType >

template<typename RealType = double>
friend class PiecewiseConstantDistribution< RealType >
friend

Member Data Documentation

◆ m_cp

template<typename RealType = double>
std::vector<double> Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::m_cp

Cumulative probabilities for sampling.

◆ m_den

template<typename RealType = double>
std::vector<double> Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::m_den

Normalized densities for each interval.

◆ m_int

template<typename RealType = double>
std::vector<RealType> Infinity::Engine::PiecewiseConstantDistribution< RealType >::param_type::m_int

Interval boundaries.