![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
Provides simple real number checks. More...
#include "RealComparisons.h"
Public Types | |
using | Value_t = RealType |
Public Member Functions | |
constexpr | RealComparisons (Value_t threshold) |
type of values being compered More... | |
constexpr bool | zero (Value_t value) const |
Returns whether the value is no farther from 0 than the threshold. More... | |
constexpr bool | nonZero (Value_t value) const |
Returns whether the value is farther from 0 than the threshold. More... | |
constexpr bool | equal (Value_t a, Value_t b) const |
Returns whether a and b are no farther than the threshold. More... | |
constexpr bool | nonEqual (Value_t a, Value_t b) const |
Returns whether a and b are farther than the threshold. More... | |
constexpr bool | strictlyNegative (Value_t value) const |
Returns whether value is larger than zero beyond tolerance. More... | |
constexpr bool | strictlyPositive (Value_t value) const |
Returns whether value is smaller than zero beyond tolerance. More... | |
constexpr bool | nonNegative (Value_t value) const |
Returns whether value is larger than or equal() to zero. More... | |
constexpr bool | nonPositive (Value_t value) const |
Returns whether value is smaller than or equal() to zero. More... | |
constexpr bool | strictlySmaller (Value_t a, Value_t b) const |
Returns whether a is strictly smaller than b. More... | |
constexpr bool | nonSmaller (Value_t a, Value_t b) const |
Returns whether a is greater than (or equal to) b. More... | |
constexpr bool | strictlyGreater (Value_t a, Value_t b) const |
Returns whether a is strictly greater than b. More... | |
constexpr bool | nonGreater (Value_t a, Value_t b) const |
Returns whether a is smaller than (or equal to) b. More... | |
constexpr bool | within (Value_t value, Value_t lower, Value_t upper) const |
Returns whether value is between the bounds (included) More... | |
constexpr bool | withinSorted (Value_t value, Value_t lower, Value_t upper) const |
Returns whether value is between bounds (included); bounds are sorted. More... | |
Public Attributes | |
Value_t | threshold |
Provides simple real number checks.
RealType | type of value to operate on |
This class provides some members to perform comparisons between real numbers, allowing for some tolerance for rounding errors.
The tolerance parameter is fixed. Example of usage:
Definition at line 64 of file RealComparisons.h.
using lar::util::RealComparisons< RealType >::Value_t = RealType |
Definition at line 65 of file RealComparisons.h.
|
inline |
type of values being compered
Constructor: specify the threshold
Definition at line 68 of file RealComparisons.h.
|
inline |
Returns whether a and b are no farther than the threshold.
Definition at line 77 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::zero().
Referenced by lar::util::RealComparisons< RealType >::nonEqual(), lar::util::Vector2DComparison< typename Comp_t::Value_t >::nonEqual(), lar::util::Vector3DComparison< RealType >::nonEqual(), and geo::OpDetGeo::PrintOpDetInfo().
|
inline |
Returns whether a and b are farther than the threshold.
Definition at line 80 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::equal().
Referenced by geo::AuxDetSensitiveGeo::PrintAuxDetInfo(), and geo::AuxDetGeo::PrintAuxDetInfo().
|
inline |
Returns whether a is smaller than (or equal to) b.
Definition at line 104 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::nonPositive().
|
inline |
Returns whether value is larger than or equal()
to zero.
Definition at line 89 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::threshold.
Referenced by lar::util::RealComparisons< RealType >::nonSmaller(), geo::PlaneGeo::WireIDincreasesWithZ(), and lar::util::RealComparisons< RealType >::within().
|
inline |
Returns whether value is smaller than or equal()
to zero.
Definition at line 92 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::threshold.
Referenced by lar::util::RealComparisons< RealType >::nonGreater(), and lar::util::RealComparisons< RealType >::within().
|
inline |
Returns whether a is greater than (or equal to) b.
Definition at line 98 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::nonNegative().
|
inline |
Returns whether the value is farther from 0 than the threshold.
Definition at line 74 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::zero().
Referenced by geo::OpDetGeo::PrintOpDetInfo().
|
inline |
Returns whether a is strictly greater than b.
Definition at line 101 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::strictlyPositive().
|
inline |
Returns whether value is larger than zero beyond tolerance.
Definition at line 83 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::threshold.
Referenced by lar::util::RealComparisons< RealType >::strictlySmaller().
|
inline |
Returns whether value is smaller than zero beyond tolerance.
Definition at line 86 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::threshold.
Referenced by lar::util::RealComparisons< RealType >::strictlyGreater().
|
inline |
Returns whether a is strictly smaller than b.
Definition at line 95 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::strictlyNegative().
|
inline |
Returns whether value is between the bounds (included)
Definition at line 107 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::nonNegative(), and lar::util::RealComparisons< RealType >::nonPositive().
Referenced by lar::util::RealComparisons< RealType >::withinSorted().
|
inline |
Returns whether value is between bounds (included); bounds are sorted.
Definition at line 113 of file RealComparisons.h.
References lar::util::RealComparisons< RealType >::within().
|
inline |
Returns whether the value is no farther from 0 than the threshold.
Definition at line 71 of file RealComparisons.h.
References util::abs(), and lar::util::RealComparisons< RealType >::threshold.
Referenced by lar::util::RealComparisons< RealType >::equal(), lar::util::RealComparisons< RealType >::nonZero(), lar::util::Vector2DComparison< typename Comp_t::Value_t >::nonZero(), lar::util::Vector3DComparison< RealType >::nonZero(), geo::OpDetGeo::PrintOpDetInfo(), and lar::util::TrackPitchInView().
Value_t lar::util::RealComparisons< RealType >::threshold |
Definition at line 118 of file RealComparisons.h.
Referenced by lar::util::makeVector2DComparison(), lar::util::makeVector3DComparison(), lar::util::RealComparisons< RealType >::nonNegative(), lar::util::RealComparisons< RealType >::nonPositive(), lar::util::RealComparisons< RealType >::strictlyNegative(), lar::util::RealComparisons< RealType >::strictlyPositive(), and lar::util::RealComparisons< RealType >::zero().