From 7e10da7d32863f927b8f92412842150d26e527dc Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 17 May 2000 14:09:44 +0000 Subject: [PATCH] Implement comparison of block index objects. git-svn-id: https://svn.dealii.org/trunk@2877 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_indices.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/deal.II/lac/include/lac/block_indices.h b/deal.II/lac/include/lac/block_indices.h index d1b5ac4f0a..9034ee8493 100644 --- a/deal.II/lac/include/lac/block_indices.h +++ b/deal.II/lac/include/lac/block_indices.h @@ -80,6 +80,14 @@ class BlockIndices */ BlockIndices & operator = (const BlockIndices &b); + /** + * Compare whether two objects + * are the same, i.e. whether the + * starting indices of all blocks + * are equal. + */ + bool operator == (const BlockIndices &b) const; + /** * Swap the contents of these two * objects. @@ -172,6 +180,20 @@ BlockIndices::operator = (const BlockIndices &b) +template +inline +bool +BlockIndices::operator == (const BlockIndices &b) const +{ + for (unsigned int i=0; i<=n_blocks; ++i) + if (start_indices[i] != b.start_indices[i]) + return false; + + return true; +}; + + + template inline void -- 2.39.5