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

Parameter set for the distribution. More...

#include <PRNGDistribution.hpp>

Public Types

using distribution_type = BinomialDistribution< IntType >
 

Public Member Functions

 param_type ()
 Default constructor. Creates parameters for single trial (t=1, p=0.5).
 
 param_type (IntType t, double p=0.5)
 Constructs parameters.
 
IntType t () const
 Gets the number of trials.
 
double p () const
 Gets the success probability.
 

Friends

bool operator== (const param_type &lhs, const param_type &rhs)
 
bool operator!= (const param_type &lhs, const param_type &rhs)
 

Detailed Description

template<typename IntType = int>
struct Infinity::Engine::BinomialDistribution< IntType >::param_type

Parameter set for the distribution.

Stores the number of trials and success probability.

Member Typedef Documentation

◆ distribution_type

template<typename IntType = int>
using Infinity::Engine::BinomialDistribution< IntType >::param_type::distribution_type = BinomialDistribution<IntType>

Constructor & Destructor Documentation

◆ param_type() [1/2]

template<typename IntType = int>
Infinity::Engine::BinomialDistribution< IntType >::param_type::param_type ( )
inline

Default constructor. Creates parameters for single trial (t=1, p=0.5).

◆ param_type() [2/2]

template<typename IntType = int>
Infinity::Engine::BinomialDistribution< IntType >::param_type::param_type ( IntType  t,
double  p = 0.5 
)
inlineexplicit

Constructs parameters.

Parameters
tNumber of trials (must be >= 0)
pProbability of success per trial, must be in [0, 1]

Member Function Documentation

◆ p()

template<typename IntType = int>
double Infinity::Engine::BinomialDistribution< IntType >::param_type::p ( ) const
inline

Gets the success probability.

◆ t()

template<typename IntType = int>
IntType Infinity::Engine::BinomialDistribution< IntType >::param_type::t ( ) const
inline

Gets the number of trials.

Friends And Related Symbol Documentation

◆ operator!=

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

◆ operator==

template<typename IntType = int>
bool operator== ( const param_type lhs,
const param_type rhs 
)
friend