From 045e1261b1ee0586d97664c5c161307a145162eb Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Tue, 22 Oct 2024 08:28:53 -0500 Subject: [PATCH] Disable the flatness check in HZ 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 --- src/hagerzhang.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hagerzhang.jl b/src/hagerzhang.jl index 9d1be56..af0bd06 100644 --- a/src/hagerzhang.jl +++ b/src/hagerzhang.jl @@ -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