Skip to content

Better handle Sparspak not loaded by default #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ext/LinearSolveSparseArraysExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ end

function LinearSolve.defaultalg(A::AbstractSparseMatrixCSC{Tv, Ti}, b,
assump::OperatorAssumptions{Bool}) where {Tv, Ti}
if assump.issq
DefaultLinearSolver(DefaultAlgorithmChoice.SparspakFactorization)
else
ext = Base.get_extension(LinearSolve, :LinearSolveSparspakExt)
if assump.issq && ext !== nothing
LinearSolve.DefaultLinearSolver(DefaultAlgorithmChoice.SparspakFactorization)
elseif !assump.issq
error("Generic number sparse factorization for non-square is not currently handled")
elseif ext === nothing
error("SparspakFactorization required for general sparse matrix types and with general Julia number types. Do `using Sparspak` in order to enable this functionality")
else
error("Unreachable reached. Please report this error with a reproducer."
end
end

Expand Down
Loading