Skip to content

Commit 32a1098

Browse files
authored
optimize lagrangian implementation
1 parent d1fdea1 commit 32a1098

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/OptimizationDISparseExt.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ function instantiate_function(
133133
end
134134

135135
function lagrangian(θ, σ, λ, p)
136-
return σ * f.f(θ, p) + dot(λ, cons_oop(θ))
136+
if iszero(θ)
137+
return dot(λ, cons_oop(θ))
138+
else
139+
return σ * f.f(θ, p) + dot(λ, cons_oop(θ))
140+
end
137141
end
138142
end
139143

0 commit comments

Comments
 (0)