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

Check the norm rather than each component

parent 34f65f7c
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,9 @@ template <int dimension> class SampleFunctional {
}
void descentDirection(const SmallVector x, SmallVector &ret) const {
if (x == SmallVector(0.0)) {
// Check the squared norm rather than each component because
// negative_projection() divides by it
if (x.two_norm2() == 0.0) {
// If there is a direction of descent, this is it
SmallVector const d = smoothGradient(x);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment