Skip to content

Track all row variables in Constraint.vars - #1737

Draft
jackthepunished wants to merge 1 commit into
NVIDIA:mainfrom
jackthepunished:fix/constraint-vars
Draft

Track all row variables in Constraint.vars#1737
jackthepunished wants to merge 1 commit into
NVIDIA:mainfrom
jackthepunished:fix/constraint-vars

Conversation

@jackthepunished

Copy link
Copy Markdown
Contributor

Description

  • Constraint.vars on a quadratic row held only the linear-term variables; variables that appear only in quadratic terms were missing.
  • updateConstraint did not add newly referenced variables to Constraint.vars, so compute_slack raised KeyError for them.
  • Both pre-existing; split out of Add algebraic __str__ and detailed __repr__ to Python LP API classes #1400 at review request. Stores references to existing Variables only, no coefficient copies.

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Quadratic rows stored only the variables of their linear terms, and
updateConstraint did not record variables it introduced, so mapping a
row's column indices back to Variables (compute_slack) could KeyError.

Signed-off-by: jackthepunished <kosapinarbahadir@gmail.com>
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.

2 participants