From: Wolfgang Bangerth Date: Fri, 6 Feb 2004 20:07:14 +0000 (+0000) Subject: Fix up a number of tests. X-Git-Tag: v8.0.0~15830 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf4842a8a74b49ddbf0eb0aa97f04eb257efc89;p=dealii.git Fix up a number of tests. git-svn-id: https://svn.dealii.org/trunk@8414 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/Makefile b/tests/bits/Makefile index 371dd94057..f049c910b9 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -142,6 +142,7 @@ sparse_matrix_02.exe : sparse_matrix_02.g.$(OBJEXT) $(libraries) sparse_matrix_03.exe : sparse_matrix_03.g.$(OBJEXT) $(libraries) sparse_matrix_04.exe : sparse_matrix_04.g.$(OBJEXT) $(libraries) sparse_matrix_05.exe : sparse_matrix_05.g.$(OBJEXT) $(libraries) +sparse_matrix_05a.exe : sparse_matrix_05a.g.$(OBJEXT) $(libraries) sparse_matrix_06.exe : sparse_matrix_06.g.$(OBJEXT) $(libraries) sparse_matrix_07.exe : sparse_matrix_07.g.$(OBJEXT) $(libraries) sparse_matrix_08.exe : sparse_matrix_08.g.$(OBJEXT) $(libraries) @@ -201,7 +202,8 @@ tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \ mapping_q4_3d \ q_points find_cell_1 find_cell_2 find_cell_3 \ sparse_matrix_01 sparse_matrix_02 sparse_matrix_03 \ - sparse_matrix_04 sparse_matrix_05 sparse_matrix_06 \ + sparse_matrix_04 sparse_matrix_05 sparse_matrix_05a \ + sparse_matrix_06 \ sparse_matrix_07 sparse_matrix_08 sparse_matrix_09 \ sparse_matrix_10 sparse_matrix_11 sparse_matrix_12 diff --git a/tests/bits/sparse_matrix_01.cc b/tests/bits/sparse_matrix_01.cc index 37f3443c01..f39ea3f7ec 100644 --- a/tests/bits/sparse_matrix_01.cc +++ b/tests/bits/sparse_matrix_01.cc @@ -48,7 +48,6 @@ void test () } else { - Assert (m(i,j) == 0, ExcInternalError()); Assert (m.el(i,j) == 0, ExcInternalError()); } diff --git a/tests/bits/sparse_matrix_02.cc b/tests/bits/sparse_matrix_02.cc index 011fca11cc..5dcf7947be 100644 --- a/tests/bits/sparse_matrix_02.cc +++ b/tests/bits/sparse_matrix_02.cc @@ -47,7 +47,6 @@ void test () } else { - Assert (m(i,j) == 0, ExcInternalError()); Assert (m.el(i,j) == 0, ExcInternalError()); } diff --git a/tests/bits/sparse_matrix_03.cc b/tests/bits/sparse_matrix_03.cc index c193db18dd..ce542d7d24 100644 --- a/tests/bits/sparse_matrix_03.cc +++ b/tests/bits/sparse_matrix_03.cc @@ -54,7 +54,6 @@ void test () } else { - Assert (m(i,j) == 0, ExcInternalError()); Assert (m.el(i,j) == 0, ExcInternalError()); } diff --git a/tests/bits/sparse_matrix_05.cc b/tests/bits/sparse_matrix_05.cc index 45a6cc202d..0f2f3f152e 100644 --- a/tests/bits/sparse_matrix_05.cc +++ b/tests/bits/sparse_matrix_05.cc @@ -32,15 +32,23 @@ void test () SparseMatrix m(sp); // first set a few entries. count how many - // entries we have + // entries we have. note that for square + // matrices we also always store the + // diagonal element, so add one per row, + // but don't count it when traversing the + // row unsigned int counter = 0; for (unsigned int i=0; i +#include + + +void test () +{ + SparsityPattern sp (5,5,3,false); + for (unsigned int i=0; i<5; ++i) + for (unsigned int j=0; j<5; ++j) + if ((i+2*j+1) % 3 == 0) + sp.add (i,j); + sp.compress (); + + SparseMatrix m(sp); + + // first set a few entries. count how many + // entries we have. note that for square + // matrices we also always store the + // diagonal element, except when as above + // we set the special flag for the matrix + // sparsity pattern + unsigned int counter = 0; + for (unsigned int i=0; i