9 #ifndef ThePEG_Interval_H 10 #define ThePEG_Interval_H 15 #include "Interval.fh" 16 #include "ThePEG/Utilities/UnitIO.h" 20 template <
typename T,
typename CMP>
115 if (
operator==(i) ) res = i;
127 if (
operator==(i) ) res = i;
157 template <
typename Iterator>
158 bool check(Iterator first, Iterator last);
164 template <
typename Iterator>
165 bool checkAll(Iterator first, Iterator last);
177 template<
typename Iterator>
179 Iterator first, Iterator last);
196 template <
typename T,
typename CMP>
200 template <
typename OStream,
typename T,
typename CMP>
201 inline OStream & operator<<(OStream & os, const Interval<T,CMP> & i) {
202 os << i.
lower() << i.upper();
207 template <
typename IStream,
typename T,
typename CMP>
221 template <
typename OStream,
typename T,
typename CMP,
typename UT>
231 template <
typename IStream,
typename T,
typename CMP,
typename UT>
240 #ifndef ThePEG_TEMPLATES_IN_CC_FILE 241 #include "Interval.tcc" Interval< T, CMP > overlap(const Interval &i) const
If this interval operlaps with i return the overlapping interval.
bool check() const
Check consistency ie.
Interval< T, CMP > chopUpper(T x)
If x is in the interval return the interval [x,upper()) and change this interval to [lower()...
void ounitstream(OStream &os, const vector< T, Alloc > &v, UT &u)
Ouput a vector of objects with the specified unit.
bool checkAll(Iterator first, Iterator last)
Check if all of the values in the given iterator range is included in this interval.
Interval< T, CMP > chopLower(T x)
If x is in the interval return the interval [lower(),x) and change this interval to [x...
T upper() const
Return the upper limit of the interval.
void lower(T dn)
Set the lower limit of the interval.
This is the main namespace within which all identifiers in ThePEG are declared.
std::vector< Interval< T, CMP > > split(Interval< T, CMP >, T x)
If x is in the given interval, split the given interval in two, otherwise return an empty list...
Interval< T, CMP > sum(const Interval &i) const
If this interval operlaps with i return the union of the two intervals.
bool operator==(const Interval &i) const
Test for equality.
void iunitstream(IStream &is, vector< T, Alloc > &v, UT &u)
Input a vector of objects with the specified unit.
Interval()
Construct an empty interval.
An Interval object is used to represent an interval [ lower(), upper() ) where the ordering is define...
Interval< double > DInterval
An interval of doubles.
T lower() const
Return the lower limit of the interval.
bool operator()(T x) const
Returns true if x is within the interval.
OUnit< T, UT > ounit(const T &t, const UT &ut)
Helper function creating a OUnit object given an object and a unit.
vector< T > & operator>>(vector< T > &tv, U &u)
Overload the right shift operator for vector to pop objects from a vector.
std::pair< T, T > theLimits
The lower and upper limit of this interval.
static CMP cmp
The object used for comparisons.
bool operator<(const Interval &i) const
Test for ordering.
bool includes(const Interval< T, CMP > &i) const
Returns true if the whole of i is within the interval.
Interval< T, CMP > makeInterval(T dn, T up)
Helper function to create an interval of a type determined by the parameters.
Interval(T dn, T up)
Construct interval [dn,up).
bool includes(T x) const
Returns true if x is within the interval.
IUnit< T, UT > iunit(T &t, const UT &ut)
Helper function creating a IUnit object given an object and a unit.
void upper(T up)
Set the upper limit of the interval.