From: wolf Date: Fri, 6 Feb 2004 20:19:04 +0000 (+0000) Subject: More tests. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5097d38caefc68f4e357d6d5851b61ad4f5af5f3;p=dealii-svn.git More tests. git-svn-id: https://svn.dealii.org/trunk@8418 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/Makefile b/tests/bits/Makefile index f049c910b9..79e98f6ac9 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -138,6 +138,7 @@ find_cell_1.exe : find_cell_1.g.$(OBJEXT) $(libraries) find_cell_2.exe : find_cell_2.g.$(OBJEXT) $(libraries) find_cell_3.exe : find_cell_3.g.$(OBJEXT) $(libraries) sparse_matrix_01.exe : sparse_matrix_01.g.$(OBJEXT) $(libraries) +sparse_matrix_01a.exe : sparse_matrix_01a.g.$(OBJEXT) $(libraries) 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) @@ -201,6 +202,7 @@ tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \ mapping_cartesian_1 \ mapping_q4_3d \ q_points find_cell_1 find_cell_2 find_cell_3 \ + sparse_matrix_01a \ sparse_matrix_01 sparse_matrix_02 sparse_matrix_03 \ sparse_matrix_04 sparse_matrix_05 sparse_matrix_05a \ sparse_matrix_06 \ diff --git a/tests/bits/sparse_matrix_01a.cc b/tests/bits/sparse_matrix_01a.cc new file mode 100644 index 0000000000..63bfb14784 --- /dev/null +++ b/tests/bits/sparse_matrix_01a.cc @@ -0,0 +1,105 @@ +//---------------------------- sparse_matrix_01a.cc --------------------------- +// sparse_matrix_01.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_01a.cc --------------------------- + + +// check setting elements in a sparse matrix using SparseMatrix::set(). make +// sure they are correct, and make sure that for the nonexisting entries +// SparseMatrix::el() returns zero and operator() throws an exception + +#include "../tests.h" +#include +#include +#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 + for (unsigned int i=0; i