From 91fb55607d42362e3ce0d13800dd33e3425d5be8 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 16 Apr 2003 16:25:00 +0000 Subject: [PATCH] Mini-test for SparseMatrixEZ iterators. git-svn-id: https://svn.dealii.org/trunk@7402 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/Makefile | 4 +++- tests/lac/sparse_matrix_ez_iterator.cc | 27 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/lac/sparse_matrix_ez_iterator.cc diff --git a/tests/lac/Makefile b/tests/lac/Makefile index 5c0a2aa7c1..7fdcc76743 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -30,6 +30,7 @@ sparse_matrices.exe : sparse_matrices.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $ sparse_matrices.opt.exe : sparse_matrices.$(OBJEXT) testmatrix.$(OBJEXT) $(libraries_o) sparsity_pattern.exe : sparsity_pattern.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $(libraries) sparse_ilu.exe : sparse_ilu.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $(libraries) +sparse_matrix_ez_iterator.exe : sparse_matrix_ez_iterator.g.$(OBJEXT) $(libraries) vector-vector.exe : vector-vector.g.$(OBJEXT) $(libraries) #mgbase.exe : mgbase.g.$(OBJEXT) $(libraries) #mg.exe : mg.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $(libraries) @@ -38,7 +39,8 @@ vector-vector.exe : vector-vector.g.$(OBJEXT) $(librar tests = $(sort \ sparse_matrices block_matrices block_vector block_vector_iterator \ full_matrix \ - matrix_out solver sparsity_pattern sparse_ilu vector-vector) + matrix_out solver sparsity_pattern sparse_ilu \ + sparse_matrix_ez_iterator vector-vector) ############################################################ diff --git a/tests/lac/sparse_matrix_ez_iterator.cc b/tests/lac/sparse_matrix_ez_iterator.cc new file mode 100644 index 0000000000..1bcec96f22 --- /dev/null +++ b/tests/lac/sparse_matrix_ez_iterator.cc @@ -0,0 +1,27 @@ +#include +#include + +#include + + +int main () +{ + std::ofstream logfile("sparse_matrix_ez_iterator.output"); + logfile.setf(std::ios::fixed); + logfile.precision(2); + deallog.attach(logfile); + + SparseMatrixEZ m (4,4,4); + m.set (0,0,1); + m.set (1,0,2); + m.set (2,0,3); + m.set (2,2,0); // should be ignored + m.set (0,1,1); + m.set (0,2,2); + m.set (0,3,3); + + for (SparseMatrixEZ::const_iterator i = m.begin(); i != m.end(); ++i) + deallog << i->row() << ' ' << i->column() << ' ' << i->value() + << std::endl; +} + -- 2.39.5