]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid the use of compose1 and select2nd, as these do not belong to the
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 17 May 2001 15:59:07 +0000 (15:59 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 17 May 2001 15:59:07 +0000 (15:59 +0000)
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
deal.II/deal.II/source/dofs/dof_constraints.cc

index e0e106ae9381698499534ac93afe19df0aaa9b65..ea0a522b89b7ebf124c2b81cdb02abb1e378bf1f 100644 (file)
@@ -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<unsigned int, double> &p);
 };
 
 
index 3a85a1bd1765bf9244a5f99587bd168ae5499c9b..9538c3407c4c95fad66425183105cde6c8371932 100644 (file)
 
 
 
+inline
+bool
+ConstraintMatrix::check_zero_weight (const std::pair<unsigned int, double> &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<double>(), 0),
-                                                    std::select2nd<std::pair<unsigned int,double> >())),
+                                     &check_zero_weight),
                            line->entries.end());
 
                                       // now sort the remainder

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.