ThePEG::MaxCmp< T > Class Template Reference

MaxCmp is a helper class to be used in a loop where one would like to keep track of the largest value so far of a certain expression. More...

#include <MaxCmp.h>

List of all members.

Public Member Functions

 MaxCmp ()
 The default constructor.
 MaxCmp (const T &t)
 Constructor specifying an initial maximum value, t.
bool operator() (const T &t)
 If t is the largest value seen so far return true.
 operator const T & () const
 Return the largest value so far.

Private Attributes

bool init
 True if a first value has been given;.
max
 The largest value seen so far.


Detailed Description

template<typename T>
class ThePEG::MaxCmp< T >

MaxCmp is a helper class to be used in a loop where one would like to keep track of the largest value so far of a certain expression.

The class simply checks if the given value to the operator() is the largest so far (in which case true is returned). It is mainly useful if is unclear what the smallest possible value would be.

Definition at line 26 of file MaxCmp.h.


Member Function Documentation

template<typename T>
bool ThePEG::MaxCmp< T >::operator() ( const T &  t  )  [inline]

If t is the largest value seen so far return true.

Otherwise return false.

Definition at line 46 of file MaxCmp.h.

References ThePEG::MaxCmp< T >::init, and ThePEG::MaxCmp< T >::max.


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

Generated on Thu Apr 29 12:43:25 2010 for ThePEG by  doxygen 1.5.5