From: wolf Date: Wed, 17 May 2000 14:09:44 +0000 (+0000) Subject: Implement comparison of block index objects. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af93ae7afe22721fdc0b15468e76a2705109860d;p=dealii-svn.git Implement comparison of block index objects. git-svn-id: https://svn.dealii.org/trunk@2877 0785d39b-7218-0410-832d-ea1e28bc413d --- 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