MATH: Add/fix matrix operators

- fix == operator
- add != operator
This commit is contained in:
Christian Krause 2014-10-05 02:45:42 +02:00
parent 243519b276
commit cc9734643b

View file

@ -206,6 +206,9 @@ Matrix<r, c> operator-(const Matrix<r, c> &m);
template <int r, int c>
bool operator==(const Matrix<r, c> &m1, const Matrix<r, c> &m2);
template <int r, int c>
bool operator!=(const Matrix<r, c> &m1, const Matrix<r, c> &m2);
// Constructors
template<int rows, int cols>
@ -457,9 +460,13 @@ bool operator==(const Matrix<r, c> &m1, const Matrix<r, c> &m2) {
}
}
}
return false;
return true;
}
template <int r, int c>
bool operator!=(const Matrix<r, c> &m1, const Matrix<r, c> &m2) {
return !(m1 == m2);
}
template<int r, int c>
Common::Debug &operator<<(Common::Debug dbg, const Math::Matrix<r, c> &m) {