You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function SciMLBase.requiresgradient(opt::Union{NLopt.Algorithm, NLopt.Opt}) #https://github.com/JuliaOpt/NLopt.jl/blob/master/src/NLopt.jl#L18C7-L18C16
14
-
str_opt =if opt isa NLopt.Algorithm
15
-
string(opt)
16
-
else
17
-
string(opt.algorithm)
18
-
end
19
-
if str_opt[2] =='N'
20
-
returnfalse
21
-
else
22
-
returntrue
23
-
end
13
+
function SciMLBase.requiresgradient(opt::Union{NLopt.Algorithm, NLopt.Opt})
str_opt =string(opt isa NLopt.Algorithm ? opt : opt.algorithm)
16
+
return str_opt[2] !='N'
24
17
end
25
18
26
19
#interferes with callback handling
27
20
# function SciMLBase.allowsfg(opt::Union{NLopt.Algorithm, NLopt.Opt})
28
-
# str_opt = if opt isa NLopt.Algorithm
29
-
# string(opt)
30
-
# else
31
-
# string(opt.algorithm)
32
-
# end
33
-
# if str_opt[2] == 'D'
34
-
# return true
35
-
# else
36
-
# return false
37
-
# end
21
+
# str_opt = string(opt isa NLopt.Algorithm ? opt : opt.algorithm)
22
+
# return str_opt[2] == 'D'
38
23
# end
39
24
40
-
function SciMLBase.requireshessian(opt::Union{NLopt.Algorithm, NLopt.Opt}) #https://github.com/JuliaOpt/NLopt.jl/blob/master/src/NLopt.jl#L18C7-L18C16
41
-
str_opt =if opt isa NLopt.Algorithm
42
-
string(opt)
43
-
else
44
-
string(opt.algorithm)
45
-
end
46
-
47
-
if str_opt[2] =='N'||occursin("LD_LBFGS", str_opt) ||occursin("LD_SLSQP", str_opt)
48
-
returnfalse
49
-
else
50
-
returntrue
51
-
end
25
+
function SciMLBase.requireshessian(opt::Union{NLopt.Algorithm, NLopt.Opt})
function SciMLBase.requiresconsjac(opt::Union{NLopt.Algorithm, NLopt.Opt}) #https://github.com/JuliaOpt/NLopt.jl/blob/master/src/NLopt.jl#L18C7-L18C16
55
-
str_opt =if opt isa NLopt.Algorithm
56
-
string(opt)
57
-
else
58
-
string(opt.algorithm)
59
-
end
60
-
if str_opt[3] =='O'|| str_opt[3] =='I'|| str_opt[5] =='G'
61
-
returntrue
62
-
else
63
-
returnfalse
64
-
end
31
+
function SciMLBase.requiresconsjac(opt::Union{NLopt.Algorithm, NLopt.Opt})
0 commit comments