]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug where the FullMatrix::copy_from function could not be compiled.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Sep 2003 20:38:16 +0000 (20:38 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Sep 2003 20:38:16 +0000 (20:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@7959 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/c-4-0.html
tests/bits/Makefile
tests/bits/full_matrix_1.cc [new file with mode: 0644]
tests/results/i686-pc-linux-gnu+gcc2.95/bits/full_matrix_1.output [new file with mode: 0644]
tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_1.output [new file with mode: 0644]
tests/results/sparc-sun-solaris2.7+gcc2.95/bits/full_matrix_1.output [new file with mode: 0644]

index 62a41d7d7e40fdf820734245f5071c5be296e326..9bd55268ae0afc1ca98b8e25d147324f68b6029e 100644 (file)
@@ -135,13 +135,19 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>lac</h3>
 
 <ol>
+  <li> <p> Fixed: <code class="class">FullMatrix</code>::<code
+       class="member">copy_from</code> didn't compile when copying
+       from a sparse matrix. This is now fixed.
+       <br>
+       (Ralf B. Schulz 2002/09/04)
+       </p>
 
   <li> <p> New: The classes <code class="class">FullMatrix</code> and
-  <code class="class">PreconditionBlockJacobi</code> have a <code
-  class="class">const_iterator</code>.
-  <br>
-  (GK 2003/07/18)
-  </p>
+       <code class="class">PreconditionBlockJacobi</code> have a <code
+       class="class">const_iterator</code>.
+       <br>
+       (GK 2003/07/18)
+       </p>
 </ol>
 
 
index 14562c8989b863a039e312a355936e8603f0d734..7be17ed8c322dfe634d737a94cdd3352282d5e45 100644 (file)
@@ -29,6 +29,7 @@ anna_4.exe              : anna_4.g.$(OBJEXT)               $(libraries)
 anna_5.exe              : anna_5.g.$(OBJEXT)               $(libraries)
 anna_6.exe              : anna_6.g.$(OBJEXT)               $(libraries)
 geometry_info_1.exe     : geometry_info_1.g.$(OBJEXT)      $(libraries)
+full_matrix_1.exe       : full_matrix_1.g.$(OBJEXT)        $(libraries)
 data_out_01.exe         : data_out_01.g.$(OBJEXT)          $(libraries)
 data_out_02.exe         : data_out_02.g.$(OBJEXT)          $(libraries)
 data_out_faces_01.exe   : data_out_faces_01.g.$(OBJEXT)    $(libraries)
@@ -105,6 +106,7 @@ cylinder.exe            : cylinder.g.$(OBJEXT)             $(libraries)
 
 tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \
        geometry_info_1 point_inside_1 point_inside_2 \
+       full_matrix_1 \
        data_out_01 data_out_02 data_out_faces_01 data_out_faces_02 \
        data_out_rotation_01 data_out_rotation_02 data_out_stack_01 \
        dof_tools_00a \
diff --git a/tests/bits/full_matrix_1.cc b/tests/bits/full_matrix_1.cc
new file mode 100644 (file)
index 0000000..1c96fd2
--- /dev/null
@@ -0,0 +1,54 @@
+//----------------------------  full_matrix_1.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2002, 2003 by the deal.II authors and Anna Schneebeli
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------  full_matrix_1.cc  ---------------------------
+
+
+// FullMatrix::copy_from could not be compiled if we copied from a
+// sparse matrix. make sure this now works
+
+#include <base/logstream.h>
+#include <lac/sparse_matrix.h>
+#include <lac/full_matrix.h>
+#include <fstream>
+
+
+int main () 
+{
+  std::ofstream logfile("full_matrix_1.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  const unsigned int N = 4;
+  FullMatrix<double> f(N,N);
+
+  SparsityPattern s (N,N,N);
+  for (unsigned int i=0; i<N; ++i)
+    for (unsigned int j=0; j<N; ++j)
+      s.add (i,j);
+  s.compress ();
+
+  SparseMatrix<double> sm(s);
+  for (unsigned int i=0; i<N; ++i)
+    for (unsigned int j=0; j<N; ++j)
+      sm.set (i,j,i*j);
+
+  f.copy_from (sm);
+
+  for (unsigned int i=0; i<N; ++i)
+    for (unsigned int j=0; j<N; ++j)
+      {
+       deallog << i << ' ' << j << ' ' << f(i,j) << std::endl;
+       Assert (f(i,j) == sm(i,j), ExcInternalError());
+      }
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/results/i686-pc-linux-gnu+gcc2.95/bits/full_matrix_1.output b/tests/results/i686-pc-linux-gnu+gcc2.95/bits/full_matrix_1.output
new file mode 100644 (file)
index 0000000..98f21bf
--- /dev/null
@@ -0,0 +1,18 @@
+
+DEAL::0 0 0.00000
+DEAL::0 1 0.00000
+DEAL::0 2 0.00000
+DEAL::0 3 0.00000
+DEAL::1 0 0.00000
+DEAL::1 1 1.00000
+DEAL::1 2 2.00000
+DEAL::1 3 3.00000
+DEAL::2 0 0.00000
+DEAL::2 1 2.00000
+DEAL::2 2 4.00000
+DEAL::2 3 6.00000
+DEAL::3 0 0.00000
+DEAL::3 1 3.00000
+DEAL::3 2 6.00000
+DEAL::3 3 9.00000
+DEAL::OK
diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_1.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/full_matrix_1.output
new file mode 100644 (file)
index 0000000..98f21bf
--- /dev/null
@@ -0,0 +1,18 @@
+
+DEAL::0 0 0.00000
+DEAL::0 1 0.00000
+DEAL::0 2 0.00000
+DEAL::0 3 0.00000
+DEAL::1 0 0.00000
+DEAL::1 1 1.00000
+DEAL::1 2 2.00000
+DEAL::1 3 3.00000
+DEAL::2 0 0.00000
+DEAL::2 1 2.00000
+DEAL::2 2 4.00000
+DEAL::2 3 6.00000
+DEAL::3 0 0.00000
+DEAL::3 1 3.00000
+DEAL::3 2 6.00000
+DEAL::3 3 9.00000
+DEAL::OK
diff --git a/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/full_matrix_1.output b/tests/results/sparc-sun-solaris2.7+gcc2.95/bits/full_matrix_1.output
new file mode 100644 (file)
index 0000000..98f21bf
--- /dev/null
@@ -0,0 +1,18 @@
+
+DEAL::0 0 0.00000
+DEAL::0 1 0.00000
+DEAL::0 2 0.00000
+DEAL::0 3 0.00000
+DEAL::1 0 0.00000
+DEAL::1 1 1.00000
+DEAL::1 2 2.00000
+DEAL::1 3 3.00000
+DEAL::2 0 0.00000
+DEAL::2 1 2.00000
+DEAL::2 2 4.00000
+DEAL::2 3 6.00000
+DEAL::3 0 0.00000
+DEAL::3 1 3.00000
+DEAL::3 2 6.00000
+DEAL::3 3 9.00000
+DEAL::OK

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.