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

Handle the case of a zero-correction

This happens for mu = 0 e.g.
parent f8304ff3
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { ...@@ -77,6 +77,8 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
VectorType v = projected_v; VectorType v = projected_v;
double const vnorm = v.two_norm(); double const vnorm = v.two_norm();
if (vnorm == 0) // This can (and needs to be able to) be very small
return 0.0;
v /= vnorm; // Rescale for numerical stability v /= vnorm; // Rescale for numerical stability
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment