Skip to content

Conversation

Zeroto521
Copy link
Contributor

closes #1034

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.
@Zeroto521
Copy link
Contributor Author

This pr does not need to be added to the changelog file.
And it's a patch to addMatrixConsIndicator, which is an unreleased feature.

@Zeroto521 Zeroto521 closed this Aug 20, 2025
@Zeroto521 Zeroto521 deleted the fix/1034 branch August 20, 2025 07:27
@Zeroto521 Zeroto521 restored the fix/1034 branch August 25, 2025 02:46
@Zeroto521 Zeroto521 reopened this Aug 25, 2025
@Joao-Dionisio Joao-Dionisio requested a review from Copilot October 17, 2025 08:59
Copy link
Contributor

@Copilot Copilot AI left a 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 accept ExprCons in addition to MatrixExprCons
  • When an ExprCons is passed, the method now delegates to addConsIndicator
  • 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.

@Joao-Dionisio Joao-Dionisio merged commit 53289a0 into scipopt:master Oct 17, 2025
1 check passed
@Joao-Dionisio
Copy link
Member

Thank you, once again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API: Should we merge addCons and addMatrixCons

2 participants