From 30f4c4da6a6ce9314a919eb52fb6eec7804dbac8 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sat, 28 Jul 2012 14:38:20 +0200
Subject: [PATCH] More auto

---
 dune/tectonic/myblockproblem.hh | 10 ++++------
 src/one-body-sample.cc          |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh
index c9eeb15b..0a0864b5 100644
--- a/dune/tectonic/myblockproblem.hh
+++ b/dune/tectonic/myblockproblem.hh
@@ -171,9 +171,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
 
     // compute quadratic part of hessian (linearization.A += problem.A)
     for (size_t i = 0; i < problem.A.N(); ++i) {
-      typename MatrixType::row_type::ConstIterator it = problem.A[i].begin();
-      typename MatrixType::row_type::ConstIterator end = problem.A[i].end();
-      for (; it != end; ++it)
+      auto const end = problem.A[i].end();
+      for (auto it = problem.A[i].begin(); it != end; ++it)
         Arithmetic::addProduct(linearization.A[i][it.index()], 1.0, *it);
     }
 
@@ -310,9 +309,8 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
       LocalMatrixType const *localA = nullptr;
       LocalVectorType localb(problem.f[m]);
 
-      typename MatrixType::row_type::ConstIterator it;
-      typename MatrixType::row_type::ConstIterator end = problem.A[m].end();
-      for (it = problem.A[m].begin(); it != end; ++it) {
+      auto const end = problem.A[m].end();
+      for (auto it = problem.A[m].begin(); it != end; ++it) {
         int const j = it.index();
         if (j == m)
           localA = &(*it); // localA = A[m][m]
diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 61fe76a2..cd87e224 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -87,7 +87,7 @@ void setup_boundary(GridView const &gridView,
   size_t dirichlet_nodes = 0;
   size_t neumann_nodes = 0;
   size_t frictional_nodes = 0;
-  for (VertexLeafIterator it = gridView.template begin<dim>();
+  for (auto it = gridView.template begin<dim>();
        it != gridView.template end<dim>(); ++it) {
     assert(it->geometry().corners() == 1);
     Dune::FieldVector<double, dim> const coordinates = it->geometry().corner(0);
-- 
GitLab