9 #ifndef THEPEG_MaxCmp_H
10 #define THEPEG_MaxCmp_H
30 template <
typename T =
double,
typename Indx =
int,
typename Cmp = std::greater<T> >
65 operator const T & ()
const {
return value(); }
106 template <
typename T,
typename Indx =
int>
119 MinCmp(
const T & t, Indx in = Indx()) :
MaxCmp<T, Indx, less<T> >(t, in) {}
MaxCmp is a helper class to be used in a loop where one would like to keep track of the largest value...
bool operator()(const T &t, Indx i=Indx())
If t is the largest value seen so far return true.
T max
The largest value seen so far.
Indx indx
The index for the largest value seen so far.
This is the main namespace within which all identifiers in ThePEG are declared.
MaxCmp(const T &t, Indx in=Indx())
Constructor specifying an initial maximum value, t.
Cmp cmp
The comparison object to be used.
MinCmp(const T &t, Indx in=Indx())
Constructors are not inherited.
const T & value() const
Return the largest value so far.
bool init
True if a first value has been given;.
Special calss for Minimum comparisons.
MinCmp()
Constructors are not inherited.
Indx index() const
Return the index of the largest object seen so far.
MaxCmp()
The default constructor.