]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
function clear fixed
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Jun 2004 17:53:36 +0000 (17:53 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 9 Jun 2004 17:53:36 +0000 (17:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@9415 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_matrix_base.h
deal.II/lac/include/lac/block_sparse_matrix.h
deal.II/lac/include/lac/block_sparse_matrix.templates.h

index c83ae4b6c11df40693e8e8d6a4d0eb176712c85e..6346271572310e795b28f75ef473a35f7a8bfe91 100644 (file)
@@ -326,20 +326,6 @@ class BlockMatrixBase : public Subscriptor
     BlockMatrixBase &
     copy_from (const BlockMatrixType &source);
 
-                                    /**
-                                     * Release all memory and return
-                                     * to a state just like after
-                                     * having called the default
-                                     * constructor. It also forgets
-                                     * the sparsity pattern it was
-                                     * previously tied to.
-                                     *
-                                     * This calls SparseMatrix::clear on all
-                                     * sub-matrices and then resets this
-                                     * object to have no blocks at all.
-                                     */
-    void clear ();
-
                                     /**
                                      * Access the block with the
                                      * given coordinates.
@@ -700,6 +686,27 @@ class BlockMatrixBase : public Subscriptor
                     << arg3 << ',' << arg4 << "] have differing column numbers.");
 
   protected:
+                                    /**
+                                     * Release all memory and return
+                                     * to a state just like after
+                                     * having called the default
+                                     * constructor. It also forgets
+                                     * the sparsity pattern it was
+                                     * previously tied to.
+                                     *
+                                     * This calls clear for all
+                                     * sub-matrices and then resets this
+                                     * object to have no blocks at all.
+                                     *
+                                     * This function is protected
+                                     * since it may be necessary to
+                                     * release additional structures.
+                                     * A derived class can make it
+                                     * public again, if it is
+                                     * sufficient.
+                                     */
+    void clear ();
+
                                      /**
                                       * Index arrays for rows and columns.
                                       */
index 9b834ce76091e0942cdd5e53634fb8c4bcad3918..f32d54a7ef511de8c25e6b681f89df07c63fcba2 100644 (file)
@@ -145,6 +145,20 @@ class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix<number> >
     BlockSparseMatrix<number> &
     operator = (const double d);
 
+
+                                    /**
+                                     * Release all memory and return
+                                     * to a state just like after
+                                     * having called the default
+                                     * constructor. It also forgets
+                                     * the sparsity pattern it was
+                                     * previously tied to.
+                                     *
+                                     * This calls SparseMatrix::clear on all
+                                     * sub-matrices and then resets this
+                                     * object to have no blocks at all.
+                                     */
+    void clear ();
                                     /**
                                      * Reinitialize the sparse matrix
                                      * with the given sparsity
index f602d1aff7839ff7d5f3ac9e2e71c27b123ca289..ae4dab373fbf54b05bb17a8f30df13380e9c8ccd 100644 (file)
@@ -95,6 +95,17 @@ BlockSparseMatrix<number>::operator = (const double d)
 
 
 
+template <typename number>
+inline
+void
+BlockSparseMatrix<number>::clear () 
+{
+  BlockMatrixBase<SparseMatrix<number> >::clear();
+  sparsity_pattern = 0;
+}
+
+
+
 template <typename number>
 void
 BlockSparseMatrix<number>::

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.