From 08caa054259ca8399752b66c141d6ffdf7802436 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 17 May 2001 15:59:07 +0000 Subject: [PATCH] Avoid the use of compose1 and select2nd, as these do not belong to the C++ standard. Rather have a small function ourselves that does exactly the action of the composed functional. git-svn-id: https://svn.dealii.org/trunk@4658 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_constraints.h | 10 ++++++++++ deal.II/deal.II/source/dofs/dof_constraints.cc | 12 ++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_constraints.h b/deal.II/deal.II/include/dofs/dof_constraints.h index e0e106ae93..ea0a522b89 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.h @@ -543,6 +543,16 @@ class ConstraintMatrix : public Subscriptor * If so, no new entries can be added. */ bool sorted; + + /** + * Return @p{true} if the weight + * of an entry (the second + * element of the pair) equals + * zero. This function is used to + * delete entries with zero + * weight. + */ + static bool check_zero_weight (const std::pair &p); }; diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index 3a85a1bd17..9538c3407c 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -28,6 +28,15 @@ +inline +bool +ConstraintMatrix::check_zero_weight (const std::pair &p) +{ + return (p.second == 0); +}; + + + inline bool ConstraintMatrix::ConstraintLine::operator < (const ConstraintLine &a) const @@ -183,8 +192,7 @@ void ConstraintMatrix::close () // 0*something can be omitted line->entries.erase (remove_if (line->entries.begin(), line->entries.end(), - std::compose1 (std::bind2nd (std::equal_to(), 0), - std::select2nd >())), + &check_zero_weight), line->entries.end()); // now sort the remainder -- 2.39.5