From: guido Date: Fri, 23 May 2003 13:04:21 +0000 (+0000) Subject: harder test for SparseMatrixEZ::const_iterator X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4c14f730e816bb6cac344633e0fbd1546daaaea;p=dealii-svn.git harder test for SparseMatrixEZ::const_iterator git-svn-id: https://svn.dealii.org/trunk@7673 0785d39b-7218-0410-832d-ea1e28bc413d --- 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.); diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/lac/sparse_matrices.output b/tests/results/i686-pc-linux-gnu+gcc3.2/lac/sparse_matrices.output index 576169dfef..d0fcd083aa 100644 --- a/tests/results/i686-pc-linux-gnu+gcc3.2/lac/sparse_matrices.output +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/lac/sparse_matrices.output @@ -1,11 +1,50 @@ +DEAL::Empty matrix +DEAL::Final +DEAL::Final +DEAL::cols: +DEAL::Final +DEAL::Final +DEAL::cols: +DEAL::Final +DEAL::Final +DEAL::cols: +DEAL::Final +DEAL::Final +DEAL::cols: +DEAL::Final +DEAL::Final +DEAL::cols: +DEAL::Final +DEAL::Final +DEAL::cols: +DEAL::Repeat row 2 +DEAL::Irregular matrix +DEAL::0 0 0 0 1.0 +DEAL:: 1 0 +DEAL::cols: 0,0 1,1 2,2 3,3 +DEAL::1 1 0 0 2.0 +DEAL:: 2 0 +DEAL::cols: 0,0 +DEAL::2 2 0 0 3.0 +DEAL:: 4 0 +DEAL::cols: 0,0 +DEAL::3 4 0 3 17. +DEAL:: 4 0 +DEAL::cols: +DEAL::4 4 0 3 17. +DEAL::Final +DEAL::cols: 0,3 +DEAL::Final +DEAL::Final +DEAL::cols: DEAL:: 0 0 0 1.0 DEAL:: 0 1 1 1.0 DEAL:: 0 2 2 2.0 DEAL:: 0 3 3 3.0 DEAL:: 1 0 0 2.0 DEAL:: 2 0 0 3.0 -DEAL:: 4 3 0 17. +DEAL:: 4 0 3 17. DEAL::Repeat row 2 DEAL:: 2 0 0 3.0 DEAL::Structure @@ -43,73 +82,73 @@ DEAL::GrowingVectorMemory:Overall allocated vectors: 28 DEAL::GrowingVectorMemory:Maximum allocated vectors: 2 DEAL:: 0 0 0 5.0 DEAL:: 0 1 1 -2.0 -DEAL:: 0 4 2 -1.0 -DEAL:: 1 1 0 5.0 -DEAL:: 1 0 1 -1.0 +DEAL:: 0 2 4 -1.0 +DEAL:: 1 0 1 5.0 +DEAL:: 1 1 0 -1.0 DEAL:: 1 2 2 -2.0 -DEAL:: 1 5 3 -1.0 -DEAL:: 2 2 0 5.0 +DEAL:: 1 3 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 +DEAL:: 15 1 11 -1.0 +DEAL:: 15 2 14 -1.0 DEAL::Repeat row 2 -DEAL:: 2 2 0 5.0 +DEAL:: 2 0 2 5.0 DEAL:: 2 1 1 -1.0 -DEAL:: 2 3 2 -2.0 -DEAL:: 2 6 3 -1.0 +DEAL:: 2 2 3 -2.0 +DEAL:: 2 3 6 -1.0 DEAL::Assemble DEAL:5-SparseMatrixEZ:Richardson::Starting value 4.0 DEAL:5-SparseMatrixEZ:Richardson::Failure step 10 value 3.6 @@ -144,73 +183,73 @@ DEAL::GrowingVectorMemory:Overall allocated vectors: 28 DEAL::GrowingVectorMemory:Maximum allocated vectors: 2 DEAL:: 0 0 0 5.0 DEAL:: 0 1 1 -2.0 -DEAL:: 0 4 2 -1.0 +DEAL:: 0 2 4 -1.0 DEAL:: 1 0 0 -1.0 DEAL:: 1 1 1 5.0 DEAL:: 1 2 2 -2.0 -DEAL:: 1 5 3 -1.0 -DEAL:: 2 1 0 -1.0 -DEAL:: 2 2 1 5.0 -DEAL:: 2 3 2 -2.0 -DEAL:: 2 6 3 -1.0 -DEAL:: 3 2 0 -1.0 -DEAL:: 3 3 1 5.0 -DEAL:: 3 7 2 -1.0 +DEAL:: 1 3 5 -1.0 +DEAL:: 2 0 1 -1.0 +DEAL:: 2 1 2 5.0 +DEAL:: 2 2 3 -2.0 +DEAL:: 2 3 6 -1.0 +DEAL:: 3 0 2 -1.0 +DEAL:: 3 1 3 5.0 +DEAL:: 3 2 7 -1.0 DEAL:: 4 0 0 -1.0 -DEAL:: 4 4 1 5.0 -DEAL:: 4 5 2 -2.0 -DEAL:: 4 8 3 -1.0 -DEAL:: 5 1 0 -1.0 -DEAL:: 5 4 1 -1.0 -DEAL:: 5 5 2 5.0 -DEAL:: 5 6 3 -2.0 -DEAL:: 5 9 4 -1.0 -DEAL:: 6 2 0 -1.0 -DEAL:: 6 5 1 -1.0 -DEAL:: 6 6 2 5.0 -DEAL:: 6 7 3 -2.0 -DEAL:: 6 10 4 -1.0 -D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