@@ -34,8 +34,7 @@ function OptimizationBase.instantiate_function(
34
34
hess = (H, θ, args... ) -> f. hess (H, θ, p, args... )
35
35
36
36
hv = function (H, θ, v, args... )
37
- res = adtype. obj_sparse ? (eltype (θ)). (f. hess_prototype) :
38
- ArrayInterface. zeromatrix (θ)
37
+ res = (eltype (θ)). (f. hess_prototype)
39
38
hess (res, θ, args... )
40
39
H .= res * v
41
40
end
@@ -81,8 +80,7 @@ function OptimizationBase.instantiate_function(f, cache::OptimizationBase.ReInit
81
80
hess = (H, θ, args... ) -> f. hess (H, θ, cache. p, args... )
82
81
83
82
hv = function (H, θ, v, args... )
84
- res = adtype. obj_sparse ? (eltype (θ)). (f. hess_prototype) :
85
- ArrayInterface. zeromatrix (θ)
83
+ res = (eltype (θ)). (f. hess_prototype)
86
84
hess (res, θ, args... )
87
85
H .= res * v
88
86
end
@@ -127,8 +125,7 @@ function OptimizationBase.instantiate_function(f, x, adtype::AutoSymbolics, p,
127
125
hess = (H, θ, args... ) -> f. hess (H, θ, p, args... )
128
126
129
127
hv = function (H, θ, v, args... )
130
- res = adtype. obj_sparse ? (eltype (θ)). (f. hess_prototype) :
131
- ArrayInterface. zeromatrix (θ)
128
+ res = ArrayInterface. zeromatrix (θ)
132
129
hess (res, θ, args... )
133
130
H .= res * v
134
131
end
@@ -174,8 +171,7 @@ function OptimizationBase.instantiate_function(f, cache::OptimizationBase.ReInit
174
171
hess = (H, θ, args... ) -> f. hess (H, θ, cache. p, args... )
175
172
176
173
hv = function (H, θ, v, args... )
177
- res = adtype. obj_sparse ? (eltype (θ)). (f. hess_prototype) :
178
- ArrayInterface. zeromatrix (θ)
174
+ res = ArrayInterface. zeromatrix (θ)
179
175
hess (res, θ, args... )
180
176
H .= res * v
181
177
end
0 commit comments