Skip to content
Snippets Groups Projects
Commit 83592bda authored by Carsten Gräser's avatar Carsten Gräser
Browse files

Simplify loops using range based for

parent 1f6ace51
Branches
Tags
2 merge requests!289Simplify code using asMatrix(),!288[WIP] Simplify code using asMatrix()
Pipeline #17835 passed
......@@ -122,11 +122,9 @@ namespace Dune
inline auto countNonZeros(const M& matrix,typename std::enable_if_t<!Dune::IsNumber<M>::value>* sfinae = nullptr)
{
typename M::size_type nonZeros = 0;
for (auto row = matrix.begin(); row != matrix.end(); ++row)
for (auto entry = row->begin(); entry != row->end(); ++entry)
nonZeros += countNonZeros(*entry);
for(auto&& row : matrix)
for(auto&& entry : row)
nonZeros += countNonZeros(entry);
return nonZeros;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment