For one of my projects, I need to perform multiple QR (up to multiple hundreds) decompositions of dense tall complex matrices. These decompositions are later used in some linear algebra operations, where the operations are performed on views of subblocks.
After trying qr
, qrfact
and their bang versions, I am facing the issue of the storage.
The packed QR format returning objects of type e.g. LinearAlgebra.QRCompactWY
seems to be efficient both in terms of allocation and for later manipulation when called directly, but in my case, i will have to use subarrays of such objects.
Is it therefore still better to store the decompositions this way of to store separately the`Q and R matrices ?
Also,my initial guess to store the decompositions was to initialize a vector of those.
However, while on can initialize a vector of matrices using a comprehension e.g.
[Matrix{ComplexF64}(undef, i, j) for _ in 1:k]
it does not seem to be possible to preallocate for
[LinearAlgebra.QRCompactWY{Float64,Array{Float64,2}}(undef, i, j) for _ in 1:k]
How should this storage be pre-allocated ?