Skip to content

Commit

Permalink
Disable the flatness check in HZ
Browse files Browse the repository at this point in the history
This may cause problems of its own, but for the time being it's better
than the status quo.

Fixes #173
Closes #174
Fixes #175
  • Loading branch information
timholy committed Oct 22, 2024
1 parent 6c576e5 commit 045e126
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/hagerzhang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,14 @@ function (ls::HagerZhang)(ϕ, ϕdϕ,
if display & LINESEARCH > 0
println("Linesearch: secant succeeded")
end
if nextfloat(values[ia]) >= values[ib] && nextfloat(values[iA]) >= values[iB]
# It's so flat, secant didn't do anything useful, time to quit
if display & LINESEARCH > 0
println("Linesearch: secant suggests it's flat")
end
mayterminate[] = false # reset in case another initial guess is used next
return A, values[iA]
end
# if nextfloat(values[ia]) >= values[ib] && nextfloat(values[iA]) >= values[iB]
# # It's so flat, secant didn't do anything useful, time to quit
# if display & LINESEARCH > 0
# println("Linesearch: secant suggests it's flat")
# end
# mayterminate[] = false # reset in case another initial guess is used next
# return A, values[iA]
# end
ia = iA
ib = iB
else
Expand Down

0 comments on commit 045e126

Please sign in to comment.