Ravelin
Opsd.h
1 #ifndef _RAVELIN_OPERATORS_D_H_
2 #define _RAVELIN_OPERATORS_D_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 "ddefs.h"
12 #include "Ops.h"
13 #include "undefs.h"
14 
16 inline bool Opsd::rel_equal(double x, double y)
17 {
18  return (std::fabs(x-y) <= EPS_DOUBLE * std::max(std::fabs(x), std::max(std::fabs(y), 1.0)));
19 }
20 
22 inline bool Opsd::rel_equal(double x, double y, double tol)
23 {
24  return (std::fabs(x-y) <= tol * std::max(std::fabs(x), std::max(std::fabs(y), 1.0)));
25 }
26 
27 
28 } // end namespace
29 
30 #endif
31