STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
uniform_real< _Ty > Class Template Reference
Inheritance diagram for uniform_real< _Ty >:
uniform_real_distribution< _Ty >

Classes

struct  param_type
 

Public Types

typedef uniform_real< _Ty > _Myt
 
typedef _Ty result_type
 

Public Member Functions

 uniform_real (_Ty _Min0=_Ty(0), _Ty _Max0=_Ty(1))
 
 uniform_real (const param_type &_Par0)
 
result_type a () const
 
result_type b () const
 
param_type param () const
 
void param (const param_type &_Par0)
 
result_type() min () const
 
result_type() max () const
 
void reset ()
 
template<class _Engine >
result_type operator() (_Engine &_Eng) const
 
template<class _Engine >
result_type operator() (_Engine &_Eng, const param_type &_Par0) const
 
template<class _Elem , class _Traits >
basic_istream< _Elem, _Traits > & _Read (basic_istream< _Elem, _Traits > &_Istr)
 
template<class _Elem , class _Traits >
basic_ostream< _Elem, _Traits > & _Write (basic_ostream< _Elem, _Traits > &_Ostr) const
 

Private Member Functions

template<class _Engine >
result_type _Eval (_Engine &_Eng, const param_type &_Par0) const
 

Private Attributes

param_type _Par
 

Member Typedef Documentation

template<class _Ty = double>
typedef uniform_real<_Ty> uniform_real< _Ty >::_Myt
template<class _Ty = double>
typedef _Ty uniform_real< _Ty >::result_type

Constructor & Destructor Documentation

template<class _Ty = double>
uniform_real< _Ty >::uniform_real ( _Ty  _Min0 = _Ty(0),
_Ty  _Max0 = _Ty(1) 
)
inlineexplicit
3262  : _Par(_Min0, _Max0)
3263  { // construct
3264  }
param_type _Par
Definition: random:3347
template<class _Ty = double>
uniform_real< _Ty >::uniform_real ( const param_type _Par0)
inlineexplicit
3267  : _Par(_Par0)
3268  { // construct from parameter package
3269  }
param_type _Par
Definition: random:3347

Member Function Documentation

template<class _Ty = double>
template<class _Engine >
result_type uniform_real< _Ty >::_Eval ( _Engine &  _Eng,
const param_type _Par0 
) const
inlineprivate
3343  { // return next value
3344  return (_NRAND(_Eng, _Ty) * (_Par0._Max - _Par0._Min) + _Par0._Min);
3345  }
#define _NRAND(eng, resty)
Definition: random:323
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& uniform_real< _Ty >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
3321  { // read state from _Istr
3322  _Ty _Min0;
3323  _Ty _Max0;
3324  _In(_Istr, _Min0);
3325  _In(_Istr, _Max0);
3326  _Par._Init(_Min0, _Max0);
3327  return (_Istr);
3328  }
void _Init(_Ty _Min0, _Ty _Max0)
Definition: random:3247
param_type _Par
Definition: random:3347
basic_istream< _Elem, _Traits > & _In(basic_istream< _Elem, _Traits > &_Is, _Ty &_Dx)
Definition: random:133
template<class _Ty = double>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& uniform_real< _Ty >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
3334  { // write state to _Ostr
3335  _Out(_Ostr, _Par._Min);
3336  _Out(_Ostr, _Par._Max);
3337  return (_Ostr);
3338  }
result_type _Max
Definition: random:3257
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:151
param_type _Par
Definition: random:3347
result_type _Min
Definition: random:3256
template<class _Ty = double>
result_type uniform_real< _Ty >::a ( ) const
inline
3272  { // return a value
3273  return (_Par.a());
3274  }
param_type _Par
Definition: random:3347
result_type a() const
Definition: random:3237
template<class _Ty = double>
result_type uniform_real< _Ty >::b ( ) const
inline
3277  { // return b value
3278  return (_Par.b());
3279  }
result_type b() const
Definition: random:3242
param_type _Par
Definition: random:3347
template<class _Ty = double>
result_type() uniform_real< _Ty >::max ( ) const
inline
3297  { // return maximum possible generated value
3298  return (_Par._Max);
3299  }
result_type _Max
Definition: random:3257
param_type _Par
Definition: random:3347
template<class _Ty = double>
result_type() uniform_real< _Ty >::min ( ) const
inline
3292  { // return minimum possible generated value
3293  return (_Par._Min);
3294  }
param_type _Par
Definition: random:3347
result_type _Min
Definition: random:3256
template<class _Ty = double>
template<class _Engine >
result_type uniform_real< _Ty >::operator() ( _Engine &  _Eng) const
inline
3307  { // return next value
3308  return (_Eval(_Eng, _Par));
3309  }
param_type _Par
Definition: random:3347
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3342
template<class _Ty = double>
template<class _Engine >
result_type uniform_real< _Ty >::operator() ( _Engine &  _Eng,
const param_type _Par0 
) const
inline
3313  { // return next value, given parameter package
3314  return (_Eval(_Eng, _Par0));
3315  }
result_type _Eval(_Engine &_Eng, const param_type &_Par0) const
Definition: random:3342
template<class _Ty = double>
param_type uniform_real< _Ty >::param ( ) const
inline
3282  { // return parameter package
3283  return (_Par);
3284  }
param_type _Par
Definition: random:3347
template<class _Ty = double>
void uniform_real< _Ty >::param ( const param_type _Par0)
inline
3287  { // set parameter package
3288  _Par = _Par0;
3289  }
param_type _Par
Definition: random:3347
template<class _Ty = double>
void uniform_real< _Ty >::reset ( )
inline
3302  { // clear internal state
3303  }

Member Data Documentation

template<class _Ty = double>
param_type uniform_real< _Ty >::_Par
private

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