@@ -780,21 +780,26 @@ function SciMLBase.solve!(cache::LinearCache, alg::UMFPACKFactorization; kwargs.
780
780
SparseArrays. decrement (SparseArrays. getrowval (A)) ==
781
781
cacheval. rowval)
782
782
fact = lu (SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A),
783
- nonzeros (A)))
783
+ nonzeros (A)), check = false )
784
784
else
785
785
fact = lu! (cacheval,
786
786
SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A),
787
- nonzeros (A)))
787
+ nonzeros (A)), check = false )
788
788
end
789
789
else
790
- fact = lu (SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A), nonzeros (A)))
790
+ fact = lu (SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A), nonzeros (A)), check = false )
791
791
end
792
792
cache. cacheval = fact
793
793
cache. isfresh = false
794
794
end
795
795
796
- y = ldiv! (cache. u, @get_cacheval (cache, :UMFPACKFactorization ), cache. b)
797
- SciMLBase. build_linear_solution (alg, y, nothing , cache)
796
+ F = @get_cacheval (cache, :UMFPACKFactorization )
797
+ if F. status == SparseArrays. UMFPACK. UMFPACK_OK
798
+ y = ldiv! (cache. u, F, cache. b)
799
+ SciMLBase. build_linear_solution (alg, y, nothing , cache)
800
+ else
801
+ SciMLBase. build_linear_solution (alg, cache. u, nothing , cache; retcode= ReturnCode. Infeasible)
802
+ end
798
803
end
799
804
800
805
"""
@@ -840,10 +845,10 @@ function init_cacheval(alg::KLUFactorization, A::AbstractSparseArray, b, u, Pl,
840
845
nonzeros (A)))
841
846
end
842
847
848
+ # TODO : guard this against errors
843
849
function SciMLBase. solve! (cache:: LinearCache , alg:: KLUFactorization ; kwargs... )
844
850
A = cache. A
845
851
A = convert (AbstractMatrix, A)
846
-
847
852
if cache. isfresh
848
853
cacheval = @get_cacheval (cache, :KLUFactorization )
849
854
if cacheval != = nothing && alg. reuse_symbolic
0 commit comments