From c8caf33d147b1ceec1fd135193ff1cf00a045e4b Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 9 Feb 2007 02:45:35 +0000 Subject: [PATCH] Add a test for SparseMatrixEZ::print_formatted(). git-svn-id: https://svn.dealii.org/trunk@14429 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/Makefile | 5 ++- tests/lac/print_formatted_ez_01.cc | 49 +++++++++++++++++++++ tests/lac/print_formatted_ez_01/cmp/generic | 6 +++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 tests/lac/print_formatted_ez_01.cc create mode 100644 tests/lac/print_formatted_ez_01/cmp/generic diff --git a/tests/lac/Makefile b/tests/lac/Makefile index 6be139206e..201ea8aaf1 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -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 index 0000000000..0ae97f300d --- /dev/null +++ b/tests/lac/print_formatted_ez_01.cc @@ -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 + +#include + +#include + +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 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 index 0000000000..42b2ef22ab --- /dev/null +++ b/tests/lac/print_formatted_ez_01/cmp/generic @@ -0,0 +1,6 @@ + +2. ~ 3. 4. +5. 6. ~ 7. +8. 9. 10. 11. +~ ~ ~ ~ +12. ~ 13. 14. -- 2.39.5