JuliaLang / JuliaLang/LinearAlgebra.jl
qr factorisation method for nullspace
- Dominant language
- Julia
- Stars
- 77
- Forks
- 65
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 10
Description
I've opened this feature request based off the back of a thread on slack with @andreasnoack . Since QR is not as reliable as SVD in determining the rank, we could have an additional kwarg where the user provides an expected dimension of the nullspace. Roughly
```julia
function nullspace(A::AbstractMatrix; nullity::Int=0, kwargs...)
if iszero(nullity) # default to SVD
return nullspace(A;kwargs...)
else
return qr(A').Q[:,end+1-nullity:end]
end
end
```
A small test
```julia
A = randn(3)randn(3)'
nullity = 2 # expected nullity
A*nullspace(A)
A*qr(A').Q[:,end+1-nullity:end]
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing nullspace and qr entry points, then run the supplied randn example to compare the SVD-based and QR-based results. Done means nullspace accepts an expected nullity, uses the QR-based basis when provided, preserves the default behavior otherwise, and has a small test for the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- hpc
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100