Skip to content

Commit 27a0679

Browse files
committed
Add error for missing starting value
1 parent d09d1b1 commit 27a0679

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ConicProgram/ConicProgram.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ function _gradient_cache(model::Model)
183183
)
184184
b = model.model.constraints.constants
185185

186+
if any(isnan, model.y) || length(model.y) < length(b)
187+
error("Some constraints are missing a value for the `ConstraintDualStart` attribute.")
188+
end
189+
190+
if any(isnan, model.s) || length(model.s) < length(b)
191+
error("Some constraints are missing a value for the `ConstraintPrimalStart` attribute.")
192+
end
193+
186194
if MOI.get(model, MOI.ObjectiveSense()) == MOI.FEASIBILITY_SENSE
187195
c = SparseArrays.spzeros(size(A, 2))
188196
else

0 commit comments

Comments
 (0)