Skip to content

Commit e4740c5

Browse files
authored
Add error for missing starting value (#269)
1 parent 6dd82d6 commit e4740c5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ConicProgram/ConicProgram.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,18 @@ 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(
188+
"Some constraints are missing a value for the `ConstraintDualStart` attribute.",
189+
)
190+
end
191+
192+
if any(isnan, model.s) || length(model.s) < length(b)
193+
error(
194+
"Some constraints are missing a value for the `ConstraintPrimalStart` attribute.",
195+
)
196+
end
197+
186198
if MOI.get(model, MOI.ObjectiveSense()) == MOI.FEASIBILITY_SENSE
187199
c = SparseArrays.spzeros(size(A, 2))
188200
else

0 commit comments

Comments
 (0)