Skip to content
Snippets Groups Projects
Commit dd26314c authored by Elias Pipping's avatar Elias Pipping
Browse files

[Cleanup] Use std::begin() and std::end()

parent b81d75b4
No related branches found
No related tags found
No related merge requests found
...@@ -142,8 +142,8 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> { ...@@ -142,8 +142,8 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> {
// compute quadratic part of hessian (linearization.A += problem_.A) // compute quadratic part of hessian (linearization.A += problem_.A)
for (size_t i = 0; i < problem_.A.N(); ++i) { for (size_t i = 0; i < problem_.A.N(); ++i) {
auto const end = problem_.A[i].end(); auto const end = std::end(problem_.A[i]);
for (auto it = problem_.A[i].begin(); it != end; ++it) for (auto it = std::begin(problem_.A[i]); it != end; ++it)
linearization.A[i][it.index()] += *it; linearization.A[i][it.index()] += *it;
} }
...@@ -163,13 +163,13 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> { ...@@ -163,13 +163,13 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> {
// apply truncation to stiffness matrix and rhs // apply truncation to stiffness matrix and rhs
for (size_t row = 0; row < linearization.A.N(); ++row) { for (size_t row = 0; row < linearization.A.N(); ++row) {
auto const col_end = linearization.A[row].end(); auto const col_end = std::end(linearization.A[row]);
for (auto col_it = linearization.A[row].begin(); col_it != col_end; for (auto col_it = std::begin(linearization.A[row]); col_it != col_end;
++col_it) { ++col_it) {
size_t const col = col_it.index(); size_t const col = col_it.index();
for (size_t i = 0; i < col_it->N(); ++i) { for (size_t i = 0; i < col_it->N(); ++i) {
auto const blockEnd = (*col_it)[i].end(); auto const blockEnd = std::end((*col_it)[i]);
for (auto blockIt = (*col_it)[i].begin(); blockIt != blockEnd; for (auto blockIt = std::begin((*col_it)[i]); blockIt != blockEnd;
++blockIt) ++blockIt)
if (linearization.truncation[row][i] || if (linearization.truncation[row][i] ||
linearization.truncation[col][blockIt.index()]) linearization.truncation[col][blockIt.index()])
...@@ -243,8 +243,8 @@ class MyBlockProblem<ConvexProblem>::IterateObject { ...@@ -243,8 +243,8 @@ class MyBlockProblem<ConvexProblem>::IterateObject {
LocalMatrixType const *localA = nullptr; LocalMatrixType const *localA = nullptr;
LocalVectorType localb(problem.f[m]); LocalVectorType localb(problem.f[m]);
auto const end = problem.A[m].end(); auto const end = std::end(problem.A[m]);
for (auto it = problem.A[m].begin(); it != end; ++it) { for (auto it = std::begin(problem.A[m]); it != end; ++it) {
size_t const j = it.index(); size_t const j = it.index();
if (j == m) if (j == m)
localA = &(*it); // localA = A[m][m] localA = &(*it); // localA = A[m][m]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment