-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make SparseArrays an extension package
While this may seem a bit weird since the most normal case for Krylov subspace methods is on sparse arrays, there are multiple reasons for this. 1. SparseArrays pulls in SuiteSparse and thus GPL dependencies 2. This is by far the biggest part of the load. Normal Krylov.jl loads in about 8ms, but the SparseArrays part is ~150ms. So if you want to just work on operators, then you'd taking a decently sized hit. 3. This is required for downstream dependency reduction SciML/LinearSolve.jl#570
- Loading branch information
1 parent
f03bafb
commit 6b1f40f
Showing
8 changed files
with
865 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module KrylovSparseArraysExt | ||
|
||
using Krylov, SparseArrays | ||
using Krylov.LinearAlgebra | ||
using Krylov.LinearAlgebra: NoPivot, LowerTriangular | ||
using Krylov: FloatOrComplex, reduced_qr!, ktypeof, vector_to_matrix, knorm, kdot, kaxpy!, kdotr, kfill! | ||
|
||
function Krylov.ktypeof(v::S) where S <: SparseVector | ||
T = eltype(S) | ||
return Vector{T} | ||
end | ||
|
||
function Krylov.ktypeof(v::S) where S <: AbstractSparseVector | ||
return S.types[2] # return `CuVector` for a `CuSparseVector` | ||
end | ||
|
||
include("krylov_processes.jl") | ||
include("block_krylov_processes.jl") | ||
|
||
end |
Oops, something went wrong.