From 4ac06454ca2f99d85045e1060b5ccd7e39eb77a9 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Tue, 6 Sep 2011 13:58:10 +0200 Subject: [PATCH] Use unsigned types for non-negative integers --- src/bisection-simpler-example2-gradient.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bisection-simpler-example2-gradient.cc b/src/bisection-simpler-example2-gradient.cc index 14d70216..e6a7ed69 100644 --- a/src/bisection-simpler-example2-gradient.cc +++ b/src/bisection-simpler-example2-gradient.cc @@ -45,7 +45,7 @@ class SampleFunctional : public SmallFunctional<dimension> { return d(x) * dir; } - SmallVector minimise(const SmallVector x, int iterations) const { + SmallVector minimise(const SmallVector x, unsigned int iterations) const { SmallVector descDir = d(x); descDir *= -1; // The negative gradient @@ -80,7 +80,7 @@ class SampleFunctional : public SmallFunctional<dimension> { double m = l / 2 + r / 2; SmallVector middle; - for (size_t count = 0; count < iterations; ++count) { + for (unsigned int count = 0; count < iterations; ++count) { Dune::dverb << "now at m = " << m << std::endl; Dune::dverb << "Value of J here: " << operator()(x + middle) << std::endl; -- GitLab