Skip to content

Commit 33782dc

Browse files
Update lib/OptimizationNLopt/src/OptimizationNLopt.jl
1 parent e6709ec commit 33782dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/OptimizationNLopt/src/OptimizationNLopt.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ function SciMLBase.allowsconstraints(opt::NLopt.Algorithm)
7373
end
7474
end
7575

76+
function SciMLBase.requiresconsjac(opt::NLopt.Algorithm)
77+
str_opt = string(opt)
78+
if occursin("AUGLAG", str_opt) || occursin("CCSA", str_opt) || occursin("MMA", str_opt) || occursin("COBYLA", str_opt) || occursin("ISRES", str_opt) || occursin("AGS", str_opt) || occursin("ORIG_DIRECT", str_opt) || occursin("SLSQP", str_opt)
79+
return true
80+
else
81+
return false
82+
end
83+
end
84+
7685
function SciMLBase.__init(prob::SciMLBase.OptimizationProblem, opt::NLopt.Algorithm,
7786
; cons_tol = 1e-6,
7887
callback = (args...) -> (false),

0 commit comments

Comments
 (0)