Skip to content

Commit

Permalink
Flip direction in zero_point
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Jun 30, 2018
1 parent e3f110c commit d9a17f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/continuations/zero_point.jl
Expand Up @@ -69,7 +69,7 @@ function find_zero!(cache, opts, f, u0, u1, direction)
error("corrector failed")

@label corrector_success
tJ = tangent(L, Q)
tJv = tangent(L, Q)
fv = f(v, J, L, Q)
@assert all(isfinite.(v))

Expand All @@ -79,8 +79,13 @@ function find_zero!(cache, opts, f, u0, u1, direction)
fu = fv

if abs(h) < opts.h_zero
return v, tJ, L, Q, J
return v, tJv, L, Q, J
end

if tJ tJv < 0
direction *= -1
end
tJ = tJv
end
error("zero not found")
end

0 comments on commit d9a17f2

Please sign in to comment.