-
Notifications
You must be signed in to change notification settings - Fork 12
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
Provide linear algebra utility #179
Conversation
- spliting of system into one dimensional systems - check for is independent system - calculate bounds for one dimensional system
- small housekeeping tasks, plus proper documentation
- for a one dimensional system of inequalties A x >= b, where A is a single column matrix, zero entries lose interpretability - this especially happens if constructed from a n dimensional system split into multiple 1 dimensional
Codecov Report
@@ Coverage Diff @@
## main #179 +/- ##
==========================================
+ Coverage 92.14% 92.16% +0.01%
==========================================
Files 90 91 +1
Lines 16690 16730 +40
==========================================
+ Hits 15379 15419 +40
Misses 1311 1311
Flags with carried forward coverage won't be shown. Click here to find out more.
|
- from interface was not clear how bounds function would deal with zero entry in left hand side, e.g. if 0 <= -1 would cause error
Remove unique bounds (C x > 0) and (Cx < 0) for a one dimensional system as it is unclear on how it would deal with zero left hand side , i.e. 0 <= 1 or 0 <= -1 , are those upper bounds, or would they result in failure. Therefore function design is lacking, decided to remove it completly! |
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.
This looks great and very neatly done! I have not verified that the expected results of the tests are correct but trust your word on that ;-)
A remark on style and docstrings but none of them are showstoppers for this to be merged.
Sorry, discovered a small bug upstream therefore needed to modify this utility. Now fixed. 1754f10 |
Provides basic linear algebra functionality necessary for array data dependency detection.
Calculates a row echelon form of a matrix, while allowing a conditional check before each division operation, which can also be specialized, as in our case integers are of interest with proper integer calculation.
Is modified version of a stack overflow post, is that a problem?
back_substitution
Applies a back substitution, provided by an upper triangular matrix onto a right hand side, again optional specialized division operation.
Checks if a system of equations is independent, i.e. only one coefficient per row for the matrix or none.
Yields the one dimensional systems provided by an independent system of equations, disregards completely zero rows (matrix and rhs). Additionally catches (since it is generalized for inequalities (to be precise <=, >=) if the lhs row is all zeros and the rhs is non zero, will yield those as well.
- [x] bounds_of_one_d_system:Calculates all unique bounds (C x > 0) and (Cx < 0) for a one dimensional system.- [x] deal properly with zero in coefficient matrix C --> moving bounds to be (C x >= 0 and C x <= 0)