Skip to content

Commit 1fcf3ab

Browse files
Merge pull request #426 from sharanry/remove_suitesparse
Remove SuiteSparse
2 parents aaaef4f + 788ad2f commit 1fcf3ab

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

Project.toml

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
2828
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2929
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
3030
Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac"
31-
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
3231
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
3332

3433
[weakdeps]
@@ -88,7 +87,6 @@ SciMLOperators = "0.3"
8887
Setfield = "1"
8988
SparseArrays = "1.9"
9089
Sparspak = "0.3.6"
91-
SuiteSparse = "1.9"
9290
UnPack = "1"
9391
julia = "1.9"
9492

src/LinearSolve.jl

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ PrecompileTools.@recompile_invalidations begin
1818
using SciMLOperators: AbstractSciMLOperator, IdentityOperator
1919
using Setfield
2020
using UnPack
21-
using SuiteSparse
2221
using KLU
2322
using Sparspak
2423
using FastLapackInterface

src/factorization.jl

+17-17
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Julia's built in `lu`. Equivalent to calling `lu!(A)`
3333
* On dense matrices, this uses the current BLAS implementation of the user's computer,
3434
which by default is OpenBLAS but will use MKL if the user does `using MKL` in their
3535
system.
36-
* On sparse matrices, this will use UMFPACK from SuiteSparse. Note that this will not
36+
* On sparse matrices, this will use UMFPACK from SparseArrays. Note that this will not
3737
cache the symbolic factorization.
3838
* On CuMatrix, it will use a CUDA-accelerated LU from CuSolver.
3939
* On BandedMatrix and BlockBandedMatrix, it will use a banded LU.
@@ -139,7 +139,7 @@ Julia's built in `qr`. Equivalent to calling `qr!(A)`.
139139
* On dense matrices, this uses the current BLAS implementation of the user's computer
140140
which by default is OpenBLAS but will use MKL if the user does `using MKL` in their
141141
system.
142-
* On sparse matrices, this will use SPQR from SuiteSparse
142+
* On sparse matrices, this will use SPQR from SparseArrays
143143
* On CuMatrix, it will use a CUDA-accelerated QR from CuSolver.
144144
* On BandedMatrix and BlockBandedMatrix, it will use a banded QR.
145145
"""
@@ -681,7 +681,7 @@ patterns with “more structure”.
681681
682682
!!! note
683683
684-
By default, the SuiteSparse.jl are implemented for efficiency by caching the
684+
By default, the SparseArrays.jl are implemented for efficiency by caching the
685685
symbolic factorization. I.e., if `set_A` is used, it is expected that the new
686686
`A` has the same sparsity pattern as the previous `A`. If this algorithm is to
687687
be used in a context where that assumption does not hold, set `reuse_symbolic=false`.
@@ -692,11 +692,11 @@ Base.@kwdef struct UMFPACKFactorization <: AbstractFactorization
692692
end
693693

694694
@static if VERSION < v"1.9.0-DEV.1622"
695-
const PREALLOCATED_UMFPACK = SuiteSparse.UMFPACK.UmfpackLU(C_NULL, C_NULL, 0, 0,
695+
const PREALLOCATED_UMFPACK = SparseArrays.UMFPACK.UmfpackLU(C_NULL, C_NULL, 0, 0,
696696
[0], Int[], Float64[], 0)
697-
finalizer(SuiteSparse.UMFPACK.umfpack_free_symbolic, PREALLOCATED_UMFPACK)
697+
finalizer(SparseArrays.UMFPACK.umfpack_free_symbolic, PREALLOCATED_UMFPACK)
698698
else
699-
const PREALLOCATED_UMFPACK = SuiteSparse.UMFPACK.UmfpackLU(SparseMatrixCSC(0, 0, [1],
699+
const PREALLOCATED_UMFPACK = SparseArrays.UMFPACK.UmfpackLU(SparseMatrixCSC(0, 0, [1],
700700
Int[],
701701
Float64[]))
702702
end
@@ -722,17 +722,17 @@ function init_cacheval(alg::UMFPACKFactorization, A::AbstractSparseArray, b, u,
722722
A = convert(AbstractMatrix, A)
723723
zerobased = SparseArrays.getcolptr(A)[1] == 0
724724
@static if VERSION < v"1.9.0-DEV.1622"
725-
res = SuiteSparse.UMFPACK.UmfpackLU(C_NULL, C_NULL, size(A, 1), size(A, 2),
725+
res = SparseArrays.UMFPACK.UmfpackLU(C_NULL, C_NULL, size(A, 1), size(A, 2),
726726
zerobased ?
727727
copy(SparseArrays.getcolptr(A)) :
728-
SuiteSparse.decrement(SparseArrays.getcolptr(A)),
728+
SparseArrays.decrement(SparseArrays.getcolptr(A)),
729729
zerobased ? copy(rowvals(A)) :
730-
SuiteSparse.decrement(rowvals(A)),
730+
SparseArrays.decrement(rowvals(A)),
731731
copy(nonzeros(A)), 0)
732-
finalizer(SuiteSparse.UMFPACK.umfpack_free_symbolic, res)
732+
finalizer(SparseArrays.UMFPACK.umfpack_free_symbolic, res)
733733
return res
734734
else
735-
return SuiteSparse.UMFPACK.UmfpackLU(SparseMatrixCSC(size(A)..., getcolptr(A),
735+
return SparseArrays.UMFPACK.UmfpackLU(SparseMatrixCSC(size(A)..., getcolptr(A),
736736
rowvals(A), nonzeros(A)))
737737
end
738738
end
@@ -744,9 +744,9 @@ function SciMLBase.solve!(cache::LinearCache, alg::UMFPACKFactorization; kwargs.
744744
cacheval = @get_cacheval(cache, :UMFPACKFactorization)
745745
if alg.reuse_symbolic
746746
# Caches the symbolic factorization: https://github.com/JuliaLang/julia/pull/33738
747-
if alg.check_pattern && !(SuiteSparse.decrement(SparseArrays.getcolptr(A)) ==
747+
if alg.check_pattern && !(SparseArrays.decrement(SparseArrays.getcolptr(A)) ==
748748
cacheval.colptr &&
749-
SuiteSparse.decrement(SparseArrays.getrowval(A)) ==
749+
SparseArrays.decrement(SparseArrays.getrowval(A)) ==
750750
cacheval.rowval)
751751
fact = lu(SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A),
752752
nonzeros(A)))
@@ -773,7 +773,7 @@ A fast sparse LU-factorization which specializes on sparsity patterns with “le
773773
774774
!!! note
775775
776-
By default, the SuiteSparse.jl are implemented for efficiency by caching the
776+
By default, the SparseArrays.jl are implemented for efficiency by caching the
777777
symbolic factorization. I.e., if `set_A` is used, it is expected that the new
778778
`A` has the same sparsity pattern as the previous `A`. If this algorithm is to
779779
be used in a context where that assumption does not hold, set `reuse_symbolic=false`.
@@ -816,9 +816,9 @@ function SciMLBase.solve!(cache::LinearCache, alg::KLUFactorization; kwargs...)
816816
if cache.isfresh
817817
cacheval = @get_cacheval(cache, :KLUFactorization)
818818
if cacheval !== nothing && alg.reuse_symbolic
819-
if alg.check_pattern && !(SuiteSparse.decrement(SparseArrays.getcolptr(A)) ==
819+
if alg.check_pattern && !(SparseArrays.decrement(SparseArrays.getcolptr(A)) ==
820820
cacheval.colptr &&
821-
SuiteSparse.decrement(SparseArrays.getrowval(A)) == cacheval.rowval)
821+
SparseArrays.decrement(SparseArrays.getrowval(A)) == cacheval.rowval)
822822
fact = KLU.klu(SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A),
823823
nonzeros(A)))
824824
else
@@ -1378,4 +1378,4 @@ for alg in InteractiveUtils.subtypes(AbstractFactorization)
13781378
maxiters::Int, abstol, reltol, verbose::Bool,
13791379
assumptions::OperatorAssumptions)
13801380
end
1381-
end
1381+
end

src/factorization_sparse.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# Missing ldiv! definitions: https://github.com/JuliaSparse/SparseArrays.jl/issues/242
33
function _ldiv!(x::Vector,
44
A::Union{SparseArrays.QR, LinearAlgebra.QRCompactWY,
5-
SuiteSparse.SPQR.QRSparse,
6-
SuiteSparse.CHOLMOD.Factor}, b::Vector)
5+
SparseArrays.SPQR.QRSparse,
6+
SparseArrays.CHOLMOD.Factor}, b::Vector)
77
x .= A \ b
88
end
99

1010
function _ldiv!(x::AbstractVector,
1111
A::Union{SparseArrays.QR, LinearAlgebra.QRCompactWY,
12-
SuiteSparse.SPQR.QRSparse,
13-
SuiteSparse.CHOLMOD.Factor}, b::AbstractVector)
12+
SparseArrays.SPQR.QRSparse,
13+
SparseArrays.CHOLMOD.Factor}, b::AbstractVector)
1414
x .= A \ b
1515
end

0 commit comments

Comments
 (0)