12template <
class DerivedA,
class DerivedB>
13constexpr bool equals(
const Eigen::MatrixBase<DerivedA> &A,
14 const Eigen::MatrixBase<DerivedB> &B,
17 return A.isApprox(B, tolerance);
21template <
class Scalar>
24 return std::abs(a - b) <= tolerance;
27template <
class DerivedA,
class DerivedB>
29 const Eigen::MatrixBase<DerivedB> &B,
32 PRECICE_ASSERT(A.rows() == B.rows(),
"Matrices with different number of rows can't be compared.");
33 PRECICE_ASSERT(A.cols() == B.cols(),
"Matrices with different number of cols can't be compared.");
35 return ((A - B).array() > tolerance).any();
38template <
class DerivedA,
class DerivedB>
40 const Eigen::MatrixBase<DerivedB> &B,
43 PRECICE_ASSERT(A.rows() == B.rows(),
"Matrices with different number of rows can't be compared.");
44 PRECICE_ASSERT(A.cols() == B.cols(),
"Matrices with different number of cols can't be compared.");
46 return ((A - B).array() >= -tolerance).any();
49template <
class DerivedA,
class DerivedB>
51 const Eigen::MatrixBase<DerivedB> &B,
54 PRECICE_ASSERT(A.rows() == B.rows(),
"Matrices with different number of rows can't be compared.");
55 PRECICE_ASSERT(A.cols() == B.cols(),
"Matrices with different number of cols can't be compared.");
57 return ((A - B).array() > tolerance).all();
60template <
class DerivedA,
class DerivedB>
62 const Eigen::MatrixBase<DerivedB> &B,
65 PRECICE_ASSERT(A.rows() == B.rows(),
"Matrices with different number of rows can't be compared.");
66 PRECICE_ASSERT(A.cols() == B.cols(),
"Matrices with different number of cols can't be compared.");
68 return ((A - B).array() >= tolerance).all();
71template <
class Scalar>
74 return A - B > tolerance;
77template <
class Scalar>
80 return A - B >= -tolerance;
83template <
class Scalar>
86 return A - B < -tolerance;
89template <
class Scalar>
92 return A - B <= tolerance;
#define PRECICE_ASSERT(...)
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 oneGreaterEquals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=math::NUMERICAL_ZERO_DIFFERENCE)
std::enable_if< std::is_arithmetic< Scalar >::value, bool >::type smallerEquals(Scalar A, Scalar B, Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
constexpr double NUMERICAL_ZERO_DIFFERENCE
std::enable_if< std::is_arithmetic< Scalar >::value, bool >::type greaterEquals(Scalar A, Scalar B, Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
std::enable_if< std::is_arithmetic< Scalar >::value, bool >::type smaller(Scalar A, Scalar B, Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool allGreater(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=math::NUMERICAL_ZERO_DIFFERENCE)
bool allGreaterEquals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=math::NUMERICAL_ZERO_DIFFERENCE)
bool oneGreater(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=math::NUMERICAL_ZERO_DIFFERENCE)
std::enable_if< std::is_arithmetic< Scalar >::value, bool >::type greater(Scalar A, Scalar B, Scalar tolerance=NUMERICAL_ZERO_DIFFERENCE)
Main namespace of the precice library.