File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -323,6 +323,22 @@ function MOI.supports(
323323 return MOI. supports (model. optimizer, attr, tp)
324324end
325325
326+ function MOI. get (
327+ model:: Optimizer ,
328+ attr:: MOI.VariablePrimalStart ,
329+ v:: MOI.VariableIndex ,
330+ )
331+ if _variable_in_model (model, v)
332+ return MOI. get (model. optimizer, attr, v)
333+ elseif _parameter_in_model (model, v)
334+ # this is effectivelly a no-op, but we do validation
335+ _val = model. parameters[p_idx (v)]
336+ return _val
337+ else
338+ error (" Variable not in the model" )
339+ end
340+ end
341+
326342function MOI. set (
327343 model:: Optimizer ,
328344 attr:: MOI.VariablePrimalStart ,
Original file line number Diff line number Diff line change @@ -430,8 +430,7 @@ function test_jump_set_variable_start_value()
430430 @test_throws ErrorException (
431431 " The parameter $(index (p)) value is 0.0, but trying to set VariablePrimalStart 1.0" ,
432432 ) set_start_value (p, 1.0 )
433- err = ErrorException (" MathOptInterface.VariablePrimalStart() is not supported for parameters" )
434- @test_throws err start_value (p)
433+ @test start_value (p) == 0.0
435434 return
436435end
437436
You can’t perform that action at this time.
0 commit comments