-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
qr error for matrices with 0 columns #546
Comments
The computation seems to work, it's just the display that errors? |
It's true that not displaying the answer prevents the problem from occurring immediately, but the it still occurs later:
|
julia> triu!(randn(0,0));
ERROR: ArgumentError: the requested diagonal, 0, must be at least 1 and at most 1 in an 0-by-0 matrix
Stacktrace:
[1] triu!(::Array{Float64,2}, ::Int64) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/LinearAlgebra/src/dense.jl:175
[2] triu!(::Array{Float64,2}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v0.7/LinearAlgebra/src/generic.jl:237
[3] top-level scope at none:0 We added some checks to the |
100%. We need to either do the looser bounds or delete the checks altogether. Not super urgent since loosening the bounds can be done at any time, but these bounds checks seem mostly annoying. |
julia> a=[1 2 3; 4 5 6; 7 8 9] julia> using LinearAlgebra: qr julia> q,r=qr(a) julia> q julia> r It seems the q and r matrices are not compact. Since the rank of "a" is 2, the size of the compact "q" and "r" should be 3 × 2 and 2 × 3, respectively. |
With respect to the previous comment, I don't see anything wrong with the output from |
Fixed by JuliaLang/julia#28480 |
With respect to the comment from @chenxlieee , plain QR is not suitable for use as a rank estimator. For rank estimation, use either pivoted QR or, for greatest robustness, SVD. |
Function
qr
in 0.6 works fine for matrices with 0 columns, but not in 0.7.0-beta2:The text was updated successfully, but these errors were encountered: