From 24cf079e6abb3baf44034de37d1c3c0a764501b1 Mon Sep 17 00:00:00 2001 From: Will Kimmerer Date: Thu, 20 Oct 2022 12:27:05 -0400 Subject: [PATCH 1/3] Add static if for 1.9 --- src/factorization.jl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/factorization.jl b/src/factorization.jl index f2fb8207a..e4a2e3cf4 100644 --- a/src/factorization.jl +++ b/src/factorization.jl @@ -274,14 +274,17 @@ function init_cacheval(alg::UMFPACKFactorization, A, b, u, Pl, Pr, maxiters::Int verbose::Bool, assumptions::OperatorAssumptions) A = convert(AbstractMatrix, A) zerobased = SparseArrays.getcolptr(A)[1] == 0 - res = SuiteSparse.UMFPACK.UmfpackLU(C_NULL, C_NULL, size(A, 1), size(A, 2), - zerobased ? copy(SparseArrays.getcolptr(A)) : - SuiteSparse.decrement(SparseArrays.getcolptr(A)), - zerobased ? copy(rowvals(A)) : - SuiteSparse.decrement(rowvals(A)), - copy(nonzeros(A)), 0) - finalizer(SuiteSparse.UMFPACK.umfpack_free_symbolic, res) - res + @static if VERSION < v"1.9" + return SuiteSparse.UMFPACK.UmfpackLU(C_NULL, C_NULL, size(A, 1), size(A, 2), + zerobased ? copy(SparseArrays.getcolptr(A)) : + SuiteSparse.decrement(SparseArrays.getcolptr(A)), + zerobased ? copy(rowvals(A)) : + SuiteSparse.decrement(rowvals(A)), + copy(nonzeros(A)), 0) + finalizer(SuiteSparse.UMFPACK.umfpack_free_symbolic, res) + else + return SuiteSparse.UMFPACK.UmfpackLU(A) + end end function SciMLBase.solve(cache::LinearCache, alg::UMFPACKFactorization; kwargs...) From 5075ce90182d9e0912e88a7a79964b5370082c48 Mon Sep 17 00:00:00 2001 From: Will Kimmerer Date: Thu, 20 Oct 2022 12:40:18 -0400 Subject: [PATCH 2/3] fmt --- src/factorization.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/factorization.jl b/src/factorization.jl index e4a2e3cf4..08ef834ad 100644 --- a/src/factorization.jl +++ b/src/factorization.jl @@ -276,11 +276,11 @@ function init_cacheval(alg::UMFPACKFactorization, A, b, u, Pl, Pr, maxiters::Int zerobased = SparseArrays.getcolptr(A)[1] == 0 @static if VERSION < v"1.9" return SuiteSparse.UMFPACK.UmfpackLU(C_NULL, C_NULL, size(A, 1), size(A, 2), - zerobased ? copy(SparseArrays.getcolptr(A)) : - SuiteSparse.decrement(SparseArrays.getcolptr(A)), - zerobased ? copy(rowvals(A)) : - SuiteSparse.decrement(rowvals(A)), - copy(nonzeros(A)), 0) + zerobased ? copy(SparseArrays.getcolptr(A)) : + SuiteSparse.decrement(SparseArrays.getcolptr(A)), + zerobased ? copy(rowvals(A)) : + SuiteSparse.decrement(rowvals(A)), + copy(nonzeros(A)), 0) finalizer(SuiteSparse.UMFPACK.umfpack_free_symbolic, res) else return SuiteSparse.UMFPACK.UmfpackLU(A) From 28d5b798c548c769b146d220be5685e4e1bb4075 Mon Sep 17 00:00:00 2001 From: Will Kimmerer Date: Thu, 20 Oct 2022 14:05:19 -0400 Subject: [PATCH 3/3] fix bound --- src/factorization.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/factorization.jl b/src/factorization.jl index 08ef834ad..e32adeed6 100644 --- a/src/factorization.jl +++ b/src/factorization.jl @@ -274,7 +274,7 @@ function init_cacheval(alg::UMFPACKFactorization, A, b, u, Pl, Pr, maxiters::Int verbose::Bool, assumptions::OperatorAssumptions) A = convert(AbstractMatrix, A) zerobased = SparseArrays.getcolptr(A)[1] == 0 - @static if VERSION < v"1.9" + @static if VERSION < v"1.9.0-DEV.1622" return SuiteSparse.UMFPACK.UmfpackLU(C_NULL, C_NULL, size(A, 1), size(A, 2), zerobased ? copy(SparseArrays.getcolptr(A)) : SuiteSparse.decrement(SparseArrays.getcolptr(A)),