From 675ebc28a17f9023d7c3c78de41f6c02d64a4a7d Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 20 Mar 2014 18:33:24 -0400 Subject: [PATCH] Add matrix equality operator --- Base/include/MatrixBase.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Base/include/MatrixBase.h b/Base/include/MatrixBase.h index 94d8aa2..3cbbdf7 100644 --- a/Base/include/MatrixBase.h +++ b/Base/include/MatrixBase.h @@ -77,6 +77,16 @@ namespace FasTC { return ret; } + // Equality operator + template + bool operator==(MatrixBase<_T, nRows, nCols> &other) const { + bool result = true; + for(int i = 0; i < Size; i++) { + result = result && (mat[i] == other[i]); + } + return result; + } + // Matrix multiplication template MatrixBase MultiplyMatrix(const MatrixBase<_T, nCols, nTarget> &m) const {