]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a test for SparseMatrixEZ::print_formatted().
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Feb 2007 02:45:35 +0000 (02:45 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Feb 2007 02:45:35 +0000 (02:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@14429 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6be139206ed162188a3d005b1b9e08ba61a10629..201ea8aaf1b69202b61d47a7c733f6d524c79008 100644 (file)
@@ -1,6 +1,6 @@
 ############################################################
 # $Id$
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 ############################################################
 
 ############################################################
@@ -29,7 +29,8 @@ tests_x = vector-vector \
        matrix_lib matrix_out pointer_matrix pointer_matrix_vector \
        solver eigen \
        sparse_ilu sparse_ilu_t lapack_fill block_minres \
-       identity_matrix* trace
+       identity_matrix* trace \
+       print_formatted_*
 
 
 # from above list of regular expressions, generate the real set of
diff --git a/tests/lac/print_formatted_ez_01.cc b/tests/lac/print_formatted_ez_01.cc
new file mode 100644 (file)
index 0000000..0ae97f3
--- /dev/null
@@ -0,0 +1,49 @@
+//----------------------------  print_formatted_ez_01.cc,v  ---------------------------
+//    $Id: matrices.cc 11749 2005-11-09 19:11:20Z wolf $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2005, 2007 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.
+//
+//----------------------------  print_formatted_ez_01.cc,v  ---------------------------
+
+// Check SparseMatrixEZ::print_formatted
+
+#include "../tests.h"
+
+#include <base/logstream.h>
+
+#include <lac/sparse_matrix_ez.h>
+
+#include <fstream>
+
+int main()
+{
+  std::ofstream logfile("print_formatted_ez_01/output");
+  logfile.setf(std::ios::fixed);
+  logfile.precision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+  
+  SparseMatrixEZ<double> ez(5,4);
+  ez.set(0,0,2.);
+  ez.set(0,2,3.);
+  ez.set(0,3,4.);
+  ez.set(1,0,5.);
+  ez.set(1,1,6.);
+  ez.set(1,3,7.);
+  ez.set(2,0,8.);
+  ez.set(2,1,9.);
+  ez.set(2,2,10.);
+  ez.set(2,3,11.);
+  ez.set(4,0,12.);
+  ez.set(4,2,13.);
+  ez.set(4,3,14.);
+
+  ez.print_formatted(logfile, 0, false, 5, "~");
+}
diff --git a/tests/lac/print_formatted_ez_01/cmp/generic b/tests/lac/print_formatted_ez_01/cmp/generic
new file mode 100644 (file)
index 0000000..42b2ef2
--- /dev/null
@@ -0,0 +1,6 @@
+
+2.    ~     3.    4.    
+5.    6.    ~     7.    
+8.    9.    10.   11.   
+~     ~     ~     ~     
+12.   ~     13.   14.   

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.