@@ -780,21 +780,26 @@ function SciMLBase.solve!(cache::LinearCache, alg::UMFPACKFactorization; kwargs.
780780 SparseArrays. decrement (SparseArrays. getrowval (A)) ==
781781 cacheval. rowval)
782782 fact = lu (SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A),
783- nonzeros (A)))
783+ nonzeros (A)), check = false )
784784 else
785785 fact = lu! (cacheval,
786786 SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A),
787- nonzeros (A)))
787+ nonzeros (A)), check = false )
788788 end
789789 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 )
791791 end
792792 cache. cacheval = fact
793793 cache. isfresh = false
794794 end
795795
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
798803end
799804
800805"""
@@ -840,10 +845,10 @@ function init_cacheval(alg::KLUFactorization, A::AbstractSparseArray, b, u, Pl,
840845 nonzeros (A)))
841846end
842847
848+ # TODO : guard this against errors
843849function SciMLBase. solve! (cache:: LinearCache , alg:: KLUFactorization ; kwargs... )
844850 A = cache. A
845851 A = convert (AbstractMatrix, A)
846-
847852 if cache. isfresh
848853 cacheval = @get_cacheval (cache, :KLUFactorization )
849854 if cacheval != = nothing && alg. reuse_symbolic
0 commit comments