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
* 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);
};
+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
// 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