ATLAS Offline Software
Loading...
Searching...
No Matches
InDetMaterialManager.cxx File Reference
#include "InDetGeoModelUtils/InDetMaterialManager.h"
#include "InDetGeoModelUtils/InDetDDAthenaComps.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
#include "GeoModelKernel/GeoIntrusivePtr.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "GeoModelKernel/GeoElement.h"
#include "GeoModelKernel/Units.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "RDBAccessSvc/IRDBRecordset.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "GeometryDBSvc/IGeometryDBSvc.h"
#include "StoreGate/StoreGateSvc.h"
#include "CxxUtils/close_to_zero.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <stdexcept>

Go to the source code of this file.

Functions

template<typename T>
bool close_to_zero (T value, T eps=std::numeric_limits< T >::epsilon())

Function Documentation

◆ close_to_zero()

template<typename T>
bool CxxUtils::close_to_zero ( T value,
T eps = std::numeric_limits<T>::epsilon() )

Definition at line 48 of file close_to_zero.h.

48 {
49 if constexpr (std::is_integral_v<T>) {
50 // For integers, only exact zero is invalid
51 return value == 0;
52 } else if constexpr (std::is_floating_point_v<T>) {
53 return std::abs(value) < eps;
54 } else {
55 static_assert(std::is_arithmetic_v<T>, "close_to_zero: Only arithmetic types supported");
56 return false;
57 }
58 }