Skip to content
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

Automatically up-convert eltype in SPQR #33601

Merged
merged 3 commits into from
Nov 12, 2019
Merged

Automatically up-convert eltype in SPQR #33601

merged 3 commits into from
Nov 12, 2019

Conversation

dkarrasch
Copy link
Member

This intends to close #33425, one way or another.

I realized that we do up-convert in the other two sparse factorizations, UMFPACK and CHOLMOD, and this is clearly documented. So one option is to do the same with SPQR. Another option that we discussed over at #33425 is to throw an error message.

The previous line below the docstring was calling a non-existent method, so I moved the main workhorse below the docstring, adapted the conversion functions from UMFPACK, and added a "!!! note" (maybe it should be a compat annotation?).

@dkarrasch dkarrasch added linear algebra Linear algebra sparse Sparse arrays labels Oct 19, 2019
"sparse floating point QR using SPQR or qr(Array(A)) for generic ",
"dense QR.")))
LinearAlgebra.qr(A::SparseMatrixCSC; tol=_default_tol(A)) = qr(float(A); tol=tol)
# function LinearAlgebra.qr(A::SparseMatrixCSC; tol=_default_tol(A))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this one be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was just a placeholder in case we decide not to upconvert but to error. I'll delete this then and merge.

Copy link
Member

@andreasnoack andreasnoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (just the question about the function that is commented out)

@dkarrasch
Copy link
Member Author

I'll also add a short comment to the !!!note docstring, something like

!!! note
     `qr(A::SparseMatrixCSC)` uses the SPQR library that is part of SuiteSparse.
     As this library only supports sparse matrices with [`Float64`](@ref) or
     `ComplexF64` elements, `qr` converts `A` (as of Julia v1.4) into a copy that is of type
     `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate.

Or any other suggestion?

@dkarrasch dkarrasch changed the title RFC: Automatically up-convert eltype in SPQR? Automatically up-convert eltype in SPQR Nov 12, 2019
@dkarrasch dkarrasch merged commit 7358173 into JuliaLang:master Nov 12, 2019
@dkarrasch dkarrasch deleted the sparse_qr branch November 12, 2019 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra sparse Sparse arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backslash with Float32 SparseMatrixCSC fails on qr call
2 participants