5 #ifndef PhotonPropagationUtils_H 6 #define PhotonPropagationUtils_H 15 double interpolate(
const std::vector<double>& xData,
16 const std::vector<double>& yData,
18 const bool extrapolate,
20 double interpolate2(
const std::vector<double>& xDistances,
21 const std::vector<double>& rDistances,
27 const std::vector<double>& xData,
28 const std::vector<double>& yData1,
29 const std::vector<double>& yData2,
30 const std::vector<double>& yData3,
32 const bool extrapolate);
36 template <
typename TReal>
37 inline constexpr
static bool 40 TReal diff = std::fabs(a - b);
41 if (diff <= tolerance)
return true;
42 if (diff < std::fmax(std::fabs(a), std::fabs(b)) * tolerance)
return true;
49 template <
typename TReal>
52 TReal tolerance = std::numeric_limits<TReal>::epsilon())
54 if (std::fabs(a) <= tolerance)
return true;
60 template <
typename TReal>
61 inline constexpr
static bool 65 if (diff < tolerance)
return true;
66 if (diff < std::fmax(std::fabs(a), std::fabs(b)) * tolerance)
return true;
70 template <
typename TReal>
71 inline constexpr
static bool 75 if (diff > tolerance)
return true;
76 if (diff > std::fmax(std::fabs(a), std::fabs(b)) * tolerance)
return true;
void interpolate3(std::array< double, 3 > &inter, const std::vector< double > &xData, const std::vector< double > &yData1, const std::vector< double > &yData2, const std::vector< double > &yData3, const double x, const bool extrapolate)
static constexpr bool isDefinitelyGreaterThan(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
double fast_acos(double xin)
double interpolate2(const std::vector< double > &xDistances, const std::vector< double > &rDistances, const std::vector< std::vector< std::vector< double >>> ¶meters, const double x, const double r, const size_t k)
General LArSoft Utilities.
static constexpr bool isApproximatelyEqual(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
static constexpr bool isDefinitelyLessThan(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
double interpolate(const std::vector< double > &xData, const std::vector< double > &yData, const double x, const bool extrapolate, size_t i)
static constexpr bool isApproximatelyZero(TReal a, TReal tolerance=std::numeric_limits< TReal >::epsilon())