File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1739,7 +1739,9 @@ function set_start_values(
17391739 )
17401740 if support_variable_primal && variable_primal_start != = nothing
17411741 for x in all_variables (model)
1742- variable_primal[x] = variable_primal_start (x)
1742+ if ! is_parameter (x)
1743+ variable_primal[x] = variable_primal_start (x)
1744+ end
17431745 end
17441746 end
17451747 constraint_primal = Dict {ConstraintRef,T} ()
Original file line number Diff line number Diff line change @@ -1537,4 +1537,19 @@ function test_with_cache_type_set_optimizer()
15371537 return
15381538end
15391539
1540+ function test_issue_4089 ()
1541+ model = Model ()
1542+ @variable (model, x)
1543+ @variable (model, p in Parameter (42 ))
1544+ set_start_values (
1545+ model;
1546+ variable_primal_start = x -> index (x). value,
1547+ constraint_primal_start = nothing ,
1548+ constraint_dual_start = nothing ,
1549+ )
1550+ @test start_value (x) == index (x). value
1551+ @test ! has_start_value (p)
1552+ return
1553+ end
1554+
15401555end # module TestModels
You can’t perform that action at this time.
0 commit comments