]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Convert an internal function into a lambda.
authorDavid Wells <drwells@email.unc.edu>
Sat, 18 Aug 2018 23:39:11 +0000 (19:39 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Mon, 20 Aug 2018 22:46:51 +0000 (18:46 -0400)
include/deal.II/lac/affine_constraints.h
include/deal.II/lac/affine_constraints.templates.h

index b025fe77bb8f9a2a7818683217b0aa0f4e4b48af..a2fbfd011f25fee4eede6a2c456f3a5fce5f98ef 100644 (file)
@@ -1477,13 +1477,6 @@ private:
   size_type
   calculate_line_index(const size_type line) const;
 
-  /**
-   * 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<size_type, number> &p);
-
   /**
    * This function actually implements the local_to_global function for
    * standard (non-block) matrices.
index da6d16b056abff1215a45e2596a7e1f94378281e..a3496939765efe6fc3e62a95cb21ce1f5640ed78 100644 (file)
@@ -71,16 +71,6 @@ AffineConstraints<number>::copy_from(const AffineConstraints<number> &other)
 
 
 
-template <typename number>
-bool
-AffineConstraints<number>::check_zero_weight(
-  const std::pair<size_type, number> &p)
-{
-  return (p.second == number(0.));
-}
-
-
-
 template <typename number>
 bool
 AffineConstraints<number>::ConstraintLine::
@@ -343,7 +333,10 @@ AffineConstraints<number>::close()
     // appears. obviously, 0*something can be omitted
     line.entries.erase(std::remove_if(line.entries.begin(),
                                       line.entries.end(),
-                                      &check_zero_weight),
+                                      [](
+                                        const std::pair<size_type, number> &p) {
+                                        return p.second == number(0.);
+                                      }),
                        line.entries.end());
 
 

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.