Skip to content

Conversion from Symmetric/Hermitian to sparse uses abstract fallback #567

@KristofferC

Description

@KristofferC

The way to hit this in real code is to do Symmetric(A) \ B, have the Cholesky factorization fail, and then get hit by the conversion just before the lu fallback at:

https://github.com/JuliaLang/julia/blob/fa7d1a9b48cb46f1467012425f05c1d350859a0d/stdlib/SuiteSparse/src/cholmod.jl#L1737

which will never finish for real problems, leaving you wonder why the factorization is so slow.

julia> using SparseArrays

julia> using LinearAlgebra

julia> s = Symmetric(sprand(10^4, 10^4, 1/10^4));

julia> @time sparse(s);
  1.156863 seconds (10.03 k allocations: 1.188 MiB)

julia> nnz(s.data)
10089

Metadata

Metadata

Assignees

No one assigned

    Labels

    sparseSparse arrays

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions