]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix use of wrong index.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Aug 2008 19:14:48 +0000 (19:14 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Aug 2008 19:14:48 +0000 (19:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@16492 0785d39b-7218-0410-832d-ea1e28bc413d

20 files changed:
tests/bits/sparse_matrix_01.cc
tests/bits/sparse_matrix_01a.cc
tests/bits/sparse_matrix_02.cc
tests/bits/sparse_matrix_03.cc
tests/bits/sparse_matrix_03a.cc
tests/bits/sparse_matrix_03b.cc
tests/bits/sparse_matrix_05.cc
tests/bits/sparse_matrix_05a.cc
tests/bits/sparse_matrix_06.cc
tests/bits/sparse_matrix_07.cc
tests/bits/sparse_matrix_08.cc
tests/bits/sparse_matrix_09.cc
tests/bits/sparse_matrix_10.cc
tests/bits/sparse_matrix_vector_01.cc
tests/bits/sparse_matrix_vector_02.cc
tests/bits/sparse_matrix_vector_03.cc
tests/bits/sparse_matrix_vector_04.cc
tests/bits/sparse_matrix_vector_05.cc
tests/bits/sparse_matrix_vector_06.cc
tests/bits/sparse_matrix_vector_07.cc

index e545109e2406f2353a92f9aa02dec8be891c0d39..61b01c66db08a7d04656fd969485b379bd49405c 100644 (file)
@@ -34,13 +34,13 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
                                    // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
index c952e3554d063d846c9e62939f1639c71f3dd2af..a140c1207691fa42127e323979e8e114f8ed5c78 100644 (file)
@@ -35,13 +35,13 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
                                    // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
index 14c5ce508ab8734ea69e7494255d92c1fe2b9b5e..d9e1a6c2bac8ad7d57cf67fcd4e2ddcc318d7cb8 100644 (file)
@@ -33,13 +33,13 @@ void test ()
 
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
 
                                    // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
index f02ccda26b65db1aaefab20b630451307f23bbbf..c2ef291e72b27a7caa583cd852937b1b99a3ac5f 100644 (file)
@@ -35,7 +35,7 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           if (i*j % 2 == 0)
@@ -46,7 +46,7 @@ void test ()
   
                                    // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
index aa53e3d16f8a8e42a3f62cb760d68b0e842af8da..18f72edf70e2a348db5fa5cbca87e4f593707ead 100644 (file)
@@ -38,19 +38,19 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
                                    // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
   
                                    // then make sure we retrieve the correct
                                    // ones
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
index 2a4435c320050bca9ba4873167489dfd3042c245..294fbe38a56bcdc9bfa496e678fe7aad2b23b48b 100644 (file)
@@ -38,19 +38,19 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
                                    // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
   
                                    // then make sure we retrieve the correct
                                    // ones
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == 2*(i*j*.5+.5), ExcInternalError());
index f195d3f0c0b29abeae9391ebf6d333736edf500b..2c755e37b95fdc4267fa339a580a1534afaf82ec 100644 (file)
@@ -40,7 +40,7 @@ void test ()
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     {
-      for (unsigned int j=0; j<m.m(); ++j)
+      for (unsigned int j=0; j<m.n(); ++j)
         if ((i+2*j+1) % 3 == 0)
           {
             m.set (i,j, i*j*.5+.5);
index 1117f364042d6e93d0277707c1e8f323bf30a2e6..9c07184b61c71c917502e23b5acbad3bc82d7390 100644 (file)
@@ -39,7 +39,7 @@ void test ()
                                    // sparsity pattern
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           m.set (i,j, i*j*.5+.5);
index 34c67c19f445c43e15616c7876da5ba3242ea541..30ef05f6e1007caed6367c438b31dfd7ba6ab021 100644 (file)
@@ -33,7 +33,7 @@ void test ()
                                    // first set a few entries. count how many
                                    // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);  
 
index 1b0f27ff1875de1867dbd499b9f1d7e8e280e296..956359fe120f7cf65ec79245f250a013b0f3a27f 100644 (file)
@@ -33,7 +33,7 @@ void test ()
                                    // first set a few entries. count how many
                                    // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);  
 
index 009f93c37bbed51b4c1844b72d0f46a17d556da5..9dc8e2041f0b66b7ce9390daf5f432e51f0d108b 100644 (file)
@@ -34,7 +34,7 @@ void test ()
                                    // entries we have
   double norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           m.set (i,j, i*j*.5+.5);
index f01279afc6b69c0f49b8815feb6ae87358571b13..3f691a5783a9b3d09daf20d33164052a7862de09 100644 (file)
@@ -32,7 +32,7 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
@@ -42,7 +42,7 @@ void test ()
   m *= 1.25;
   
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == (i*j*.5+.5)*1.25, ExcInternalError());
index 7140af394d0dee30b0ef6888fadbec53509f6db3..bc0295389e7c65376f5b779a79a615e4b60fe961 100644 (file)
@@ -32,7 +32,7 @@ void test ()
   
                                    // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
@@ -42,7 +42,7 @@ void test ()
   m /= 4./3.;
   
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         {
           Assert (m(i,j) == (i*j*.5+.5)/4*3, ExcInternalError());
index 2cef6ddc19c613368dcd6d039514794bf279772c..f6910a47875846d41717f885958bcfeafecba029 100644 (file)
@@ -36,7 +36,7 @@ void test (Vector<double> &v,
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -54,7 +54,7 @@ void test (Vector<double> &v,
       Assert (v(i) == i, ExcInternalError());
 
       double result = 0;
-      for (unsigned int j=0; j<m.m(); ++j)
+      for (unsigned int j=0; j<m.n(); ++j)
         result += (i+2*j)*j;
       Assert (w(i) == result, ExcInternalError());
     }
index c4b559d7d05588aed3adf1fedb235ebab821cb8b..831422fd2c253a427f61fd81a61d0e58daafa4ed 100644 (file)
@@ -36,7 +36,7 @@ void test (Vector<double> &v,
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -54,7 +54,7 @@ void test (Vector<double> &v,
       Assert (v(i) == i, ExcInternalError());
 
       double result = 0;
-      for (unsigned int j=0; j<m.m(); ++j)
+      for (unsigned int j=0; j<m.n(); ++j)
         result += (j+2*i)*j;
       Assert (w(i) == result, ExcInternalError());
     }
index 9e7d07c4671f1be89b1ee6080d894bb6dd17be26..66220ed27963352103072bcd423b8c0263d7ade1 100644 (file)
@@ -36,7 +36,7 @@ void test (Vector<double> &v,
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -57,7 +57,7 @@ void test (Vector<double> &v,
       Assert (v(i) == i, ExcInternalError());
 
       double result = 0;
-      for (unsigned int j=0; j<m.m(); ++j)
+      for (unsigned int j=0; j<m.n(); ++j)
         result += (i+2*j)*j;
       Assert (w(i) == i+result, ExcInternalError());
     }
index 905461f66246ab17c3e65ff11abc1b163f2f30ad..ea584243936e17d362e7866ea5ed5d5b4a28a5eb 100644 (file)
@@ -36,7 +36,7 @@ void test (Vector<double> &v,
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -57,7 +57,7 @@ void test (Vector<double> &v,
       Assert (v(i) == i, ExcInternalError());
 
       double result = 0;
-      for (unsigned int j=0; j<m.m(); ++j)
+      for (unsigned int j=0; j<m.n(); ++j)
         result += (j+2*i)*j;
       Assert (w(i) == i+result, ExcInternalError());
     }
index 12c2bf88744bfe37a82f5c0ac628768dd1ecc80a..5259e3bcad1512ca951da0b25d6a50c3a206cbcd 100644 (file)
@@ -36,7 +36,7 @@ void test (Vector<double> &v,
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -60,7 +60,7 @@ void test (Vector<double> &v,
 
   double result = 0;
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       result += (i+2*j)*j*(i+1);
 
   Assert (s == result, ExcInternalError());
index 3c5bdc2ad668fe656d5295dadff541d6b924e9ad..67474ca1413548cd032711341d456ef7e023f373 100644 (file)
@@ -35,7 +35,7 @@ void test (Vector<double> &v)
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -52,7 +52,7 @@ void test (Vector<double> &v)
 
   double result = 0;
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
       result += (i+2*j)*j*i;
 
   Assert (s == result, ExcInternalError());
index 9a67041f0fd35677b1ab81eb3cf8f9ed7bbb981a..7d67e1e1c0d2f5eed1f0f08ecac73cbd37c037f3 100644 (file)
@@ -37,7 +37,7 @@ void test (Vector<double> &v,
                                    // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
-    for (unsigned int j=0; j<m.m(); ++j)
+    for (unsigned int j=0; j<m.n(); ++j)
         m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
@@ -59,7 +59,7 @@ void test (Vector<double> &v,
       Assert (w(i) == i+1, ExcInternalError());
 
       double result = i+1;
-      for (unsigned int j=0; j<m.m(); ++j)
+      for (unsigned int j=0; j<m.n(); ++j)
         result -= (i+2*j)*j;
 
       Assert (x(i) == result, ExcInternalError());

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.