diff --git a/dune/matrix-vector/algorithm.hh b/dune/matrix-vector/algorithm.hh index 30d2cf0fe5049020ef8d717600d3dbf38ab87a01..5f618a1bdcffbd5e4359658bc6ab4e2674e58afb 100644 --- a/dune/matrix-vector/algorithm.hh +++ b/dune/matrix-vector/algorithm.hh @@ -16,7 +16,7 @@ namespace MatrixVector { */ template <class Range, class F, typename = std::enable_if_t<Dune::IsTupleOrDerived<Range>::value>> -void rangeForEach(const Range& range, F&& f) { +void sparseRangeFor(const Range& range, F&& f) { using namespace Dune::Hybrid; forEach(integralRange(size(range)), [&](auto&& i) { f(range[i], i); }); } @@ -25,7 +25,7 @@ void rangeForEach(const Range& range, F&& f) { * \brief Hybrid for loop over sparse range */ template<class Range, class F> -void rangeForEach(Range&& range, F&& f) +void sparseRangeFor(Range&& range, F&& f) { for (auto it = range.begin(); it != range.end(); ++it) f(*it, it.index()); diff --git a/dune/matrix-vector/axpy.hh b/dune/matrix-vector/axpy.hh index 72442be7a86437c61c924d0cee14f85e2dd1dad7..fe6740fa48755669a4eea8be4026b29a12784a52 100644 --- a/dune/matrix-vector/axpy.hh +++ b/dune/matrix-vector/axpy.hh @@ -115,9 +115,9 @@ namespace MatrixVector { class ADummy = A, std::enable_if_t<MatrixTraits<ADummy>::isMatrix, int> SFINAE_Dummy = 0> static void addProduct(A& a, const B& b, const C& c) { - rangeForEach(b, [&](auto&& bi, auto&& i) { - rangeForEach(bi, [&](auto&& bik, auto&& k) { - rangeForEach(c[k], [&](auto&& ckj, auto&& j) { + sparseRangeFor(b, [&](auto&& bi, auto&& i) { + sparseRangeFor(bi, [&](auto&& bik, auto&& k) { + sparseRangeFor(c[k], [&](auto&& ckj, auto&& j) { Dune::MatrixVector::addProduct(a[i][j], bik, ckj); }); }); @@ -141,9 +141,9 @@ namespace MatrixVector { class ADummy = A, std::enable_if_t<MatrixTraits<ADummy>::isMatrix, int> SFINAE_Dummy = 0> static void addProduct(A& a, const Scalar& scalar, const B& b, const C& c) { - rangeForEach(b, [&](auto&& bi, auto&& i) { - rangeForEach(bi, [&](auto&& bik, auto&& k) { - rangeForEach(c[k], [&](auto&& ckj, auto&& j) { + sparseRangeFor(b, [&](auto&& bi, auto&& i) { + sparseRangeFor(bi, [&](auto&& bik, auto&& k) { + sparseRangeFor(c[k], [&](auto&& ckj, auto&& j) { Dune::MatrixVector::addProduct(a[i][j], scalar, bik, ckj); }); }); @@ -328,8 +328,8 @@ namespace MatrixVector { class ADummy = A, std::enable_if_t<MatrixTraits<ADummy>::isMatrix, int> SFINAE_Dummy = 0> static void addProduct(A& a, const B& b, const C& c) { - rangeForEach(c, [&](auto&& ci, auto && i) { - rangeForEach(ci, [&](auto&& cij, auto && j) { + sparseRangeFor(c, [&](auto&& ci, auto && i) { + sparseRangeFor(ci, [&](auto&& cij, auto && j) { Dune::MatrixVector::addProduct(a[i][j], b, cij); }); }); @@ -353,8 +353,8 @@ namespace MatrixVector { class ADummy = A, std::enable_if_t<MatrixTraits<ADummy>::isMatrix, int> SFINAE_Dummy = 0> static void addProduct(A& a, const Scalar& scalar, const B& b, const C& c) { - rangeForEach(c, [&](auto&& ci, auto&& i) { - rangeForEach(ci, [&](auto&& cij, auto&& j) { + sparseRangeFor(c, [&](auto&& ci, auto&& i) { + sparseRangeFor(ci, [&](auto&& cij, auto&& j) { Dune::MatrixVector::addProduct(a[i][j], scalar, b, cij); }); });