CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
cms_rounding Namespace Reference

Functions

template<class valType >
constexpr valType roundIfNear0 (valType value, double tolerance=1.e-7)
 
template<class valType >
constexpr valType roundVecIfNear0 (valType value, double tolerance=1.e-7)
 

Function Documentation

template<class valType >
constexpr valType cms_rounding::roundIfNear0 ( valType  value,
double  tolerance = 1.e-7 
)
inline
template<class valType >
constexpr valType cms_rounding::roundVecIfNear0 ( valType  value,
double  tolerance = 1.e-7 
)
inline

Definition at line 18 of file Rounding.h.

References roundIfNear0(), and tolerance.

Referenced by DTGeometryTest::analyze().

18  {
19  auto xVal{roundIfNear0(value.x(), tolerance)};
20  auto yVal{roundIfNear0(value.y(), tolerance)};
21  auto zVal{roundIfNear0(value.z(), tolerance)};
22  return (valType{xVal, yVal, zVal});
23  }
const double tolerance
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Definition: Rounding.h:11