Condition number and nullspace functions
- Dominant language
- Rust
- Stars
- 4.8k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
I am writing a piece of circuit simulation software that needs to detect ill-conditioned systems and calculate the nullspace of such a system (corresponding to invalid circuit nodes in my use case). Many linear algebra packages offer a nullspace function, such as Matlab's `null(A, epsilon)` and SciPy's `null_space(A, relative_condition)` which use the SVD to compute this, as well as a convenience method taking the ratio of the largest and smallest singular values to compute the condition number. I propose a pair of methods on the `SVD` struct:
`nullspace(&self, relative_condition) -> Matrix` where D is a dynamic dimension and the columnspace of the returned matrix corresponds to the nullspace of the original system.
`condition_number(&self) -> T` to get the condition number.
Adding this would also solve the root problem in #1125, since reduced row-echelon form is used to compute the nullspace in introductory linear algebra classes, but is numerically unstable and inconvenient for this on computers. This would also be a step toward the improved API discussed in #1117 .
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.