-
Notifications
You must be signed in to change notification settings - Fork 271
API: addMatrixConsIndicator
supports ExprCons
#1047
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
Conversation
Expanded test_matrix_cons_indicator to check TypeError for invalid input types and added tests for MatrixExprCons and ExprCons cases. Also updated objective and assertions to include new binary variable.
This pr does not need to be added to the changelog file. |
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 extends the addMatrixConsIndicator
API to support both ExprCons
and MatrixExprCons
constraint types, previously only supporting MatrixExprCons
.
Key changes:
- Updated
addMatrixConsIndicator
to acceptExprCons
in addition toMatrixExprCons
- When an
ExprCons
is passed, the method now delegates toaddConsIndicator
- Added comprehensive test coverage for the new
ExprCons
functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/pyscipopt/scip.pxi | Updated addMatrixConsIndicator signature and implementation to handle both ExprCons and MatrixExprCons , delegating to addConsIndicator for ExprCons inputs |
tests/test_matrix_variable.py | Added test cases to verify ExprCons support and ensure proper type checking with TypeError for invalid inputs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Thank you, once again! |
closes #1034