]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
empty function added
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 6 Jan 2003 08:54:41 +0000 (08:54 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 6 Jan 2003 08:54:41 +0000 (08:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@6864 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/pointer_matrix.h

index 2344ea56de8a10400185961cc56153f212393305..975433c809352aa31dbf0df2d9956ae6e3076256 100644 (file)
@@ -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<MATRIX, VECTOR>::operator= (const MATRIX* M)
   return *this;
 }
 
+template<class MATRIX, class VECTOR>
+bool
+PointerMatrix<MATRIX, VECTOR>::empty () const
+{
+  if (m == 0)
+    return true;
+  return m->empty();
+}
+
 template<class MATRIX, class VECTOR>
 void
 PointerMatrix<MATRIX, VECTOR>::vmult (VECTOR& dst,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.