7 #ifndef __FWMATH_COMPARE_HPP__ 8 #define __FWMATH_COMPARE_HPP__ 22 template <
typename TYPE >
23 bool isEqual(TYPE
a, TYPE b,
const float epsilon = 0.00001F)
25 return fabs(a - b) < epsilon;
35 template <
typename CONTAINER >
36 bool isContainerEqual(CONTAINER& containerA, CONTAINER& containerB,
const float epsilon = 0.00001F)
39 if(containerA.size() != containerB.size())
44 typename CONTAINER::const_iterator iterA = containerA.begin();
45 typename CONTAINER::const_iterator iterB = containerB.begin();
47 while(isEqual && iterA != containerA.end())
49 isEqual = ::fwMath::isEqual(*iterA, *iterB, epsilon);
bool isContainerEqual(CONTAINER &containerA, CONTAINER &containerB, const float epsilon=0.00001F)
Returns true iff container a and b are equal with 'epsilon' error margin.
The namespace fwMath contains classes which provide the implementation of several mathematic function...
bool isEqual(TYPE a, TYPE b, const float epsilon=0.00001F)
Returns true iff a and b are equal with 'epsilon' error margin.