EPS.h 587 B

12345678910111213141516171819202122
  1. #ifndef IGL_EPS_H
  2. #define IGL_EPS_H
  3. #include "igl_inline.h"
  4. // Define a standard value for double epsilon
  5. namespace igl
  6. {
  7. const double DOUBLE_EPS = 1.0e-14;
  8. const double DOUBLE_EPS_SQ = 1.0e-28;
  9. const float FLOAT_EPS = 1.0e-7;
  10. const float FLOAT_EPS_SQ = 1.0e-14;
  11. // Function returning EPS for corresponding type
  12. template <typename S_type> IGL_INLINE S_type EPS();
  13. // Template specializations for float and double
  14. template <> IGL_INLINE float EPS<float>();
  15. template <> IGL_INLINE double EPS<double>();
  16. }
  17. #ifdef IGL_HEADER_ONLY
  18. # include "EPS.cpp"
  19. #endif
  20. #endif