From: David Wells Date: Mon, 28 May 2018 02:33:28 +0000 (-0400) Subject: Bugfix: Use std::abs instead of std::fabs. X-Git-Tag: v9.1.0-rc1~1067^2~33 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f865c3e620fa2083e0b94e61cc13c84601565bf7;p=dealii.git Bugfix: Use std::abs instead of std::fabs. This has a correct overload for std::complex. --- diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index 78b85ebb41..aaf1249c05 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -1640,7 +1640,7 @@ AffineConstraints::add_entry(const size_type line, for (const auto &p : line_ptr->entries) if (p.first == column) { - Assert(std::fabs(p.second - value) < 1.e-14, + Assert(std::abs(p.second - value) < 1.e-14, ExcEntryAlreadyExists(line, column, p.second, value)); return; } diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 11acb78a35..bd0ed4e6d4 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -1737,7 +1737,7 @@ AffineConstraints::condense(BlockSparseMatrix &uncondensed, number average_diagonal = 0.; for (size_type b = 0; b < uncondensed.n_block_rows(); ++b) for (size_type i = 0; i < uncondensed.block(b, b).m(); ++i) - average_diagonal += std::fabs(uncondensed.block(b, b).diag_element(i)); + average_diagonal += std::abs(uncondensed.block(b, b).diag_element(i)); average_diagonal /= uncondensed.m(); const BlockIndices &index_mapping = sparsity.get_column_indices();