//---------------------------- chunk_sparse_matrix_05a.cc ---------------------------
// $Id$
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 2004, 2005, 2008 by the deal.II authors
+// Copyright (C) 2004, 2005, 2008, 2013 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// ChunkSparseMatrix when we don't store the diagonal elements explicitly
#include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>
+#include <deal.II/lac/chunk_sparse_matrix.h>
#include <fstream>
void test (const unsigned int chunk_size)
{
- ChunkSparsityPattern sp (5,5,3,chunk_size,false);
+ ChunkSparsityPattern sp (5,5,3,chunk_size);
for (unsigned int i=0; i<5; ++i)
for (unsigned int j=0; j<5; ++j)
if ((i+2*j+1) % 3 == 0)
sp.compress ();
ChunkSparseMatrix<double> 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
+ // diagonal element
unsigned int counter = 0;
for (unsigned int i=0; i<m.m(); ++i)
for (unsigned int j=0; j<m.n(); ++j)
- if ((i+2*j+1) % 3 == 0)
+ if (((i+2*j+1) % 3 == 0) || (i==j))
{
m.set (i,j, i*j*.5+.5);
++counter;
else
Assert (m.n_nonzero_elements() >= counter,
ExcInternalError());
-
+
deallog << "OK" << std::endl;
}
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
-
+
return 1;
}
- catch (...)
+ catch (...)
{
deallog << std::endl << std::endl
<< "----------------------------------------------------"