Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::triangle_distribution< RealType > Class Template Reference

Instantiations of triangle_distribution model a . More...

#include <triangle_distribution.hpp>

Classes

class  param_type
 

Public Types

typedef RealType input_type
 
typedef RealType result_type
 

Public Member Functions

 triangle_distribution (RealType a_arg=RealType(0.0), RealType b_arg=RealType(0.5), RealType c_arg=RealType(1.0))
 Constructs a triangle_distribution with the parameters a, b, and c. More...
 
 triangle_distribution (const param_type &parm)
 Constructs a triangle_distribution from its parameters. More...
 
result_type a () const
 Returns the a parameter of the distribution. More...
 
result_type b () const
 Returns the b parameter of the distribution. More...
 
result_type c () const
 Returns the c parameter of the distribution. More...
 
RealType min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the smallest value that the distribution can produce. More...
 
RealType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the largest value that the distribution can produce. More...
 
param_type param () const
 Returns the parameters of the distribution. More...
 
void param (const param_type &parm)
 Sets the parameters of the distribution. More...
 
void reset ()
 Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. More...
 
template<class Engine >
result_type operator() (Engine &eng)
 Returns a random variate distributed according to the triangle distribution. More...
 
template<class Engine >
result_type operator() (Engine &eng, const param_type &parm)
 Returns a random variate distributed according to the triangle distribution with parameters specified by param. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, triangle_distribution, td)
 Writes the distribution to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, triangle_distribution, td)
 Reads the distribution from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (triangle_distribution, lhs, rhs)
 Returns true if the two distributions will produce identical sequences of values given equal generators. More...
 

Detailed Description

template<class RealType = double>
class boost::random::triangle_distribution< RealType >

Instantiations of triangle_distribution model a .

A triangle_distribution has three parameters, a, b, and c, which are the smallest, the most probable and the largest values of the distribution respectively.

Member Typedef Documentation

template<class RealType = double>
typedef RealType boost::random::triangle_distribution< RealType >::input_type
template<class RealType = double>
typedef RealType boost::random::triangle_distribution< RealType >::result_type

Constructor & Destructor Documentation

template<class RealType = double>
boost::random::triangle_distribution< RealType >::triangle_distribution ( RealType  a_arg = RealType(0.0),
RealType  b_arg = RealType(0.5),
RealType  c_arg = RealType(1.0) 
)
inlineexplicit

Constructs a triangle_distribution with the parameters a, b, and c.

Preconditions: a <= b <= c.

References BOOST_ASSERT, and boost::unit_test::framework::init().

Referenced by boost::random::triangle_distribution< RealType >::operator()().

template<class RealType = double>
boost::random::triangle_distribution< RealType >::triangle_distribution ( const param_type parm)
inlineexplicit

Constructs a triangle_distribution from its parameters.

References boost::unit_test::framework::init().

Member Function Documentation

template<class RealType = double>
result_type boost::random::triangle_distribution< RealType >::a ( ) const
inline

Returns the a parameter of the distribution.

template<class RealType = double>
result_type boost::random::triangle_distribution< RealType >::b ( ) const
inline

Returns the b parameter of the distribution.

template<class RealType = double>
RealType min boost::random::triangle_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the smallest value that the distribution can produce.

template<class RealType = double>
RealType max boost::random::triangle_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the largest value that the distribution can produce.

template<class RealType = double>
boost::random::triangle_distribution< RealType >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( triangle_distribution< RealType >  ,
lhs  ,
rhs   
)
inline

Returns true if the two distributions will produce identical sequences of values given equal generators.

template<class RealType = double>
boost::random::triangle_distribution< RealType >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
triangle_distribution< RealType >  ,
td   
)
inline

Reads the distribution from a std::istream.

template<class RealType = double>
boost::random::triangle_distribution< RealType >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
triangle_distribution< RealType >  ,
td   
)
inline

Writes the distribution to a std::ostream.

template<class RealType = double>
result_type boost::random::triangle_distribution< RealType >::c ( ) const
inline

Returns the c parameter of the distribution.

template<class RealType = double>
template<class Engine >
result_type boost::random::triangle_distribution< RealType >::operator() ( Engine &  eng)
inline

Returns a random variate distributed according to the triangle distribution.

References boost::geometry::math::sqrt().

template<class RealType = double>
template<class Engine >
result_type boost::random::triangle_distribution< RealType >::operator() ( Engine &  eng,
const param_type parm 
)
inline

Returns a random variate distributed according to the triangle distribution with parameters specified by param.

References boost::random::triangle_distribution< RealType >::triangle_distribution().

template<class RealType = double>
param_type boost::random::triangle_distribution< RealType >::param ( ) const
inline

Returns the parameters of the distribution.

References boost::random::triangle_distribution< RealType >::param_type::param_type().

template<class RealType = double>
void boost::random::triangle_distribution< RealType >::reset ( void  )
inline

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.


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