Skip to content

Commit 6b58a3f

Browse files
Fix LBFGSB naming and backwards compat
1 parent 215909c commit 6b58a3f

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

lib/OptimizationLBFGSB/src/OptimizationLBFGSB.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ References
2020
- C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778: L-BFGS-B, FORTRAN routines for large scale bound constrained optimization (1997), ACM Transactions on Mathematical Software, Vol 23, Num. 4, pp. 550 - 560.
2121
- 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.
2222
"""
23-
@kwdef struct LBFGS
23+
@kwdef struct LBFGSB
2424
m::Int = 10
2525
τ = 0.5
2626
γ = 10.0
@@ -32,21 +32,21 @@ References
3232
end
3333

3434
@static if isdefined(SciMLBase, :supports_opt_cache_interface)
35-
SciMLBase.supports_opt_cache_interface(::LBFGS) = true
35+
SciMLBase.supports_opt_cache_interface(::LBFGSB) = true
3636
end
3737
@static if isdefined(OptimizationBase, :supports_opt_cache_interface)
38-
OptimizationBase.supports_opt_cache_interface(::LBFGS) = true
38+
OptimizationBase.supports_opt_cache_interface(::LBFGSB) = true
3939
end
40-
SciMLBase.allowsbounds(::LBFGS) = true
41-
SciMLBase.requiresgradient(::LBFGS) = true
42-
SciMLBase.allowsconstraints(::LBFGS) = true
43-
SciMLBase.requiresconsjac(::LBFGS) = true
40+
SciMLBase.allowsbounds(::LBFGSB) = true
41+
SciMLBase.requiresgradient(::LBFGSB) = true
42+
SciMLBase.allowsconstraints(::LBFGSB) = true
43+
SciMLBase.requiresconsjac(::LBFGSB) = true
4444

4545
function task_message_to_string(task::Vector{UInt8})
4646
return String(task)
4747
end
4848

49-
function __map_optimizer_args(cache::OptimizationCache, opt::LBFGS;
49+
function __map_optimizer_args(cache::OptimizationCache, opt::LBFGSB;
5050
callback = nothing,
5151
maxiters::Union{Number, Nothing} = nothing,
5252
maxtime::Union{Number, Nothing} = nothing,
@@ -99,7 +99,7 @@ function SciMLBase.__solve(cache::OptimizationCache{
9999
UC,
100100
S,
101101
O <:
102-
LBFGS,
102+
LBFGSB,
103103
D,
104104
P,
105105
C
@@ -270,4 +270,6 @@ function SciMLBase.__solve(cache::OptimizationCache{
270270
end
271271
end
272272

273+
export LBFGSB
274+
273275
end

src/Optimization.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,11 @@ include("auglag.jl")
2727

2828
export solve
2929

30+
# Legacy Exports
31+
# Remove in Optimization v5
32+
33+
import OptimizationLBFGSB
34+
const LBFGS = OptimizationLBFGSB.LBFGSB
35+
export LBFGS
36+
3037
end # module

0 commit comments

Comments
 (0)