Skip to content

Commit 2898867

Browse files
authored
Update OptimizationDISparseExt.jl
1 parent 32a1098 commit 2898867

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OptimizationDISparseExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ function instantiate_function(
133133
end
134134

135135
function lagrangian(θ, σ, λ, p)
136-
if iszero(θ)
137-
return dot(λ, cons_oop(θ))
138-
else
136+
if eltype(θ) <: SparseConnectivityTracer.AbstractTracer || !iszero(θ)
139137
return σ * f.f(θ, p) + dot(λ, cons_oop(θ))
138+
else
139+
return dot(λ, cons_oop(θ))
140140
end
141141
end
142142
end

0 commit comments

Comments
 (0)