Skip to content
Snippets Groups Projects
Commit d4ff3452 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

trust_region.m: trap case where linear combination with weight 0 on infinite value returns NaN

parent fb30faf7
No related branches found
No related tags found
No related merge requests found
......@@ -327,5 +327,9 @@ else
end
% Form the appropriate convex combination of the Gauss-Newton direction and the
% scaled gradient direction.
x = alpha*x + (1.0-alpha)*min(sgnorm, delta)*s;
if alpha>0
x = alpha*x + (1.0-alpha)*min(sgnorm, delta)*s;
else
x = (1.0-alpha)*min(sgnorm, delta)*s;
end
end
\ No newline at end of file
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