ConstraintLine &
operator=(const ConstraintLineType &other);
- /**
- * This operator is a bit weird and unintuitive: it compares the line
- * numbers of two lines. We need this to sort the lines; in fact we could
- * do this using a comparison predicate. However, this way, it is easier,
- * albeit unintuitive since two lines really have no god-given order
- * relation.
- */
- bool
- operator<(const ConstraintLine &) const;
-
- /**
- * This operator is likewise weird: it checks whether the line indices of
- * the two operands are equal, irrespective of the fact that the contents
- * of the line may be different.
- */
- bool
- operator==(const ConstraintLine &) const;
-
/**
* Determine an estimate for the memory consumption (in bytes) of this
* object.
-template <typename number>
-bool
-AffineConstraints<number>::ConstraintLine::operator<(
- const ConstraintLine &a) const
-{
- return index < a.index;
-}
-
-
-
-template <typename number>
-bool
-AffineConstraints<number>::ConstraintLine::operator==(
- const ConstraintLine &a) const
-{
- return index == a.index;
-}
-
-
-
template <typename number>
std::size_t
AffineConstraints<number>::ConstraintLine::memory_consumption() const
Utilities::MPI::this_mpi_process(mpi_communicator);
// helper function
- const auto sort_and_make_unique =
- [](std::vector<ConstraintType> &constraints) {
- std::sort(constraints.begin(), constraints.end());
-
- constraints.erase(std::unique(constraints.begin(), constraints.end()),
- constraints.end());
- };
+ const auto sort_and_make_unique = [](std::vector<ConstraintType>
+ &constraints) {
+ std::sort(
+ constraints.begin(),
+ constraints.end(),
+ [](const typename dealii::AffineConstraints<number>::ConstraintLine &l1,
+ const typename dealii::AffineConstraints<number>::ConstraintLine
+ &l2) { return l1.index < l2.index; });
+
+ constraints.erase(
+ std::unique(
+ constraints.begin(),
+ constraints.end(),
+ [](const typename dealii::AffineConstraints<number>::ConstraintLine
+ &l1,
+ const typename dealii::AffineConstraints<number>::ConstraintLine
+ &l2) { return l1.index == l2.index; }),
+ constraints.end());
+ };
// 0) collect constrained indices of the current object
IndexSet constrained_indices(locally_owned_dofs.size());
return;
// sort the lines
- std::sort(lines.begin(), lines.end());
+ std::sort(lines.begin(),
+ lines.end(),
+ [](const ConstraintLine &l1, const ConstraintLine &l2) {
+ return l1.index < l2.index;
+ });
// update list of pointers and give the vector a sharp size since we
// won't modify the size any more after this point.