]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bug fix: FullMatrices are mxn matrices and not nxm.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 10 Dec 2007 14:21:43 +0000 (14:21 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 10 Dec 2007 14:21:43 +0000 (14:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@15590 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/full_matrix.templates.h

index e9a48242ea3755686c0be8a2254a8e89a3a7c526..aafc65b128056389dcd147dd128bec0800da20e9 100644 (file)
@@ -476,8 +476,8 @@ void FullMatrix<number>::equ (const number               a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (unsigned int i=0; i<m(); ++i)
+    for (unsigned int j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j));
 }
 
@@ -497,8 +497,8 @@ FullMatrix<number>::equ (const number               a,
   Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
   Assert (n() == B.n(), ExcDimensionMismatch(n(), B.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (unsigned int i=0; i<m(); ++i)
+    for (unsigned int j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j)) + b * number(B(i,j));
 }
 
@@ -522,8 +522,8 @@ FullMatrix<number>::equ (const number               a,
   Assert (m() == C.m(), ExcDimensionMismatch(m(), C.m()));
   Assert (n() == C.n(), ExcDimensionMismatch(n(), C.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (unsigned int i=0; i<m(); ++i)
+    for (unsigned int j=0; j<n(); ++j)
       (*this)(i,j) = a * number(A(i,j)) +
                     b * number(B(i,j)) +
                     c * number(C(i,j));
@@ -731,8 +731,8 @@ FullMatrix<number>::add (const number               a,
   Assert (m() == A.m(), ExcDimensionMismatch(m(), A.m()));
   Assert (n() == A.n(), ExcDimensionMismatch(n(), A.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (unsigned int i=0; i<m(); ++i)
+    for (unsigned int j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j));
 }
 
@@ -752,8 +752,8 @@ FullMatrix<number>::add (const number               a,
   Assert (m() == B.m(), ExcDimensionMismatch(m(), B.m()));
   Assert (n() == B.n(), ExcDimensionMismatch(n(), B.n()));
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (unsigned int i=0; i<m(); ++i)
+    for (unsigned int j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j)) + b * number(B(i,j));
 }
 
@@ -779,8 +779,8 @@ FullMatrix<number>::add (const number               a,
   Assert (n() == C.n(), ExcDimensionMismatch(n(), C.n()));
 
 
-  for (unsigned int i=0; i<n(); ++i)
-    for (unsigned int j=0; j<m(); ++j)
+  for (unsigned int i=0; i<m(); ++i)
+    for (unsigned int j=0; j<n(); ++j)
       (*this)(i,j) += a * number(A(i,j)) +
                      b * number(B(i,j)) +
                      c * number(C(i,j));

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.