Skip to content

Bugfix: standard form with fixed variables#3704

Merged
mrmundt merged 8 commits intoPyomo:mainfrom
jsiirola:std-form-fixed-vars
Aug 19, 2025
Merged

Bugfix: standard form with fixed variables#3704
mrmundt merged 8 commits intoPyomo:mainfrom
jsiirola:std-form-fixed-vars

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

Working with templatization and standard form (through the new contrib.solver gurobi_direct interface), we found several bugs:

  • standard_form was not correctly eliminating fixed variables from the columns array and A and c matricies
  • templatizing scalar objectives was storing the template information in an invalid attribute

Changes proposed in this PR:

  • remove fixed vars from the A and c matricies before returning from standard_form
  • fix a bug where scalar objectives stored the template info in the wrong place
  • remove some unneeded redundant code
  • add test of generating standard form with fixed variables

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@emma58 emma58 self-requested a review August 19, 2025 18:16
Copy link
Copy Markdown
Contributor

@emma58 emma58 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)

@github-project-automation github-project-automation bot moved this from Todo to Reviewer Approved in Pyomo 6.9.4 Release Aug 19, 2025
@mrmundt mrmundt merged commit 7ecb388 into Pyomo:main Aug 19, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo 6.9.4 Release Aug 19, 2025
@jsiirola jsiirola deleted the std-form-fixed-vars branch August 19, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants