Skip to content

Commit

Permalink
Exten constructor method
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Oct 21, 2023
1 parent b0c6ad4 commit c2c61af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/OptimizationPRIMA/src/OptimizationPRIMA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SciMLBase.allowsconstraints(::Union{LINCOA, COBYLA}) = true
SciMLBase.allowsbounds(opt::Union{BOBYQA, LINCOA, COBYLA}) = true
SciMLBase.requiresconstraints(opt::COBYLA) = true

function OptimizationCache(prob::SciMLBase.OptimizationProblem, opt, data;
function Optimization.OptimizationCache(prob::SciMLBase.OptimizationProblem, opt::PRIMASolvers, data;
callback = Optimization.DEFAULT_CALLBACK,
maxiters::Union{Number, Nothing} = nothing,
maxtime::Union{Number, Nothing} = nothing,
Expand All @@ -33,7 +33,7 @@ function OptimizationCache(prob::SciMLBase.OptimizationProblem, opt, data;
f = Optimization.instantiate_function(prob.f, reinit_cache, prob.f.adtype, num_cons)
end

return OptimizationCache(f, reinit_cache, prob.lb, prob.ub, prob.lcons,
return Optimization.OptimizationCache(f, reinit_cache, prob.lb, prob.ub, prob.lcons,
prob.ucons, prob.sense,
opt, data, progress, callback,
merge((; maxiters, maxtime, abstol, reltol),
Expand All @@ -54,7 +54,7 @@ function get_solve_func(opt::PRIMASolvers)
end
end

function __map_optimizer_args!(cache::OptimizationCache, opt::PRIMASolvers;
function __map_optimizer_args!(cache::Optimization.OptimizationCache, opt::PRIMASolvers;
callback = nothing,
maxiters::Union{Number, Nothing} = nothing,
maxtime::Union{Number, Nothing} = nothing,
Expand Down Expand Up @@ -92,7 +92,7 @@ function sciml_prima_retcode(rc::AbstractString)
end
end

function SciMLBase.__solve(cache::OptimizationCache{
function SciMLBase.__solve(cache::Optimization.OptimizationCache{
F,
RC,
LB,
Expand Down

0 comments on commit c2c61af

Please sign in to comment.