SparseArrays.jl icon indicating copy to clipboard operation
SparseArrays.jl copied to clipboard

Missing `ldiv!` overload on sparse QR

Open ChrisRackauckas opened this issue 3 years ago • 6 comments

using SparseArrays, LinearAlgebra
A = rand(4,4)
S = sprand(4,4,0.1)
b = rand(4)
Aqr = qr(A)
Sqr = qr(S)
Aqr \ b # works!
Sqr \ b # works!
ldiv!(x, Aqr, b) # works!
ldiv!(x, Sqr, b) # fails!!!!!!!!!!!!!

ChrisRackauckas avatar Sep 01 '22 01:09 ChrisRackauckas

is this even supported in SPQR? i couldn't find anything in the user doc

SobhanMP avatar Sep 01 '22 03:09 SobhanMP

I will have to dig deeper into what SPQR is doing, I'm only really familiar with the UMFPACK and KLU code.

rayegun avatar Sep 04 '22 03:09 rayegun

SPQR does not support ldiv! natively. What do you want ldiv! to do @ChrisRackauckas? We can define a copying form, that copies to x.

rayegun avatar Oct 08 '22 22:10 rayegun

It should just give an error saying that the operation is not available, since you can't t do these things in-place.

ViralBShah avatar Oct 08 '22 22:10 ViralBShah

There's a MethodError now, do you think it should be more specific?

rayegun avatar Oct 08 '22 23:10 rayegun

Yes, I think an error message might make sense, since MethodError makes people think it is an unimplemented case.

ViralBShah avatar Oct 09 '22 15:10 ViralBShah