13 #ifndef FAUDES_TP_TIMEINTERVAL_H
14 #define FAUDES_TP_TIMEINTERVAL_H
46 static Type Max(
void) {
return std::numeric_limits<Int>::max();};
48 static Type Min(
void) {
return std::numeric_limits<Int>::min()+1;};
50 static Type UnDef(
void) {
return std::numeric_limits<Int>::min();};
57 if(x<=std::numeric_limits<Float>::min())
return Min();
58 if(x>=std::numeric_limits<Float>::max())
return Max();
63 if(time == UnDef())
return "undef";
64 if(time < Min())
return "err";
65 if(time == Min())
return "-inf";
66 if(time > Max())
return "err";
67 if(time == Max())
return "inf";
184 bool LBincl(
void)
const {
return mbLBincl;}
191 bool UBincl(
void)
const {
return mbUBincl;}
214 void Canonical(
void);
226 mstUB=-1; mstLB=1; mbUBincl=
false; mbLBincl=
false; };
232 mstUB=
Time::Max(); mstLB=0; mbUBincl=
false; mbLBincl=
true; };
239 mstLB=
Time::Min(); mstUB=0; mbUBincl=
false; mbLBincl=
true; };
255 bool Empty(
void)
const;
264 return ( (mstLB<0) || ((mstLB ==0) && mbLBincl) ) && (mstUB==
Time::Max());};
273 return ( (mstUB>0) || ((mstUB ==0) && mbUBincl) ) && (mstLB==
Time::Min());};
294 if(mstUB!=rOtherInterval.
mstUB)
return false;
295 if(mstLB!=rOtherInterval.
mstLB)
return false;
296 if(mbUBincl!=rOtherInterval.
mbUBincl)
return false;
297 if(mbLBincl!=rOtherInterval.
mbLBincl)
return false;
312 return ! (*
this == rOtherInterval) ;
372 std::string Str(
void)
const;
Model of a time interval.
bool IncludesNegative(void) const
Test whether interval includes (-inf,0].
void LB(Time::Type time)
Set the lower bound to a given value.
void SetPositive(void)
Set to positive [0, inf)
Time::Type LB(void) const
Return lower bound.
Time::Type mstLB
Lower bound.
bool LBincl(void) const
Test for lower bound inclusive.
Time::Type UB(void) const
Return upper bound.
bool IncludesPositive(void) const
Test whether interval includes [0,inf)
bool UBinf(void) const
Test for upper bound infinity.
void SetNegative(void)
Set to negative (-inf, 0].
Time::Type mstUB
Upper bound.
void setLBinf(void)
Set lower bound to infinity.
bool UBincl(void) const
Test for upper bound inclusive.
void setUBinf(void)
Set upper bound to infinity.
bool Full(void) const
Test whether interval is full.
void UBincl(bool incl)
Configures the upper bound to be inclusive.
~TimeInterval(void)
Default destructor.
void LBincl(bool incl)
Configures the lower bound to be inclusive.
void UB(Time::Type time)
Set the upper bound to a given value.
bool mbUBincl
Flag to indicate that the upper bound is part of the interval.
void SetEmpty(void)
Set to empty (1, -1)
void SetFull(void)
Set to full (-inf, +inf)
bool LBinf(void) const
Test for lower bound infinity.
bool mbLBincl
Flag to indicate that lower boundary is part of the interval.
TimeInterval(void)
Default constructor - sets time interval to (-inf; +inf)
static Type Min(void)
Minimum time, associated with minus infinitiy.
static Type UnDef(void)
Undefined time value.
Int Type
Datatype for point on time axis.
static Type Quantize(Float x)
Discretize (when using cosmetic float time: "step*(round(t/step))".
static std::string Str(Type time)
convert to string
static Type Step(void)
Smallest representable time step.
static Type Max(void)
Maximum time, associated with infinitiy.
static Float FromFloat(Float x)
Convert From float (for convenient token-reading only)
Includes all libFAUDES headers, no plugins.
libFAUDES resides within the namespace faudes.
double Float
Type definition for real type.
std::string ToStringInteger(Int number)
integer to string
long int Int
Type definition for integer type (let target system decide, minimum 32bit)