]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
allow for change of matrices in ProductMatrix
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 3 May 2005 07:45:28 +0000 (07:45 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 3 May 2005 07:45:28 +0000 (07:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@10615 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/matrix_lib.h

index 5dbe026c3ea5c9cd87cc9ec0988cc2bb6bf1ff77..501f6f243e81d4885e33c4267a832936e17a4943 100644 (file)
@@ -52,7 +52,13 @@ class ProductMatrix : public PointerMatrixBase<VECTOR>
     ProductMatrix(const MATRIX1& m1,
                  const MATRIX2& m2,
                  VectorMemory<VECTOR>& mem);
-
+    
+                                    /**
+                                     * Change the matrices.
+                                     */
+    template <class MATRIX1, class MATRIX2>
+    void reinit(const MATRIX1& m1, const MATRIX2& m2);
+    
                                     /**
                                      * Destructor.
                                      */
@@ -302,6 +308,20 @@ ProductMatrix<VECTOR>::ProductMatrix (
 }
 
 
+template<class VECTOR>
+template<class MATRIX1, class MATRIX2>
+void
+ProductMatrix<VECTOR>::reinit (
+  const MATRIX1& mat1,
+  const MATRIX2& mat2)
+{
+  delete m1;
+  delete m2;
+  m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1);
+  m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2);  
+}
+
+
 template<class VECTOR>
 ProductMatrix<VECTOR>::~ProductMatrix ()
 {

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.