Skip to content

Commit

Permalink
bug fix: destructured arguments cannot be used in keyword arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jutho committed Sep 7, 2020
1 parent 0a9a595 commit 0160b24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/linesearches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ HagerZhangLineSearch(; c₁::Real = 1//10, c₂::Real = 9//10, ϵ::Real = 1//10^
maxiter = typemax(Int), verbosity::Int = 0) =
HagerZhangLineSearch(promote(c₁, c₂, ϵ, θ, γ, ρ)..., maxiter, verbosity)

function (ls::HagerZhangLineSearch)(fg, x₀, η₀, (f₀, g₀) = fg(x₀);
function (ls::HagerZhangLineSearch)(fg, x₀, η₀, fg₀ = fg(x₀);
retract = _retract, inner = _inner,
initialguess = one(f₀), acceptfirst = false)
initialguess = one(fg₀[1]), acceptfirst = false)

(f₀, g₀) = fg₀
df₀ = inner(x₀, g₀, η₀)
if df₀ >= zero(df₀)
error("linesearch was not given a descent direction!")
Expand Down

2 comments on commit 0160b24

@Jutho
Copy link
Owner Author

@Jutho Jutho commented on 0160b24 Sep 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/20981

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" 0160b2450bcb6e2fff6e8e86843b9c3627041a45
git push origin v0.3.0

Please sign in to comment.