From 41f5b9ac3cc08182ab1b20e333f5669b49a66af6 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Fri, 23 May 2003 13:04:21 +0000 Subject: [PATCH] harder test for SparseMatrixEZ::const_iterator git-svn-id: https://svn.dealii.org/trunk@7673 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/sparse_matrices.cc | 43 ++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/tests/lac/sparse_matrices.cc b/tests/lac/sparse_matrices.cc index aefc04ec31..981fe3ff14 100644 --- a/tests/lac/sparse_matrices.cc +++ b/tests/lac/sparse_matrices.cc @@ -97,25 +97,64 @@ template void check_iterator (const MATRIX& A) { +// deallog.push("it"); + + typename MATRIX::const_iterator E = A.end(); + + if (A.m() < 10) + for (unsigned int r=0;rrow() + << '\t' << b->index() + << '\t' << b->column() + << '\t' << b->value() + << std::endl; + typename MATRIX::const_iterator e = A.end(r); + if (e == E) + deallog << "Final" << std::endl; + else + deallog << '\t' << e->row() + << '\t' << e->index() + << std::endl; + deallog << "cols:"; + + for (typename MATRIX::const_iterator i=b;i!=e;++i) + deallog << '\t' << i->index() << ',' << i->column(); + deallog << std::endl; + } for (typename MATRIX::const_iterator i = A.begin(); i!= A.end(); ++i) deallog << '\t' << i->row() - << '\t' << i->column() << '\t' << i->index() + << '\t' << i->column() << '\t' << i->value() << std::endl; deallog << "Repeat row 2" << std::endl; for (typename MATRIX::const_iterator i = A.begin(2); i!= A.end(2); ++i) deallog << '\t' << i->row() - << '\t' << i->column() << '\t' << i->index() + << '\t' << i->column() << '\t' << i->value() << std::endl; + +// deallog.pop(); } void check_ez_iterator() { SparseMatrixEZ m (6, 6, 0); + + deallog << "Empty matrix" << std::endl; + + check_iterator(m); + + deallog << "Irregular matrix" << std::endl; + m.set (0, 0, 1.); m.set (1, 0, 2.); m.set (2, 0, 3.); -- 2.39.5