@@ -699,7 +699,8 @@ function init_cacheval(alg::UMFPACKFactorization, A, b, u, Pl, Pr, maxiters::Int
699699 return SuiteSparse. UMFPACK. UmfpackLU (SparseMatrixCSC (size (A)... , getcolptr (A),
700700 rowvals (A), nonzeros (A)))
701701 end
702-
702+ elseif ! (eltype (A) <: Union{Float32,Float64} ) || ! (eltype (b) <: Union{Float32,Float64} )
703+ return nothing # Cannot use Umfpack
703704 else
704705 @static if VERSION < v " 1.9.0-DEV.1622"
705706 res = SuiteSparse. UMFPACK. UmfpackLU (C_NULL , C_NULL , 0 , 0 ,
@@ -782,6 +783,8 @@ function init_cacheval(alg::KLUFactorization, A, b, u, Pl, Pr, maxiters::Int, ab
782783 if typeof (A) <: SparseArrays.AbstractSparseArray
783784 return KLU. KLUFactorization (SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A),
784785 nonzeros (A)))
786+ elseif ! (eltype (A) <: Union{Float32,Float64} ) || ! (eltype (b) <: Union{Float32,Float64} )
787+ return nothing # Cannot use KLU
785788 else
786789 return KLU. KLUFactorization (SparseMatrixCSC (0 , 0 , [1 ], Int64[], eltype (A)[]))
787790 end
@@ -1102,7 +1105,7 @@ end
11021105
11031106function SciMLBase. solve! (cache:: LinearCache , alg:: DiagonalFactorization ;
11041107 kwargs... )
1105- A = cache. A
1108+ A = convert (AbstractMatrix, cache. A)
11061109 if cache. u isa Vector && cache. b isa Vector
11071110 @simd ivdep for i in eachindex (cache. u)
11081111 cache. u[i] = A. diag[i] \ cache. b[i]
0 commit comments