// ---------------------------------------------------------------------
//
-// Copyright (C) 1999 - 2014 by the deal.II authors
+// Copyright (C) 1999 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
namespace
{
+ // assert that the matrix has no zeros on the diagonal. this is important
+ // for preconditioners such as Jacobi or SSOR
template <typename number>
- void check_nonzero_diagonal (const SparseMatrix<number> &matrix)
+ void AssertNoZerosOnDiagonal (const SparseMatrix<number> &matrix)
{
+#ifdef DEBUG
for (typename SparseMatrix<number>::size_type row=0; row<matrix.m(); ++row)
Assert(matrix.diag_element(row) != 0.,
ExcMessage("There is a zero on the diagonal of this matrix "
"preconditioner. If it is correct that there are "
"zeros on the diagonal, then you will have to chose "
"a different preconditioner."));
+#endif
}
}
AssertDimension (dst.size(), n());
AssertDimension (src.size(), n());
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
const size_type n = src.size();
somenumber *dst_ptr = dst.begin();
AssertDimension (dst.size(), n());
AssertDimension (src.size(), n());
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
const size_type n = src.size();
const std::size_t *rowstart_ptr = &cols->rowstart[0];
AssertDimension (m(), n());
AssertDimension (dst.size(), n());
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
for (size_type row=0; row<m(); ++row)
{
AssertDimension (m(), n());
AssertDimension (dst.size(), n());
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
size_type row=m()-1;
while (true)
Assert (m() == inverse_permutation.size(),
ExcDimensionMismatch(m(), inverse_permutation.size()));
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
for (size_type urow=0; urow<m(); ++urow)
{
Assert (m() == inverse_permutation.size(),
ExcDimensionMismatch(m(), inverse_permutation.size()));
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
for (size_type urow=m(); urow != 0;)
{
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
Assert (m() == b.size(), ExcDimensionMismatch(m(),b.size()));
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
for (size_type row=0; row<m(); ++row)
{
Assert (m() == v.size(), ExcDimensionMismatch(m(),v.size()));
Assert (m() == b.size(), ExcDimensionMismatch(m(),b.size()));
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
for (int row=m()-1; row>=0; --row)
{
AssertDimension (m(), n());
Assert (m() == dst.size(), ExcDimensionMismatch(m(),dst.size()));
- check_nonzero_diagonal(*this);
+ AssertNoZerosOnDiagonal(*this);
const size_type n = dst.size();
size_type j;