From: bangerth Date: Thu, 21 Dec 2006 16:27:25 +0000 (+0000) Subject: Ensure symmetry only up to a small relative number. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=390caf19d494356761e7d602af109e632806e7ac;p=dealii-svn.git Ensure symmetry only up to a small relative number. git-svn-id: https://svn.dealii.org/trunk@14273 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 0aab7c15ed..6d31f4f082 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -695,6 +695,15 @@ inconvenience this causes.

lac

    +
  1. Fixed: The SparseDirectMA27 + class works for symmetric matrices and had a check to make sure the + matrix is indeed symmetric. However, the check compared entries for + equality, something one should not do for floating point numbers. It now + checks that symmetric entries are equal up to a small relative number. +
    + (WB 2006/12/21) +

    +
  2. Fixed: The FullMatrix::invert function would return wrong results if one tried to invert a matrix of dimension smaller than 5 in situ. This is now fixed. diff --git a/deal.II/lac/source/sparse_direct.cc b/deal.II/lac/source/sparse_direct.cc index a2d3097924..6c773a1dca 100644 --- a/deal.II/lac/source/sparse_direct.cc +++ b/deal.II/lac/source/sparse_direct.cc @@ -1014,7 +1014,8 @@ SparseDirectMA27::fill_A (const SparseMatrix &matrix) // value, unless this one is zero Assert ((matrix(row,*col) == 0) || - (matrix(row,*col) == matrix(*col,row)), + (std::fabs(matrix(row,*col) - matrix(*col,row)) + <= 1e-15 * std::fabs (matrix(row,*col))), ExcMatrixNotSymmetric()); } else @@ -1022,7 +1023,8 @@ SparseDirectMA27::fill_A (const SparseMatrix &matrix) // symmetry Assert ((matrix(row,*col) == 0) || - (matrix(row,*col) == matrix(*col,row)), + (std::fabs(matrix(row,*col) - matrix(*col,row)) + <= 1e-15 * std::fabs (matrix(row,*col))), ExcMatrixNotSymmetric()); Assert (global_index == n_nonzero_elements, ExcInternalError());