]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add default constructor and set_memory to PointerMatrixAux
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 14 Jun 2006 12:02:57 +0000 (12:02 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 14 Jun 2006 12:02:57 +0000 (12:02 +0000)
git-svn-id: https://svn.dealii.org/trunk@13244 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.html
deal.II/lac/include/lac/pointer_matrix.h

index 5bd9a46fc48ca626e0704ec635c0f5e0e7f04678..3f599af85db7ce7258242d00c30f7e467b38dd74 100644 (file)
@@ -520,8 +520,15 @@ inconvenience this causes.
 
 <ol>
   
-  <li> <p>Fixed: The <code
-       class="class">FullMatrix::print</code> would yield a link error
+  <li> <p>Improved: <code class="class">PointerMatrixAux</code> now has a
+  default constructor and a function for setting the <code
+  class="class">VectorMemory</code> object.
+  <br>
+  (GK 2006/06/14)
+  </p>
+  
+  <li> <p>Fixed: <code
+       class="member">FullMatrix::print</code> would yield a link error
        when used with <code>std::ofstream</code> since an explicit
        instantiation was missing. The function has now been moved to
        the header file and made inline so that it is always visible,
index c38ea22c5d4b722c9dc2dcf6e792803062add963..3a2b3d822fc464bbcbbebb3726afd64c7fbc6f93 100644 (file)
@@ -264,7 +264,7 @@ class PointerMatrixAux : public PointerMatrixBase<VECTOR>
                                      * If <tt>M</tt> is zero, no
                                      * matrix is stored.
                                      */
-    PointerMatrixAux (VectorMemory<VECTOR>* mem,
+    PointerMatrixAux (VectorMemory<VECTOR>* mem = 0,
                      const MATRIX* M=0);
 
                                     /**
@@ -296,6 +296,12 @@ class PointerMatrixAux : public PointerMatrixBase<VECTOR>
                                      * empty. 
                                      */
     bool empty () const;
+
+                                    /**
+                                     * Assign a new VectorMemory
+                                    object for getting auxiliary vectors.
+                                     */
+    void set_memory(VectorMemory<VECTOR>* mem);
     
                                     /**
                                      * Assign a new matrix
@@ -584,6 +590,14 @@ PointerMatrixAux<MATRIX, VECTOR>::operator= (const MATRIX* M)
 }
 
 
+template<class MATRIX, class VECTOR>
+inline void
+PointerMatrixAux<MATRIX, VECTOR>::set_memory(VectorMemory<VECTOR>* M)
+{
+  mem = M;
+}
+
+
 template<class MATRIX, class VECTOR>
 inline bool
 PointerMatrixAux<MATRIX, VECTOR>::empty () const
@@ -598,6 +612,7 @@ inline void
 PointerMatrixAux<MATRIX, VECTOR>::vmult (VECTOR& dst,
                                      const VECTOR& src) const
 {
+  Assert (mem != 0, ExcNotInitialized());
   Assert (m != 0, ExcNotInitialized());
   m->vmult (dst, src);
 }
@@ -608,6 +623,7 @@ inline void
 PointerMatrixAux<MATRIX, VECTOR>::Tvmult (VECTOR& dst,
                                       const VECTOR& src) const
 {
+  Assert (mem != 0, ExcNotInitialized());
   Assert (m != 0, ExcNotInitialized());
   m->Tvmult (dst, src);
 }
@@ -618,6 +634,7 @@ inline void
 PointerMatrixAux<MATRIX, VECTOR>::vmult_add (VECTOR& dst,
                                          const VECTOR& src) const
 {
+  Assert (mem != 0, ExcNotInitialized());
   Assert (m != 0, ExcNotInitialized());
   VECTOR* v = mem->alloc();
   v->reinit(dst);
@@ -632,6 +649,7 @@ inline void
 PointerMatrixAux<MATRIX, VECTOR>::Tvmult_add (VECTOR& dst,
                                              const VECTOR& src) const
 {
+  Assert (mem != 0, ExcNotInitialized());
   Assert (m != 0, ExcNotInitialized());
   VECTOR* v = mem->alloc();
   v->reinit(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.