]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check fill function.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 27 Feb 2006 12:34:41 +0000 (12:34 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 27 Feb 2006 12:34:41 +0000 (12:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@12506 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/lapack_fill.cc [new file with mode: 0644]
tests/lac/lapack_fill/cmp/generic [new file with mode: 0644]

diff --git a/tests/lac/lapack_fill.cc b/tests/lac/lapack_fill.cc
new file mode 100644 (file)
index 0000000..db50d75
--- /dev/null
@@ -0,0 +1,48 @@
+//-------------------------  lapack_fill.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2006 by the deal.II authors
+//
+//    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.
+//
+//-------------------------  lapack_fill.cc  ---------------------------
+
+
+#include "../tests.h"
+#include <lac/lapack_full_matrix.h>
+#include <lac/full_matrix.h>
+#include <fstream>
+
+// A.fill() produced an ExcIndexRange(r,0,m()) exception with
+// the additional Information: Index 6 is not in [0,3[.
+// Bug reported by Florian Prill
+
+int main () 
+{
+  std::ofstream logfile("lapack_fill/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  
+                                  // matrix sizes
+  const unsigned int m = 3;
+  const unsigned int n = 10;       
+
+  LAPACKFullMatrix<double> A(n);
+  FullMatrix<double>       C(m);
+                                  // fill some entries:
+  C(0,0)     = 1.0;
+  C(m-1,m-1) = 1.0;
+                                  // insert C into A's middle:
+  A.fill(C,
+        3,3,
+        0,0);
+                                  // check some values
+  Assert(A(3,3)==1, ExcInternalError());
+  Assert(A(5,5)==1, ExcInternalError());
+  
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/lac/lapack_fill/cmp/generic b/tests/lac/lapack_fill/cmp/generic
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+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.