Skip to content

Allow QR decomposition for zero-row matrices. #1054

@manuelbb-upb

Description

@manuelbb-upb

This came up in DynareJulia/FastLapackInterface.jl#39

Currently, Julia allows for QR decomposition of zero-column matrices by skipping the call to LAPACK with a simple conditional [in this line].(https://github.com/JuliaLang/julia/blob/923fe2d74d469d73f0285a9cd41c88f90edd04d1/stdlib/LinearAlgebra/src/lapack.jl#L456)

Zero-row matrices are not supported and give an argument error:

 LA.qr(zeros(0, 10))
 ** On entry to DGEQRT parameter number  3 had an illegal value
ERROR: ArgumentError: invalid argument JuliaLang/julia#3 to LAPACK call

Is there a reason for this?
The data type should support these matrices:

import LinearAlgebra as LA
A = Matrix{Float64}(undef, 0, 10)
T = Matrix{Float64}(undef, 0, 0)
qr = LA.QRCompactWY(A, T)

and qr is as I would expect it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions