From f865c3e620fa2083e0b94e61cc13c84601565bf7 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 27 May 2018 22:33:28 -0400 Subject: [PATCH] Bugfix: Use std::abs instead of std::fabs. This has a correct overload for std::complex. --- include/deal.II/lac/affine_constraints.h | 2 +- include/deal.II/lac/affine_constraints.templates.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.39.5