Open
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
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
A = randn(3)randn(3)'
nullity = 2 # expected nullity
A*nullspace(A)
A*qr(A').Q[:,end+1-nullity:end]