-
Notifications
You must be signed in to change notification settings - Fork 271
Add getConsVals #1033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getConsVals #1033
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the getConsVals
method to retrieve coefficient values from constraint objects, generalizes the getRhs
method to support knapsack constraints, and includes corresponding tests.
- Implements
getConsVals
method for extracting coefficient values from arbitrary constraints that can be represented as single linear constraints - Extends
getRhs
method to handle knapsack constraints by returning their capacity - Adds comprehensive test coverage for the new
getConsVals
functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/pyscipopt/scip.pxd | Adds external function declaration for SCIPgetConsVals |
src/pyscipopt/scip.pxi | Implements getConsVals method and extends getRhs for knapsack constraints |
tests/test_cons.py | Adds test_getConsVals function and additional assertion for knapsack constraint |
CHANGELOG.md | Documents the new features added in this release |
@danielyhwang check out this branch, if you're in a hurry |
I managed to get around this by doing as https://stackoverflow.com/questions/67828685/how-to-get-constraint-matrix-after-presolving-in-pyscipopt#67832364 recommended and preventing constraints with linear constraints being upgraded to more specific constraints.
|
Co-authored-by: DominikKamp <[email protected]>
Co-authored-by: DominikKamp <[email protected]>
Co-authored-by: DominikKamp <[email protected]>
Co-authored-by: DominikKamp <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1033 +/- ##
==========================================
+ Coverage 54.13% 54.38% +0.25%
==========================================
Files 22 22
Lines 5045 5220 +175
==========================================
+ Hits 2731 2839 +108
- Misses 2314 2381 +67 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, this is fine.
Co-authored-by: DominikKamp <[email protected]>
Co-authored-by: DominikKamp <[email protected]>
55c049a
to
a9b71b5
Compare
Ahh you meant that the warnings should show up in the pipelines, I see I see. |
For some strange reason, I'm getting some segfaults on the tests, but it's inconsistent. Might be my local builds doing weird stuff.