EPS.h 742 B

12345678910111213141516171819202122232425
  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 <typename S_type> IGL_INLINE S_type EPS_SQ();
  14. // Template specializations for float and double
  15. template <> IGL_INLINE float EPS<float>();
  16. template <> IGL_INLINE double EPS<double>();
  17. template <> IGL_INLINE float EPS_SQ<float>();
  18. template <> IGL_INLINE double EPS_SQ<double>();
  19. }
  20. #ifdef IGL_HEADER_ONLY
  21. # include "EPS.cpp"
  22. #endif
  23. #endif