Ravelin
Opsf.h
1 #ifndef _RAVELIN_OPERATORS_F_H_
2 #define _RAVELIN_OPERATORS_F_H_
3 
4 #include <Ravelin/cblas.h>
5 #include <Ravelin/Constants.h>
6 #include <Ravelin/DataMismatchException.h>
7 #include <Ravelin/MissizeException.h>
8 
9 namespace Ravelin {
10 
11 #include "fdefs.h"
12 #include "Ops.h"
13 #include "undefs.h"
14 
15 inline bool Opsf::rel_equal(float x, float y)
16 {
17  return (std::fabs(x-y) <= EPS_FLOAT * std::max(std::fabs(x), std::max(std::fabs(y), 1.0f)));
18 }
19 
21 inline bool Opsf::rel_equal(float x, float y, float tol)
22 {
23  return (std::fabs(x-y) <= tol * std::max(std::fabs(x), std::max(std::fabs(y),
24 1.0f)));
25 }
26 
27 } // end namespace
28 
29 #endif
30