From: guido Date: Mon, 6 Jan 2003 08:54:41 +0000 (+0000) Subject: empty function added X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=885d194058866eca118f2b5d17d4f0e8f52e79fa;p=dealii-svn.git empty function added git-svn-id: https://svn.dealii.org/trunk@6864 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/pointer_matrix.h b/deal.II/lac/include/lac/pointer_matrix.h index 2344ea56de..975433c809 100644 --- a/deal.II/lac/include/lac/pointer_matrix.h +++ b/deal.II/lac/include/lac/pointer_matrix.h @@ -43,6 +43,12 @@ class PointerMatrixBase : public Subscriptor */ virtual ~PointerMatrixBase (); + /** + * Check if pointer is zero or + * matrix is empty. + */ + virtual bool empty () const = 0; + /** * Matrix-vector product. */ @@ -103,6 +109,12 @@ public: */ const PointerMatrix& operator= (const MATRIX* M); + /** + * Check if pointer is zero or + * matrix is empty. + */ + virtual bool empty () const; + /** * Matrix-vector product. @@ -160,6 +172,15 @@ PointerMatrix::operator= (const MATRIX* M) return *this; } +template +bool +PointerMatrix::empty () const +{ + if (m == 0) + return true; + return m->empty(); +} + template void PointerMatrix::vmult (VECTOR& dst,