Added assert_inequal for matrices
parent
ddea66e026
commit
88d3def0db
|
@ -105,6 +105,15 @@ bool assert_equal(const Matrix& expected, const Matrix& actual, double tol) {
|
|||
return false;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
bool assert_inequal(const Matrix& A, const Matrix& B, double tol) {
|
||||
if (!equal_with_abs_tol(A,B,tol)) return true;
|
||||
cout << "Erroneously equal:" << endl;
|
||||
print(A, "A = ");
|
||||
print(B, "B = ");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
bool assert_equal(const std::list<Matrix>& As, const std::list<Matrix>& Bs, double tol) {
|
||||
if (As.size() != Bs.size()) return false;
|
||||
|
|
|
@ -134,6 +134,11 @@ inline bool operator!=(const Matrix& A, const Matrix& B) {
|
|||
*/
|
||||
GTSAM_EXPORT bool assert_equal(const Matrix& A, const Matrix& B, double tol = 1e-9);
|
||||
|
||||
/**
|
||||
* inequals with an tolerance, prints out message if within tolerance
|
||||
*/
|
||||
GTSAM_EXPORT bool assert_inequal(const Matrix& A, const Matrix& B, double tol = 1e-9);
|
||||
|
||||
/**
|
||||
* equals with an tolerance, prints out message if unequal
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue