11template <
class DerivedA,
class DerivedB>
12constexpr bool equals(
const Eigen::MatrixBase<DerivedA> &A,
13 const Eigen::MatrixBase<DerivedB> &B,
16 return A.isApprox(B, tolerance);
22 auto d = std::abs(a - b);
23 auto scale = std::max(1.0, std::max(std::abs(a), std::abs(b)));
24 return d <= tolerance * scale;
29 return std::abs(a) < tolerance;
34 return a > b + tolerance;
44 return a + tolerance < b;
provides general mathematical constants and functions.
bool smallerEquals(double a, double b, double tolerance=NUMERICAL_ZERO_DIFFERENCE) noexcept
constexpr bool equals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares two Eigen::MatrixBase for equality up to tolerance.
bool greaterEquals(double a, double b, double tolerance=NUMERICAL_ZERO_DIFFERENCE) noexcept
bool greater(double a, double b, double tolerance=NUMERICAL_ZERO_DIFFERENCE) noexcept
constexpr double NUMERICAL_ZERO_DIFFERENCE
bool isZero(double a, double tolerance=NUMERICAL_ZERO_DIFFERENCE) noexcept
bool smaller(double a, double b, double tolerance=NUMERICAL_ZERO_DIFFERENCE) noexcept