]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new test
authorweiler <weiler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 27 Aug 2010 09:37:45 +0000 (09:37 +0000)
committerweiler <weiler@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 27 Aug 2010 09:37:45 +0000 (09:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@21743 0785d39b-7218-0410-832d-ea1e28bc413d

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

index b13c42ad000457c50b114c830cbba6222c3d7488..c4db3fd013abc32edc98e1cd4b441759c965adf7 100644 (file)
@@ -21,7 +21,7 @@ default: run-tests
 ############################################################
 
 tests_x = vector-vector vector_memory \
-       full_matrix \
+       full_matrix* \
        householder \
        tridiagonal_matrix \
        tridiagonal_matrix_sym \
diff --git a/tests/lac/full_matrix_02.cc b/tests/lac/full_matrix_02.cc
new file mode 100644 (file)
index 0000000..7b66e24
--- /dev/null
@@ -0,0 +1,60 @@
+//----------------------------  full_matrix_02.cc,v  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2010 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.
+//
+//----------------------------  full_matrix_02.cc,v  ---------------------------
+
+//check method mTmult of FullMatrix
+
+#include "../tests.h"
+#include <cmath>
+#include <fstream>
+#include <iomanip>
+#include <iomanip>
+#include <cstdlib>
+
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <lac/full_matrix.h>
+#include <lac/eigen.h>
+
+const double entries_A[9] = { 1,2,3,4,5,6,7,8,9 };
+const double entries_B[9] = { 2,1,1,1,2,3,2,1,2 };
+const double entries_Z[9] = { 0,0,0,0,0,0,0,0,0 };
+
+// Create a positive definite random matrix
+
+int
+main ()
+{
+  std::ofstream logfile("full_matrix_02/output");
+  deallog << std::fixed;
+  deallog << std::setprecision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  std::srand(3391466);
+
+  FullMatrix<double> A(3,3,entries_A);
+  FullMatrix<double> B(3,3,entries_B);
+  FullMatrix<double> Z(3,3,entries_Z);
+  FullMatrix<double> C(3,3);
+  FullMatrix<double> D(3,3);
+  //compute C= A*B^T in two different ways and compare for equality
+  Z.Tadd(1.,B);
+  A.mmult(D,Z);
+  A.mTmult(C,B);
+  
+  D.add(-1,C);
+  Assert ( D.frobenius_norm() < 1e-15,
+           ExcInternalError());
+  deallog << "OK" << std::endl;
+}    
diff --git a/tests/lac/full_matrix_02/cmp/generic b/tests/lac/full_matrix_02/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.