]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed small bug in direct inversion of full matrices.
authorprill <prill@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Dec 2006 13:16:01 +0000 (13:16 +0000)
committerprill <prill@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 18 Dec 2006 13:16:01 +0000 (13:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@14260 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.html
deal.II/lac/include/lac/full_matrix.templates.h

index 7c00e8190974185c7c1dc3e60e9e778869945c79..b4b65ee8d38b2bef5ac57f232ed11b4f01c08f37 100644 (file)
@@ -695,6 +695,12 @@ inconvenience this causes.
 <h3>lac</h3>
 
 <ol>
+  <li> <p>Fixed: The <code class="member">FullMatrix::invert</code> 
+       function would return wrong results if one tried to invert a
+       matrix of dimension smaller than 5 in situ. This is now fixed.
+       <br>
+       (Florian Prill 2006/12/18)
+       </p>
 
   <li> <p>Improved: The <code
        class="class">SparsityPattern</code> class would produce
index 9f126ef80133c571d550ae88e5de60ec1d5e8de4..d6bf96dfed21ea726667d9e15eeedb8b92317d3a 100644 (file)
@@ -1999,7 +1999,15 @@ FullMatrix<number>::invert (const FullMatrix<number2> &M)
           ExcDimensionMismatch(this->n_cols(), M.n_cols()));
   Assert (this->n_rows() == M.n_rows(),
          ExcDimensionMismatch(this->n_rows(), M.n_rows()));
-  
+
+  if ((&M == this) && (this->n_cols() <= 4))
+    {
+                                      // avoid overwriting source
+                                      // by destination matrix:
+      FullMatrix<number2> M2 = M;
+      invert(M2);
+    }
+  else
   switch (this->n_cols()) 
     {
       case 1:

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.