rank and null of sparse matrix not allowed without using full
Show older comments
Consider the following, where A has the sparse matrix attribute.
>> rank(A)
Error using svd
Use svds for sparse singular values and vectors.
Error in rank (line 14)
s = svd(A);
>> null(A);
Error using svd
Use svds for sparse singular values and vectors.
Error in null (line 66)
[~,S,V] = svd(A,0);
Is there a way, without writing your own, to get an SVD-based null without doing null(full(A)), and SVD-based rank without doing rank(full(A))?
Note that qr and eig are allowed on a sparse matrix, but svd is not. Is there a reason for this? Yes, I can get rank and nullspace basis using qr on a sparse matrix, bit why not be allowed to use SVD-based commands without taking full of the matrix?
svds is based on eigs, which is very unreliable, so I have no interest in relying on svds in the middle of something like a nonlinear optimization. I'd for sure go with qr over svds. I'm willing to pay a computation time penalty for use of SVD instead of qr, but the "natural" penalty is jacked way up due to having to take full of the matrix.
Yhanks.
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!