Commit a67fb337 authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Modernize signatures of method 'domain' and 'subDiff'

* 'subDiff' is now called 'subDifferential'
* It returns its result in the return value, not in its second argument
* The method 'domain' also returns its result in the return value
parent 150e7484
Pipeline #5015 failed with stage
in 10 seconds
......@@ -56,14 +56,12 @@ class Bisection
size_t n=0;
Dune::Solvers::Interval<double> I;
Dune::Solvers::Interval<double> DJ;
Dune::Solvers::Interval<double> dom;
count = 0;
// try if projected initial guess is sufficient
J.domain(dom);
Dune::Solvers::Interval<double> dom = J.domain();
x = dom.projectIn(x);
J.subDiff(x, DJ);
Dune::Solvers::Interval<double> DJ = J.subDifferential(x);
++count;
if (DJ.containsZero(safety_))
{
......@@ -79,7 +77,7 @@ class Bisection
I[1] = x;
I[0] = dom.projectFromBelow(I[1] - DJ[0]);
J.subDiff(I[0], DJ);
DJ = J.subDifferential(I[0]);
++count;
while (DJ[0] > safety_)
{
......@@ -89,7 +87,7 @@ class Bisection
I[0] = dom[0];
break;
}
J.subDiff(I[0], DJ);
DJ = J.subDifferential(I[0]);
++count;
}
}
......@@ -98,7 +96,7 @@ class Bisection
I[0] = x;
I[1] = dom.projectFromAbove(I[0] - DJ[1]);
J.subDiff(I[1], DJ);
DJ = J.subDifferential(I[1]);
++count;
while (DJ[1] < -safety_)
{
......@@ -108,7 +106,7 @@ class Bisection
I[1] = dom[1];
break;
}
J.subDiff(I[1], DJ);
DJ = J.subDifferential(I[1]);
++count;
}
}
......@@ -154,14 +152,13 @@ class Bisection
++n;
// evaluate subdifferential
J.subDiff(x, DJ);
DJ = J.subDifferential(x);
++count;
if (verbosity>0)
{
Dune::Solvers::Interval<double> DJ0, DJ1;
J.subDiff(I[0],DJ0);
J.subDiff(I[1],DJ1);
Dune::Solvers::Interval<double> DJ0 = J.subDifferential(I[0]);
Dune::Solvers::Interval<double> DJ1 = J.subDifferential(I[1]);
const std::streamsize p = std::cout.precision();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment