...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::random::hyperexponential_distribution::param_type
// In header: <boost/random/hyperexponential_distribution.hpp> class param_type { public: // types typedef hyperexponential_distribution distribution_type; // construct/copy/destruct param_type(); template<typename ProbIterT, typename RateIterT> param_type(ProbIterT, ProbIterT, RateIterT, RateIterT); template<typename ProbRangeT, typename RateRangeT> param_type(ProbRangeT const &, RateRangeT const &, typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type * = 0); template<typename RateIterT> param_type(RateIterT, RateIterT, typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type * = 0); template<typename RateRangeT> param_type(RateRangeT const &); param_type(std::initializer_list< RealT >, std::initializer_list< RealT >); param_type(std::initializer_list< RealT >); // public member functions std::vector< RealT > probabilities() const; std::vector< RealT > rates() const; // friend functions template<typename CharT, typename Traits> std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &, const param_type &); template<typename CharT, typename Traits> std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > &, const param_type &); bool operator==(const param_type &, const param_type &); bool operator!=(const param_type &, const param_type &); };
The parameters of a hyperexponential distribution.
Stores the phase probability vector and the rate vector of the hyperexponential distribution.
Marco Guazzone (marco.guazzone@gmail.com)
param_type
public
construct/copy/destructparam_type();
Constructs a
with the default parameters of the distribution. param_type
template<typename ProbIterT, typename RateIterT> param_type(ProbIterT prob_first, ProbIterT prob_last, RateIterT rate_first, RateIterT rate_last);
Constructs a
from the phase probability vector and rate vector parameters of the distribution.param_type
The phase probability vector parameter is given by the range defined by [prob_first, prob_last) iterator pair, and the rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair.
References:
ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014
Parameters: |
|
||||||||
Template Parameters: |
|
template<typename ProbRangeT, typename RateRangeT> param_type(ProbRangeT const & prob_range, RateRangeT const & rate_range, typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type * = 0);
Constructs a
from the phase probability vector and rate vector parameters of the distribution.param_type
The phase probability vector parameter is given by the range defined by prob_range, and the rate vector parameter is given by the range defined by rate_range.
Note | |
---|---|
The final |
Parameters: |
|
||||
Template Parameters: |
template<typename RateIterT> param_type(RateIterT rate_first, RateIterT rate_last, typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type * = 0);
Constructs a
from the rate vector parameter of the distribution and with equal phase probabilities.param_type
The rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length of the rate vector and with each element set to ).
Note | |
---|---|
The final |
References:
ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014
Parameters: |
|
||||
Template Parameters: |
|
template<typename RateRangeT> param_type(RateRangeT const & rate_range);
Constructs a
from the "rates" parameters of the distribution and with equal phase probabilities.param_type
The rate vector parameter is given by the range defined by rate_range, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length of the rate vector and with each element set to ).
Parameters: |
|
||
Template Parameters: |
|
param_type(std::initializer_list< RealT > l1, std::initializer_list< RealT > l2);
Constructs a
from the phase probability vector and rate vector parameters of the distribution.param_type
The phase probability vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l2.
References:
ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014
Parameters: |
|
param_type(std::initializer_list< RealT > l1);
Constructs a
from the rate vector parameter of the distribution and with equal phase probabilities.param_type
The rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length of the rate vector and with each element set to ).
References:
ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014
Parameters: |
|
param_type
public member functionsstd::vector< RealT > probabilities() const;
Gets the phase probability vector parameter of the distribtuion.
Note | |
---|---|
The returned probabilities are the normalized version of the ones passed at construction time. |
Returns: |
The phase probability vector parameter of the distribution. |
std::vector< RealT > rates() const;
Gets the rate vector parameter of the distribtuion.
Returns: |
The rate vector parameter of the distribution. |
param_type
friend functionstemplate<typename CharT, typename Traits> std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > & os, const param_type & param);
Writes a
to a param_type
std::ostream
.
template<typename CharT, typename Traits> std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > & is, const param_type & param);
Reads a
from a param_type
std::istream
.
bool operator==(const param_type & lhs, const param_type & rhs);
Returns true if the two sets of parameters are the same.
bool operator!=(const param_type & lhs, const param_type & rhs);
Returns true if the two sets of parameters are the different.