Skip to content

Commit e1645a8

Browse files
committed
fix OptimizationPRIMA cache construction
1 parent d9c1eb8 commit e1645a8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/OptimizationPRIMA/src/OptimizationPRIMA.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ struct BOBYQA <: PRIMASolvers end
1111
struct LINCOA <: PRIMASolvers end
1212
struct COBYLA <: PRIMASolvers end
1313

14+
export UOBYQA, NEWUOA, BOBYQA, LINCOA, COBYLA
15+
1416
SciMLBase.has_init(::PRIMASolvers) = true
1517
SciMLBase.allowsconstraints(::Union{LINCOA, COBYLA}) = true
1618
SciMLBase.allowsbounds(opt::Union{BOBYQA, LINCOA, COBYLA}) = true
@@ -44,12 +46,11 @@ function OptimizationBase.OptimizationCache(prob::SciMLBase.OptimizationProblem,
4446
end
4547

4648
return OptimizationBase.OptimizationCache(
47-
f, reinit_cache, prob.lb, prob.ub, prob.lcons,
49+
opt, f, reinit_cache, prob.lb, prob.ub, prob.lcons,
4850
prob.ucons, prob.sense,
49-
opt, progress, callback, nothing,
51+
progress, callback, nothing,
5052
OptimizationBase.OptimizationBase.AnalysisResults(nothing, nothing),
51-
merge((; maxiters, maxtime, abstol, reltol),
52-
NamedTuple(kwargs)))
53+
merge((; maxiters, maxtime, abstol, reltol), NamedTuple(kwargs)))
5354
end
5455

5556
function get_solve_func(opt::PRIMASolvers)
@@ -177,5 +178,4 @@ function SciMLBase.__solve(cache::OptimizationCache{O}) where {O <: PRIMASolvers
177178
stats = stats, original = inf)
178179
end
179180

180-
export UOBYQA, NEWUOA, BOBYQA, LINCOA, COBYLA
181181
end

0 commit comments

Comments
 (0)