From a6b137ed99b6e7ac3442e724a73dd3b9dedffa81 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@dune-project.org>
Date: Wed, 2 Mar 2011 15:49:30 +0000
Subject: [PATCH] add operator==, !=, because FieldMatrix has them as well. 
 Patch by Uli Sack

[[Imported from SVN: r1459]]
---
 dune/istl/diagonalmatrix.hh | 13 +++++++++++++
 dune/istl/scaledidmatrix.hh | 14 ++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/dune/istl/diagonalmatrix.hh b/dune/istl/diagonalmatrix.hh
index ffac8009d..3e83fdc2c 100644
--- a/dune/istl/diagonalmatrix.hh
+++ b/dune/istl/diagonalmatrix.hh
@@ -258,6 +258,19 @@ namespace Dune {
       return *this;
     }
 
+    //===== comparison ops
+
+    //! comparison operator
+    bool operator==(const DiagonalMatrix& other) const
+    {
+      return diag_==other.diagonal();
+    }
+
+    //! incomparison operator
+    bool operator!=(const DiagonalMatrix& other) const
+    {
+      return diag_!=other.diagonal();
+    }
 
 
     //===== linear maps
diff --git a/dune/istl/scaledidmatrix.hh b/dune/istl/scaledidmatrix.hh
index fbbc442b1..2f4a66617 100644
--- a/dune/istl/scaledidmatrix.hh
+++ b/dune/istl/scaledidmatrix.hh
@@ -234,6 +234,20 @@ namespace Dune {
       return *this;
     }
 
+    //===== comparison ops
+
+    //! comparison operator
+    bool operator==(const ScaledIdentityMatrix& other) const
+    {
+      return p_==other.diagonal();
+    }
+
+    //! incomparison operator
+    bool operator!=(const ScaledIdentityMatrix& other) const
+    {
+      return p_!=other.diagonal();
+    }
+
     //===== linear maps
 
     //! y = A x
-- 
GitLab