-
Notifications
You must be signed in to change notification settings - Fork 0
Created OptimizationProblem's new LinearInequalityConstraintMatrices
and LinearEqualityConstraintMatrices
#8
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
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
The purpose of the PR is to introduce new methods for organizing linear optimization constraints—specifically, the LinearInequalityConstraintMatrices method (with the LinearEqualityConstraintMatrices method referenced in the title intended for future implementation).
- Added multiple tests in optimization_problem_test.go for verifying matrix dimensions from linear inequality constraints.
- Implemented the LinearInequalityConstraintMatrices method in optimization_problem.go to assemble constraint matrices and vectors.
- Updated README.md to reflect the new structure for OptimizationProblem objects.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
testing/problem/optimization_problem_test.go | Added tests to cover various cases for linear inequality constraints. |
problem/optimization_problem.go | Introduced the LinearInequalityConstraintMatrices method with debug logging and variable naming. |
README.md | Revised code example to utilize the new OptimizationProblem structure. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
problem/optimization_problem.go:366
- [nitpick] Consider using camelCase (e.g., scalarConstraints) instead of snake_case to align with Go naming conventions.
scalar_constraints := make([]symbolic.ScalarConstraint, 0)
problem/optimization_problem.go
Outdated
// Collect the Variables of this Problem | ||
x := op.Variables | ||
|
||
fmt.Printf("Variables: %v\n", x) |
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.
Remove extraneous debug print statements to avoid unnecessary output in production code.
fmt.Printf("Variables: %v\n", x) | |
// Removed extraneous debug print statement |
Copilot uses AI. Check for mistakes.
problem/optimization_problem.go
Outdated
fmt.Printf("AOut: %v\n", AOut) | ||
fmt.Printf("bOut: %v\n", bOut) |
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.
Remove or disable debug print statements (along with similar ones) before finalizing the production implementation.
fmt.Printf("AOut: %v\n", AOut) | |
fmt.Printf("bOut: %v\n", bOut) | |
// Debug print statements removed for production. | |
// Debug print statements removed for production. |
Copilot uses AI. Check for mistakes.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8 +/- ##
==========================================
+ Coverage 86.35% 86.76% +0.41%
==========================================
Files 27 27
Lines 3546 3687 +141
==========================================
+ Hits 3062 3199 +137
- Misses 438 440 +2
- Partials 46 48 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
LinearInequalityConstraintMatrices
andLinearEqualityConstraintMatrices
for organizing Linear Program constraints into simple terms.OptimizationProblem
objects. Looks good!