g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::rexp< FLAT, REAL > Class Template Reference

Public Member Functions

 rexp (FLAT &a_flat, REAL a_rate=1)
 
virtual ~rexp ()
 
 rexp (const rexp &a_from)
 
rexpoperator= (const rexp &a_from)
 
REAL shoot (math_func a_log) const
 
FLAT & flat ()
 
void set_seed (unsigned int a_seed)
 

Protected Attributes

FLAT & m_flat
 
REAL m_rate
 

Detailed Description

template<class FLAT, class REAL>
class tools::rexp< FLAT, REAL >

Definition at line 72 of file randT.

Constructor & Destructor Documentation

◆ rexp() [1/2]

template<class FLAT , class REAL >
tools::rexp< FLAT, REAL >::rexp ( FLAT &  a_flat,
REAL  a_rate = 1 
)
inline

Definition at line 75 of file randT.

75 :m_flat(a_flat),m_rate(a_rate){}

◆ ~rexp()

template<class FLAT , class REAL >
virtual tools::rexp< FLAT, REAL >::~rexp ( )
inlinevirtual

Definition at line 76 of file randT.

76 {}

◆ rexp() [2/2]

template<class FLAT , class REAL >
tools::rexp< FLAT, REAL >::rexp ( const rexp< FLAT, REAL > &  a_from)
inline

Definition at line 78 of file randT.

78 :m_flat(a_from.m_flat),m_rate(a_from.m_rate){}

Member Function Documentation

◆ flat()

template<class FLAT , class REAL >
FLAT& tools::rexp< FLAT, REAL >::flat ( )
inline

Definition at line 88 of file randT.

88 {return m_flat;}

◆ operator=()

template<class FLAT , class REAL >
rexp& tools::rexp< FLAT, REAL >::operator= ( const rexp< FLAT, REAL > &  a_from)
inline

Definition at line 79 of file randT.

79 {m_rate = a_from.m_rate;return *this;}

◆ set_seed()

template<class FLAT , class REAL >
void tools::rexp< FLAT, REAL >::set_seed ( unsigned int  a_seed)
inline

Definition at line 89 of file randT.

89 {m_flat.set_seed(a_seed);}

◆ shoot()

template<class FLAT , class REAL >
REAL tools::rexp< FLAT, REAL >::shoot ( math_func  a_log) const
inline

Definition at line 81 of file randT.

81  {
82  REAL v;
83  do {
84  v = m_flat.shoot();
85  } while(v<=REAL(0));
86  return -a_log(v)/m_rate;
87  }

Member Data Documentation

◆ m_flat

template<class FLAT , class REAL >
FLAT& tools::rexp< FLAT, REAL >::m_flat
protected

Definition at line 91 of file randT.

◆ m_rate

template<class FLAT , class REAL >
REAL tools::rexp< FLAT, REAL >::m_rate
protected

Definition at line 92 of file randT.


The documentation for this class was generated from the following file:
tools::rexp::m_rate
REAL m_rate
Definition: randT:92
tools::rexp::m_flat
FLAT & m_flat
Definition: randT:91