Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions python/cuopt/cuopt/linear_programming/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,13 +1232,17 @@ def populate_solution(self, solution):
if len(primal_sol) > 0:
for var in self.vars:
var.Value = primal_sol[var.index]
if not IsMIP:
if (
not IsMIP
and reduced_cost is not None
and len(reduced_cost) > 0
):
var.ReducedCost = reduced_cost[var.index]
dual_sol = None
if not IsMIP:
dual_sol = solution.get_dual_solution()
for i, constr in enumerate(self.constrs):
if dual_sol is not None:
if dual_sol is not None and len(dual_sol) > 0:
constr.DualValue = dual_sol[i]
constr.Slack = constr.compute_slack()
self.ObjValue = self.Obj.getValue()
Expand Down