From dd247fdb4f1f3c66499c7ca2f7121d9f08326f7c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 2 Mar 2005 00:36:11 +0000 Subject: [PATCH] Add operator> to sparse matrix iterators. git-svn-id: https://svn.dealii.org/trunk@9939 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.html | 8 +++++++ deal.II/lac/include/lac/sparse_matrix.h | 29 +++++++++++++++++++------ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index a579ff7b5f..78cba7719d 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -64,6 +64,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

lac

    +
  1. + New: The SparseMatrix iterators had no operator + >, only an operator <. The missing operator + is now implemented. +
    + (WB, 2005/03/01) +

    +
diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index f2a83f5d25..c864f4ffbf 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -362,12 +362,10 @@ namespace internals bool operator != (const Iterator &) const; /** - * Comparison - * operator. Result is true - * if either the first row - * number is smaller or if - * the row numbers are - * equal and the first + * Comparison operator. Result is + * true if either the first row + * number is smaller or if the row + * numbers are equal and the first * index is smaller. * * This function is only valid if @@ -376,6 +374,13 @@ namespace internals */ bool operator < (const Iterator &) const; + /** + * Comparison operator. Works in the + * same way as above operator, just + * the other way round. + */ + bool operator > (const Iterator &) const; + private: /** * Store an object of the @@ -2174,6 +2179,16 @@ namespace internals return (accessor < other.accessor); } + + + template + inline + bool + Iterator:: + operator > (const Iterator& other) const + { + return !((*this < other) || (*this == other)); + } } } -- 2.39.5