We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b41555 commit 94b79f7Copy full SHA for 94b79f7
1 file changed
ql/math/matrix.hpp
@@ -60,6 +60,9 @@ namespace QuantLib {
60
61
Matrix& operator=(const Matrix&);
62
Matrix& operator=(Matrix&&) noexcept;
63
+
64
+ bool operator==(const Matrix&) const;
65
+ bool operator!=(const Matrix&) const;
66
//@}
67
68
//! \name Algebraic operators
@@ -255,6 +258,15 @@ namespace QuantLib {
255
258
return *this;
256
259
}
257
260
261
+ inline bool Matrix::operator==(const Matrix& to) const {
262
+ return rows_ == to.rows_ && columns_ == to.columns_ &&
263
+ std::equal(begin(), end(), to.begin());
264
+ }
265
266
+ inline bool Matrix::operator!=(const Matrix& to) const {
267
+ return !(this->operator==(to));
268
269
270
inline void Matrix::swap(Matrix& from) {
271
using std::swap;
272
data_.swap(from.data_);
0 commit comments