JuliaSparse / SparseArrays.jl

SparseArrays.jl is a Julia stdlib
https://sparsearrays.juliasparse.org/
Other
90 stars 52 forks source link

sparse linear algebra operations for non-BLAS numeric types (such as BigFloat etc.) #136

Closed fgerick closed 2 years ago

fgerick commented 3 years ago

The isposdef check for non-BLASnumber types seems to be broken due to a call to SuiteSparse:

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 16

julia> using LinearAlgebra, SparseArrays

julia> a = sprand(BigFloat,100,100,0.01); b = Symmetric(a*a');

julia> isposdef(b)
ERROR: TypeError: in Sparse, in Tv, expected Tv<:Union{Float64, ComplexF64}, got Type{BigFloat}
Stacktrace:
 [1] SuiteSparse.CHOLMOD.Sparse(A::SparseMatrixCSC{BigFloat, Int64}, stype::Int64)
   @ SuiteSparse.CHOLMOD /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/SuiteSparse/src/cholmod.jl:933
 [2] Sparse
   @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/SuiteSparse/src/cholmod.jl:949 [inlined]
 [3] cholesky(A::Hermitian{BigFloat, SparseMatrixCSC{BigFloat, Int64}}; kws::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:check,), Tuple{Bool}}})
   @ SuiteSparse.CHOLMOD /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/SuiteSparse/src/cholmod.jl:1458
 [4] isposdef(A::Symmetric{BigFloat, SparseMatrixCSC{BigFloat, Int64}})
   @ LinearAlgebra /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/dense.jl:91
 [5] top-level scope
   @ REPL[15]:1
dkarrasch commented 3 years ago

Was it ever working? I don't think we have generic sparse linear algebra methods, unfortunately.

ViralBShah commented 3 years ago

Yeah - I doubt if this ever worked.

ViralBShah commented 3 years ago

It would be nice to have a generic sparse linear algebra implementation, and this topic does come up every now and then.

ViralBShah commented 2 years ago

I am closing this - since it is not relevant to this package. This package simply provides wrappers for the SuiteSparse library.