Merged
Conversation
Contributor
|
You need to return the correct dual for each set. The return value is not the reduced cost irrespective of the set. It's hard to give generic advice, because it depends on your convention for the sign of the duals. Our convention is:
There are tests for all these cases which should help you figure it out. If you're passing tests for ScalarAffine, it probably means that you have the same dual convention as us. Here's an example from Clp.jl: |
Collaborator
Author
|
Thank you @odow . Tests passed. [ Info: Running test_solve_VariableIndex_ConstraintDual_MAX_SENSE
Solution Summary
Status : OPTIMAL
Presolve time : 0.000152 sec
Precondition time : 0 sec
Solve time : 0 sec
Iterations : 0
Primal objective : -1
Dual objective : -1
Objective gap : 0.000e+00
Primal infeas : 0.000e+00
Dual infeas : 0.000e+00
[ Info: Running test_solve_VariableIndex_ConstraintDual_MIN_SENSE
Solution Summary
Status : OPTIMAL
Presolve time : 0.000112 sec
Precondition time : 0 sec
Solve time : 0 sec
Iterations : 0
Primal objective : 1
Dual objective : 1
Objective gap : 0.000e+00
Primal infeas : 0.000e+00
Dual infeas : 0.000e+00
[ Info: Running test_variable_solve_with_lowerbound
Solution Summary
Status : OPTIMAL
Presolve time : 0.000122 sec
Precondition time : 0 sec
Solve time : 0 sec
Iterations : 0
Primal objective : 2
Dual objective : 2
Objective gap : 0.000e+00
Primal infeas : 0.000e+00
Dual infeas : 0.000e+00
[ Info: Running test_variable_solve_with_upperbound
Solution Summary
Status : OPTIMAL
Presolve time : 0.000106 sec
Precondition time : 0 sec
Solve time : 0 sec
Iterations : 0
Primal objective : -2
Dual objective : -2
Objective gap : 0.000e+00
Primal infeas : 0.000e+00
Dual infeas : 0.000e+00
Test Summary: | Pass Total Time
test_runtests | 30 30 11.8s
Testing CuPDLPx tests passed |
blegat
reviewed
Jan 30, 2026
blegat
reviewed
Jan 30, 2026
blegat
reviewed
Jan 30, 2026
blegat
reviewed
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17
Summary
This PR adds support for reduced cost.
Current Issue
The current wrapper fails
test_solve_VariableIndex_ConstraintDual_MAX_SENSEbecause cuPDLPx uses a boxed-bounds representation, soxlandxucan map to the same internal index.Question
GreaterThan,LessThan,EqualTo,Interval) when returningConstraintDualforVariableIndexconstraints?ConstraintDualforMOI.ScalarAffineFunction?@blegat @odow
Test code
Output