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

Use unsigned types for non-negative integers

parent d63cc398
Branches
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ class SampleFunctional : public SmallFunctional<dimension> { ...@@ -45,7 +45,7 @@ class SampleFunctional : public SmallFunctional<dimension> {
return d(x) * dir; 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); SmallVector descDir = d(x);
descDir *= -1; // The negative gradient descDir *= -1; // The negative gradient
...@@ -80,7 +80,7 @@ class SampleFunctional : public SmallFunctional<dimension> { ...@@ -80,7 +80,7 @@ class SampleFunctional : public SmallFunctional<dimension> {
double m = l / 2 + r / 2; double m = l / 2 + r / 2;
SmallVector middle; 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 << "now at m = " << m << std::endl;
Dune::dverb << "Value of J here: " << operator()(x + middle) << std::endl; Dune::dverb << "Value of J here: " << operator()(x + middle) << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment