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

Clean up debugging info some more

parent 8fbce1ed
No related branches found
No related tags found
No related merge requests found
......@@ -85,9 +85,13 @@ class SampleFunctional {
if (descDir == SmallVector(0.0))
return SmallVector(0.0);
// { Debugging
Dune::dverb << "Starting at x with J(x) = " << operator()(x) << std::endl;
SmallVector debug_normalised_dir = descDir;
debug_normalised_dir /= debug_normalised_dir.two_norm();
Dune::dverb << "Minimizing in direction w with dJ(x,w) = "
<< directionalDerivative(x, descDir) << std::endl;
<< directionalDerivative(x, debug_normalised_dir) << std::endl;
// }
double l = 0;
double r = 1;
......@@ -104,16 +108,14 @@ class SampleFunctional {
}
Dune::dverb << "Interval now [" << l << "," << r << "]" << std::endl;
#ifndef NDEBUG
{
{ // Debugging
SmallVector tmpl = x;
tmpl.axpy(l, descDir);
SmallVector tmpr = x;
tmpr.axpy(r, descDir);
assert(directionalDerivative(tmpl, descDir) < 0);
assert(directionalDerivative(tmpr, descDir) > 0);
assert(directionalDerivative(tmpl, debug_normalised_dir) < 0);
assert(directionalDerivative(tmpr, debug_normalised_dir) > 0);
}
#endif
double m = l / 2 + r / 2;
SmallVector middle = SmallVector(0.0);
......
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