]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
functions set_matrix added
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 9 Jan 2003 15:29:35 +0000 (15:29 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 9 Jan 2003 15:29:35 +0000 (15:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@6897 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_matrix.h

index 16160b59ce8910b3419cf81d67971205888d1466..9606329ef905976b9109dbe40044ba7ea20eced9 100644 (file)
@@ -30,10 +30,23 @@ class MGMatrix : public MGMatrixBase<VECTOR>,
                                     /**
                                      * Constructor. The argument is
                                      * handed over to the
-                                     * @p{SmartPointer} constructor.
+                                     * @p{SmartPointer}
+                                     * constructor. The matrix object
+                                     * must exist longer as the
+                                     * @p{MGMatrix} object, since
+                                     * only a pointer is stored.
                                      */
     MGMatrix (MGLevelObject<MATRIX>* = 0);
     
+                                    /**
+                                     * Set the matrix object to be
+                                     * used. The matrix object must
+                                     * exist longer as the
+                                     * @p{MGMatrix} object, since
+                                     * only a pointer is stored.
+                                     */
+    void set_matrix (MGLevelObject<MATRIX>* M);
+    
                                     /**
                                      * Matrix-vector-multiplication on
                                      * a certain level.
@@ -93,6 +106,15 @@ class MGMatrixSelect : public MGMatrixBase<Vector<number> >,
                    const unsigned int col = 0,
                    MGLevelObject<MATRIX>* = 0);
 
+                                    /**
+                                     * Set the matrix object to be
+                                     * used. The matrix object must
+                                     * exist longer as the
+                                     * @p{MGMatrix} object, since
+                                     * only a pointer is stored.
+                                     */
+    void set_matrix (MGLevelObject<MATRIX>* M);
+    
                                     /**
                                      * Select the block for
                                      * multiplication.
@@ -152,6 +174,13 @@ MGMatrix<MATRIX, VECTOR>::MGMatrix (MGLevelObject<MATRIX>* p)
 {}
 
 
+template <class MATRIX, class VECTOR>
+void
+MGMatrix<MATRIX, VECTOR>::set_matrix (MGLevelObject<MATRIX>* p)
+{
+  (SmartPointer<MGLevelObject<MATRIX> >) (*this) = p;
+}
+
 
 template <class MATRIX, class VECTOR>
 void
@@ -224,6 +253,14 @@ MGMatrixSelect (const unsigned int row,
 
 
 
+template <class MATRIX, typename number>
+void
+MGMatrixSelect<MATRIX, number>::set_matrix (MGLevelObject<MATRIX>* p)
+{
+  (SmartPointer<MGLevelObject<MATRIX> >) (*this) = p;
+}
+
+
 template <class MATRIX, typename number>
 void
 MGMatrixSelect<MATRIX, 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.