29#ifndef RYTHMOS_TIME_RANGE_DEF_H
30#define RYTHMOS_TIME_RANGE_DEF_H
32#include "Rythmos_TimeRange_decl.hpp"
33#include "Teuchos_Assert.hpp"
34#include "Teuchos_ScalarTraits.hpp"
37template<
class TimeType>
41 const TimeType epsMore = 10.0*std::numeric_limits<TimeType>::epsilon();
42 const TimeType t1Mag = Teuchos::ScalarTraits<TimeType>::magnitude(t1);
43 const TimeType t1Tol = t1Mag*epsMore;
44 if ( t2 - t1Tol <= t1 && t1 <= t2 + t1Tol )
46 else if ( t1 > t2 + t1Tol )
53template<
class TimeType>
61template<
class TimeType>
69template<
class TimeType>
85template<
class TimeType>
87 const TimeType &time )
89 TEUCHOS_TEST_FOR_EXCEPTION( !
timeRange.isInRange(time), std::out_of_range,
90 "Error, the time = " << time
91 <<
" is out of the range = " <<
timeRange <<
"!"
96template<
class TimeType>
106template<
class TimeType>
116template<
class TimeType>
126template<
class TimeType>
136#define RYTHMOS_TIME_RANGE_INSTANT(SCALAR) \
138 template class TimeRange< SCALAR >; \
140 template int compareTimeValues( const SCALAR &t1, const SCALAR &t2 ); \
141 template TimeRange< SCALAR > timeRange(const SCALAR lower, const SCALAR upper); \
142 template TimeRange< SCALAR > invalidTimeRange(); \
143 template std::ostream& operator<<( std::ostream& out, const TimeRange< SCALAR >& range ); \
144 template void asssertInTimeRange( const TimeRange<SCALAR > &timeRange, const SCALAR &time ); \
145 template bool isInRange_cc(const TimeRange< SCALAR > &tr, const SCALAR &p); \
146 template bool isInRange_oc(const TimeRange< SCALAR > &tr, const SCALAR &p); \
147 template bool isInRange_co(const TimeRange< SCALAR > &tr, const SCALAR &p); \
148 template bool isInRange_oo(const TimeRange< SCALAR > &tr, const SCALAR &p); \
149 template class TimeRange_cc< SCALAR >; \
150 template class TimeRange_co< SCALAR >; \
151 template class TimeRange_oo< SCALAR >; \
152 template class TimeRange_oc< SCALAR >;
bool isInRange_cc(const TimeRange< TimeType > &tr, const TimeType &p)
Nonmember isInRange function [closed, closed].
bool isInRange_oo(const TimeRange< TimeType > &tr, const TimeType &p)
Nonmember isInRange function (open, open).
TimeRange< TimeType > invalidTimeRange()
Nonmember constructor.
int compareTimeValues(const TimeType &t1, const TimeType &t2)
Compare two times taking into account floating point errors.
bool isInRange_oc(const TimeRange< TimeType > &tr, const TimeType &p)
Nonmember isInRange function (open, closed].
bool isInRange_co(const TimeRange< TimeType > &tr, const TimeType &p)
Nonmember isInRange function [closed, open).
TimeRange< TimeType > timeRange(const TimeType my_lower, const TimeType my_upper)
Nonmember constructor.