]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
give an additional name to PointerMatrix for identifying the smart pointers
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 6 May 2005 23:19:09 +0000 (23:19 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 6 May 2005 23:19:09 +0000 (23:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@10655 0785d39b-7218-0410-832d-ea1e28bc413d

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

index f9702a6899fad52d140c68ee65aa66167ac89fce..0bb9a158572bebde935b562dd13d303e7ec0ee55 100644 (file)
@@ -571,7 +571,7 @@ BlockMatrixArray<number>::Entry::Entry (const MATRIX& matrix,
                col (col),
                prefix (prefix),
                transpose (transpose),
-               matrix (new PointerMatrix<MATRIX, Vector<number> >(&matrix))
+               matrix (new PointerMatrix<MATRIX, Vector<number> >(&matrix, typeid(*this).name()))
 {}
 
 
index 501f6f243e81d4885e33c4267a832936e17a4943..36a674c85fa2cd7acd1fea11e9f3f8076a6429e6 100644 (file)
@@ -303,8 +303,8 @@ ProductMatrix<VECTOR>::ProductMatrix (
   VectorMemory<VECTOR>& m)
   : mem(&m, typeid(*this).name())
 {
-  m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1);
-  m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2);
+  m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1, typeid(*this).name());
+  m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2, typeid(*this).name());
 }
 
 
@@ -317,8 +317,8 @@ ProductMatrix<VECTOR>::reinit (
 {
   delete m1;
   delete m2;
-  m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1);
-  m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2);  
+  m1 = new PointerMatrix<MATRIX1, VECTOR>(&mat1, typeid(*this).name());
+  m2 = new PointerMatrix<MATRIX2, VECTOR>(&mat2, typeid(*this).name());
 }
 
 
index ea616cea75581f8ce84628df120979e307d2ff46..922cc3e4f9fa8fda1e71f2704462aaccd48c902d 100644 (file)
@@ -107,14 +107,14 @@ class PointerMatrixBase : public Subscriptor
     
                                     /**
                                      * Matrix-vector product, adding to
-                                     * @p dst.
+                                     * <tt>dst</tt>.
                                      */
     virtual void vmult_add (VECTOR& dst,
                            const VECTOR& src) const = 0;
     
                                     /**
                                      * Tranposed matrix-vector product,
-                                     * adding to @p dst.
+                                     * adding to <tt>dst</tt>.
                                      */
     virtual void Tvmult_add (VECTOR& dst,
                             const VECTOR& src) const = 0;
@@ -144,11 +144,31 @@ class PointerMatrix : public PointerMatrixBase<VECTOR>
                                      * argument is stored in this
                                      * class. As usual, the lifetime of
                                      * <tt>*M</tt> must be longer than the
-                                     * one of the @p PointerMatrix.
+                                     * one of the PointerMatrix.
                                      *
-                                     * If @p M is zero, no matrix is stored.
+                                     * If <tt>M</tt> is zero, no
+                                     * matrix is stored.
                                      */
     PointerMatrix (const MATRIX* M=0);
+
+                                    /**
+                                     * Constructor. The name argument
+                                     * is used to identify the
+                                     * SmartPointer for this object.
+                                     */
+    PointerMatrix(const char* name);
+    
+                                    /**
+                                     * Constructor. <tt>M</tt> points
+                                     * to a matrix which must live
+                                     * longer than the
+                                     * PointerMatrix. The name
+                                     * argument is used to identify
+                                     * the SmartPointer for this
+                                     * object.
+                                     */
+    PointerMatrix(const MATRIX* M,
+                 const char* name);
     
                                     /**
                                      * Return whether the object is
@@ -178,14 +198,14 @@ class PointerMatrix : public PointerMatrixBase<VECTOR>
     
                                     /**
                                      * Matrix-vector product, adding to
-                                     * @p dst.
+                                     * <tt>dst</tt>.
                                      */
     virtual void vmult_add (VECTOR& dst,
                            const VECTOR& src) const;
     
                                     /**
                                      * Tranposed matrix-vector product,
-                                     * adding to @p dst.
+                                     * adding to <tt>dst</tt>.
                                      */
     virtual void Tvmult_add (VECTOR& dst,
                             const VECTOR& src) const;
@@ -292,13 +312,29 @@ PointerMatrixBase<VECTOR>::operator >= (const PointerMatrixBase<VECTOR>& other)
 }
 
 
+//----------------------------------------------------------------------//
+
 
 template<class MATRIX, class VECTOR>
 PointerMatrix<MATRIX, VECTOR>::PointerMatrix (const MATRIX* M)
-  :
-  m(M, typeid(*this).name())
+  : m(M, typeid(*this).name())
+{}
+
+
+template<class MATRIX, class VECTOR>
+PointerMatrix<MATRIX, VECTOR>::PointerMatrix (const char* name)
+  : m(0, name)
+{}
+
+
+template<class MATRIX, class VECTOR>
+PointerMatrix<MATRIX, VECTOR>::PointerMatrix (
+  const MATRIX* M,
+  const char* name)
+  : m(M, name)
 {}
 
+
 template<class MATRIX, class VECTOR>
 inline const PointerMatrix<MATRIX, VECTOR>&
 PointerMatrix<MATRIX, VECTOR>::operator= (const MATRIX* M)

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.