Skip to content
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

[WIP] Implementation of LU Decomposition #26

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

rabbull
Copy link

@rabbull rabbull commented Nov 29, 2024

This PR implements LU decomposition by enhancing gaussian_elimination to support step-by-step recording of row operations. These recorded steps can then be replayed on an identity matrix to construct the L matrix.

Four new methods are introduced:

  • gaussian_elimination_ex: An extended version of Gaussian elimination that includes an option to record the steps performed during row operations. The existing gaussian_elimination method now serves as a wrapper for this function.
  • lu_decomposition: Computes the LU decomposition of a matrix. This method returns the lower triangular matrix L, the upper triangular matrix U, and a permutation vector pv (if row permutations occur during Gaussian elimination).
  • lu_decomposition_in_place: A more memory-efficient variant of lu_decomposition. Instead of returning U, it modifies the original matrix (self) in place to represent U.
  • permute_rows: A utility function that applies a permutation vector pv to a matrix, enabling consistent handling of row permutations.

@CLAassistant
Copy link

CLAassistant commented Nov 29, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ rabbull
❌ benruijl
You have signed the CLA already but the status is still pending? Let us recheck it.

@rabbull rabbull marked this pull request as draft December 13, 2024 09:30
rabbull and others added 12 commits December 13, 2024 10:37
- Add conversion from conditions to pattern restrictions
- Add contains condition
- Add if_then and if_changed
- Add break_chain
- Add condition functions for transformers
- Do not set a static trace level
- Allow transformers on rhs of contains
- Add is_type condition on transformers
- Use absolute error so that zeros are supported
- Add i() function for floats
- Add automatic evaluation of complex i
- Move EXP, E, etc from State to Atom
- Add test to see if expression is a polynomial
- Add custom normalization for atom fields
- Collect numbers from divisions
- Add matrix augmentation function
- Expose Gaussian elimination methods
- Improved AsAtomView trait
- Remove the need for many into() calls
- Add owned Replacement and BorrowedReplacement
- Remove methods on Pattern
- ReplaceIterator and PatternAtomTreeIterator now implement Iterator
- Unify call signatures
- Make the FunctionMap owned
- Implement Borrow<[u8]> on Atom so that atoms that are keys in maps can be retrieved by an AtomView's get_data
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.

3 participants