diff --git a/dune/tectonic/minimisation.hh b/dune/tectonic/minimisation.hh index 5407fc3f3e0211bb0c2373c58d6b93772da2fa22..92eb9c0b146e0dc0c8575e7fd017c01f497538de 100644 --- a/dune/tectonic/minimisation.hh +++ b/dune/tectonic/minimisation.hh @@ -104,7 +104,7 @@ void minimise(Functional const &J, typename Functional::SmallVector &x, SmallVector descDir; bool const linesearchp = J.descentDirection(x, descDir); - if (descDir == SmallVector(0.0)) + if (descDir.two_norm() < 1e-14) // TODO: Make controllable return; if (linesearchp) { diff --git a/src/test-gradient-sample-steep.cc b/src/test-gradient-sample-steep.cc index 6b39276f77755b3b20a7e6ece750dd97167e435f..9e7350bdb317171282b1e3009bc49956cd6427a0 100644 --- a/src/test-gradient-sample-steep.cc +++ b/src/test-gradient-sample-steep.cc @@ -20,7 +20,7 @@ int main() { typedef Functional::SmallVector SmallVector; SmallMatrix const A = { { 1, 0 }, { 0, 1 } }; - SmallVector const b = { 1, 2 }; + SmallVector const b = { 1, 2.5 }; auto const f = Dune::make_shared<Dune::SampleFunction<2> const>(); auto const phi = Dune::make_shared<Functional::NonlinearityType const>(f); diff --git a/src/test-gradient-sample-steep2.cc b/src/test-gradient-sample-steep2.cc index 6f27d54ded9fbd25d804f50577332bbe055d1899..30a8507e5f0dd57e781ee9c48d56c898c732978a 100644 --- a/src/test-gradient-sample-steep2.cc +++ b/src/test-gradient-sample-steep2.cc @@ -29,7 +29,7 @@ int main() { double ret1; { SmallVector start = { 0, 1 }; - ret1 = functionTester(J, start, 1); + ret1 = functionTester(J, start, 2); } double ret2; diff --git a/src/test-gradient-sample-verysteep.cc b/src/test-gradient-sample-verysteep.cc index 78e1ec89632f00c75fcd9caad7aca59bc26e20f9..86b3f2c8cd6a52f6feb051056e362fb3cd207061 100644 --- a/src/test-gradient-sample-verysteep.cc +++ b/src/test-gradient-sample-verysteep.cc @@ -29,7 +29,7 @@ int main() { double ret1; { SmallVector start = { 0, 1 }; - ret1 = functionTester(J, start, 1); + ret1 = functionTester(J, start, 2); } double ret2;