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

cholfact for sparse matrix does not keep floating type #14810

Closed
KrisDM opened this issue Jan 27, 2016 · 4 comments
Closed

cholfact for sparse matrix does not keep floating type #14810

KrisDM opened this issue Jan 27, 2016 · 4 comments
Labels
docs This change adds or pertains to documentation sparse Sparse arrays

Comments

@KrisDM
Copy link

KrisDM commented Jan 27, 2016

In Julia 0.4.3, and Julia 0.5.0-dev, calling cholfact on a sparse Float32 matrix promotes the Cholesky factorization to Float 64. On a dense matrix, it correctly gives a Float32 factorization.

Compare:

julia> cholfact(eye(Float32,3))
Base.LinAlg.Cholesky{Float32,Array{Float32,2}} with factor:
3x3 UpperTriangular{Float32,Array{Float32,2}}:
 1.0  0.0  0.0
 0.0  1.0  0.0
 0.0  0.0  1.0

With:

julia> cholfact(speye(Float32,3))
Base.SparseMatrix.CHOLMOD.Factor{Float64}
type:          LLt
method: simplicial
maxnnz:          3
nnz:             3
@andreasnoack
Copy link
Member

See #14076 (comment). It's a limitation in the sparse factorization library CHOLMOD. Eventually, we'd like to have pure Julia implementations of the sparse factorizations, but for now there is not much we can do.

@kmsquire
Copy link
Member

Would it be worthwhile leaving this open (and renaming it) as an issue to create a pure Julia sparse factorization library?

@jiahao
Copy link
Member

jiahao commented Jan 27, 2016

At the very least, we should document the behavior. As an issue, "pure Julia sparse linalg" is rather too broad.

@andreasnoack
Copy link
Member

I've changed the title to reflect the documentation issue.

@andreasnoack andreasnoack reopened this Jan 27, 2016
@jiahao jiahao added docs This change adds or pertains to documentation sparse Sparse arrays labels Jan 27, 2016
jiahao added a commit that referenced this issue Feb 9, 2016
Closes #14810

Also changes description of `LDL^T` to `LDL'`. The former is wrong for
complex matrices.
jiahao added a commit that referenced this issue Feb 9, 2016
- Document that they only work with double precision (Closes #14810)

- Also changes description of `LDL^T` to `LDL'`. The former is wrong for
  complex matrices.

- Remove incorrect description from `cholfact` as doing `LDL^T` from docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

4 participants