From 64db4135f8c36ab50b3723bcbbdb89e3bc4b75e7 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 15 Feb 2014 13:00:22 +0000 Subject: [PATCH] Remove comparison operators from PointerMatrixBase and associated infrastructure. This wasn't used anywhere and was likely not working in at least some circumstances. git-svn-id: https://svn.dealii.org/trunk@32492 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 11 ++ deal.II/include/deal.II/lac/matrix_lib.h | 20 +-- deal.II/include/deal.II/lac/pointer_matrix.h | 147 +----------------- .../include/deal.II/lac/transpose_matrix.h | 15 -- deal.II/source/lac/matrix_lib.cc | 8 - 5 files changed, 13 insertions(+), 188 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index a3d9e9f874..83cd398594 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -40,6 +40,17 @@ inconvenience this causes.

    +
  1. Removed: Class PointerMatrixBase (and, consequently, the various + classes derived from it) had comparison operators that were intended to + work generically for any kind of derived class. However, the implementation + used a scheme that was not robust enough to handle the various situations + that derived classes implemented and, consequently, was not always correct. + These operators were not previously used inside the library and, likely, + were not widely used in applications either. They have now been removed. +
    + (Wolfgang Bangerth, 2014/02/15) +
  2. +
  3. Changed: The various classes generating graphical output, such as DataOut or DataOutStack, are all derived from a common interface class DataOutInterface which, in turn was derived from DataOutBase diff --git a/deal.II/include/deal.II/lac/matrix_lib.h b/deal.II/include/deal.II/lac/matrix_lib.h index 589ea82620..03eb9b7a3d 100644 --- a/deal.II/include/deal.II/lac/matrix_lib.h +++ b/deal.II/include/deal.II/lac/matrix_lib.h @@ -145,12 +145,6 @@ private: * Memory for auxiliary vector. */ SmartPointer,ProductMatrix > mem; - - /** - * Return some kind of - * identifier. - */ - virtual const void *get() const; }; @@ -190,7 +184,7 @@ public: void initialize (const MATRIX &M, const double factor); /** - * Delete internal matrix pointer. + * Reset the object to its original state. */ void clear (); @@ -317,11 +311,6 @@ private: * Memory for auxiliary vector. */ SmartPointer,ProductSparseMatrix > mem; - /** - * Return some kind of - * identifier. - */ - virtual const void *get() const; }; @@ -738,13 +727,6 @@ ProductMatrix::Tvmult_add (VECTOR &dst, const VECTOR &src) const } -template -const void * -ProductMatrix::get () const -{ - return (void *) m1; -} - //--------------------------------------------------------------------------- diff --git a/deal.II/include/deal.II/lac/pointer_matrix.h b/deal.II/include/deal.II/lac/pointer_matrix.h index b53d6bab4b..d430c659ab 100644 --- a/deal.II/include/deal.II/lac/pointer_matrix.h +++ b/deal.II/include/deal.II/lac/pointer_matrix.h @@ -78,48 +78,10 @@ public: virtual ~PointerMatrixBase (); /** - * Reset pointer and release the - * matrix pointed to. + * Reset the object to its original state. */ virtual void clear () = 0; - /** - * Find out if two matrices point - * to the same object. - */ - bool operator == (const PointerMatrixBase &) const; - - /** - * Find out if two matrices do - * not point to the same object. - */ - bool operator != (const PointerMatrixBase &) const; - - /** - * Find out if this pointer is - * less. - */ - bool operator < (const PointerMatrixBase &) const; - - /** - * Find out if this pointer is - * less or equal. - */ - bool operator <= (const PointerMatrixBase &) const; - - /** - * Find out if this pointer is - * greater. - */ - bool operator > (const PointerMatrixBase &) const; - - /** - * Find out if this pointer is - * greater or equal. - */ - bool operator >= (const PointerMatrixBase &) const; - - /** * Matrix-vector product. */ @@ -145,12 +107,6 @@ public: */ virtual void Tvmult_add (VECTOR &dst, const VECTOR &src) const = 0; - -private: - /** - * Get the pointer for comparison. - */ - virtual const void *get() const = 0; }; /** @@ -242,12 +198,6 @@ public: const VECTOR &src) const; private: - /** - * Return the address of the - * matrix for comparison. - */ - virtual const void *get() const; - /** * The pointer to the actual matrix. */ @@ -364,12 +314,6 @@ public: const VECTOR &src) const; private: - /** - * Return the address of the - * matrix for comparison. - */ - virtual const void *get() const; - /** * The backup memory if none was provided. */ @@ -510,12 +454,6 @@ public: const Vector &src) const; private: - /** - * Return the address of the - * matrix for comparison. - */ - virtual const void *get() const; - /** * The pointer to the actual matrix. */ @@ -688,65 +626,6 @@ PointerMatrixBase::~PointerMatrixBase () -template -inline -bool -PointerMatrixBase::operator == (const PointerMatrixBase &other) const -{ - return (get() == other.get()); -} - - - -template -inline -bool -PointerMatrixBase::operator != (const PointerMatrixBase &other) const -{ - return (get() != other.get()); -} - - - -template -inline -bool -PointerMatrixBase::operator < (const PointerMatrixBase &other) const -{ - return (get() < other.get()); -} - - - -template -inline -bool -PointerMatrixBase::operator <= (const PointerMatrixBase &other) const -{ - return (get() <= other.get()); -} - - - -template -inline -bool -PointerMatrixBase::operator > (const PointerMatrixBase &other) const -{ - return (get() > other.get()); -} - - - -template -inline -bool -PointerMatrixBase::operator >= (const PointerMatrixBase &other) const -{ - return (get() >= other.get()); -} - - //----------------------------------------------------------------------// @@ -836,13 +715,6 @@ PointerMatrix::Tvmult_add (VECTOR &dst, } -template -inline const void * -PointerMatrix::get () const -{ - return m; -} - //----------------------------------------------------------------------// @@ -977,14 +849,6 @@ PointerMatrixAux::Tvmult_add (VECTOR &dst, } -template -inline const void * -PointerMatrixAux::get () const -{ - return m; -} - - //----------------------------------------------------------------------// @@ -1086,15 +950,6 @@ PointerMatrixVector::Tvmult_add ( } -template -inline const void * -PointerMatrixVector::get () const -{ - return m; -} - - - DEAL_II_NAMESPACE_CLOSE #endif diff --git a/deal.II/include/deal.II/lac/transpose_matrix.h b/deal.II/include/deal.II/lac/transpose_matrix.h index 6558e6a3b8..cb0dd3bae7 100644 --- a/deal.II/include/deal.II/lac/transpose_matrix.h +++ b/deal.II/include/deal.II/lac/transpose_matrix.h @@ -118,12 +118,6 @@ public: const VECTOR &src) const; private: - /** - * Return the address of the - * matrix for comparison. - */ - virtual const void *get() const; - /** * The pointer to the actual matrix. */ @@ -220,15 +214,6 @@ TransposeMatrix::Tvmult_add (VECTOR &dst, } -template -inline const void * -TransposeMatrix::get () const -{ - return m; -} - - - DEAL_II_NAMESPACE_CLOSE #endif diff --git a/deal.II/source/lac/matrix_lib.cc b/deal.II/source/lac/matrix_lib.cc index 69b68c0298..7f869c20bf 100644 --- a/deal.II/source/lac/matrix_lib.cc +++ b/deal.II/source/lac/matrix_lib.cc @@ -135,14 +135,6 @@ ProductSparseMatrix::Tvmult_add (VectorType &dst, const VectorT } -template -const void * -ProductSparseMatrix::get () const -{ - return &*m1; -} - - template class ProductSparseMatrix; template class ProductSparseMatrix; template class ProductSparseMatrix; -- 2.39.5