]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement comparison of block index objects.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 May 2000 14:09:44 +0000 (14:09 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 May 2000 14:09:44 +0000 (14:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@2877 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_indices.h

index d1b5ac4f0ad519820e0e67a1c0c2490443f371c4..9034ee849340c8e65ce51176d2eede947a46a677 100644 (file)
@@ -80,6 +80,14 @@ class BlockIndices
                                      */
     BlockIndices<n_blocks> & operator = (const BlockIndices<n_blocks> &b);
 
+                                    /**
+                                     * Compare whether two objects
+                                     * are the same, i.e. whether the
+                                     * starting indices of all blocks
+                                     * are equal.
+                                     */
+    bool operator == (const BlockIndices<n_blocks> &b) const;
+    
                                     /**
                                      * Swap the contents of these two
                                      * objects.
@@ -172,6 +180,20 @@ BlockIndices<n_blocks>::operator = (const BlockIndices<n_blocks> &b)
 
 
 
+template <int n_blocks>
+inline
+bool
+BlockIndices<n_blocks>::operator == (const BlockIndices<n_blocks> &b) const
+{
+  for (unsigned int i=0; i<=n_blocks; ++i)
+    if (start_indices[i] != b.start_indices[i])
+      return false;
+  
+  return true;
+};
+
+
+
 template <int n_blocks>
 inline
 void

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.