21 #ifndef __stridedRange_hpp__
22 #define __stridedRange_hpp__
44 static inline const T maxVal = largestPositive<T>();
45 static inline const T minVal = largestNegative<T>();
69 if(!parseRange(rangeString,begin_,end_, stride_))
72 "bad input for the range. It should have the form of begin:stride:end \n";
79 begin_(dict.getVal<
label>(
"begin")),
80 end_(dict.getVal<
label>(
"end")),
81 stride_(dict.getVal<
label>(
"stride"))
102 if(
equal(val,begin_))
return true;
103 if(
equal(val,end_))
return true;
104 if(
abs(
mod(val-begin_,stride_))<= epsilon)
return true;
117 auto col1 = rangeString.find_first_of(
":");
119 if(col1 == 0 || col1==std::string::npos)
return false;
121 auto beginCh = rangeString.substr(0,col1);
123 auto col2 = rangeString.find_first_of(
":",col1+1);
125 if(col1 == col2 || col2==std::string::npos)
return false;
127 auto strideCh = rangeString.substr(col1+1,col2-col1-1);
129 auto endCh = rangeString.substr(col2+1);
131 if(!
readValue(beginCh,begin))
return false;
132 if(!
readValue(strideCh, stride))
return false;
142 #endif //__stridedRange_hpp__