-
Notifications
You must be signed in to change notification settings - Fork 0
Adding a new function which forces the standard LP to be in a specifi… #13
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
…c optimization sense, if it is not already.
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 a new method ToLPStandardForm2 to the OptimizationProblem struct that forces the standard LP to be in a specific optimization sense (maximization). The method builds upon the existing ToLPStandardForm1 functionality and ensures the resulting problem has a maximization objective.
- Added
ToLPStandardForm2method that converts problems to standard form with maximization sense - Added comprehensive test coverage for the new method
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| problem/optimization_problem.go | Implements the new ToLPStandardForm2 method that converts to standard form and forces maximization |
| testing/problem/optimization_problem_test.go | Adds test case for the new method with minimization to maximization conversion |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // Modify the objective function to be a maximization problem, | ||
| // if it is not already. | ||
| if problemInStandardForm.Objective.Sense == SenseMinimize { |
Copilot
AI
Aug 29, 2025
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.
The objective function transformation lacks documentation explaining why the expression is multiplied by -1. This is a critical mathematical transformation that converts min c^Tx to max (-c)^Tx while preserving optimal solutions, and should be documented with a comment.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
==========================================
+ Coverage 86.76% 87.44% +0.67%
==========================================
Files 27 33 +6
Lines 3687 4093 +406
==========================================
+ Hits 3199 3579 +380
- Misses 440 461 +21
- Partials 48 53 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… to respect NEW expectations of ToLPStandardForm
…c optimization sense, if it is not already.