Skip to content

Commit 534d43a

Browse files
format
1 parent 28a4d8e commit 534d43a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/lbfgsb.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using Optimization.SciMLBase, LBFGSB
33
"""
44
$(TYPEDEF)
55
6-
L-BFGS-B Nonlinear Optimization Code from [LBFGSB](https://github.com/Gnimuc/LBFGSB.jl/tree/master).
6+
[L-BFGS-B](https://en.wikipedia.org/wiki/Limited-memory_BFGS#L-BFGS-B) Nonlinear Optimization Code from [LBFGSB](https://github.com/Gnimuc/LBFGSB.jl/tree/master).
77
It is a quasi-Newton optimization algorithm that supports bounds.
88
99
References
@@ -13,7 +13,7 @@ References
1313
- J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778: L-BFGS-B, FORTRAN routines for large scale bound constrained optimization (2011), to appear in ACM Transactions on Mathematical Software.
1414
"""
1515
@kwdef struct LBFGS
16-
m::Int=10
16+
m::Int = 10
1717
end
1818

1919
SciMLBase.supports_opt_cache_interface(::LBFGS) = true
@@ -85,7 +85,6 @@ function SciMLBase.__solve(cache::OptimizationCache{
8585
t1 = time()
8686
stats = Optimization.OptimizationStats(; iterations = maxiters,
8787
time = t1 - t0, fevals = maxiters, gevals = maxiters)
88-
88+
8989
return SciMLBase.build_solution(cache, cache.opt, res[2], res[1], stats = stats)
9090
end
91-

test/lbfgsb.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ optf = OptimizationFunction(rosenbrock, AutoForwardDiff())
1010
prob = OptimizationProblem(optf, x0)
1111
res = solve(prob, Optimization.LBFGS(), maxiters = 100)
1212

13-
@test res.u [1.0, 1.0] atol=1e-3
13+
@test res.u[1.0, 1.0] atol=1e-3
1414

1515
optf = OptimizationFunction(rosenbrock, AutoZygote())
1616
prob = OptimizationProblem(optf, x0, lb = [0.0, 0.0], ub = [0.3, 0.3])
1717
res = solve(prob, Optimization.LBFGS(), maxiters = 100)
1818

19-
@test res.u [0.3, 0.09] atol=1e-3
19+
@test res.u[0.3, 0.09] atol=1e-3

0 commit comments

Comments
 (0)