-
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
See JuliaLang/julia#28883 and all of the PRs/issues it references (also, perhaps JuliaLang/LinearAlgebra.jl#562 is relevant, though not sure).
In particular, the ones that come up with this package frequently are:
- Diagonal * Tridiagonal
- Tridiagonal * Diagonal
With Julia 1.1 at least, you can see that Diagonal * Tridiagonal -> Sparse, which is a fallback we don't want.
julia> using LinearAlgebra
julia> A = Tridiagonal(rand(2), rand(3), rand(2))
3×3 Tridiagonal{Float64,Array{Float64,1}}:
0.651845 0.692459 ⋅
0.571598 0.955736 0.929357
⋅ 0.460634 0.948893
julia> D = Diagonal(rand(3))
3×3 Diagonal{Float64,Array{Float64,1}}:
0.235908 ⋅ ⋅
⋅ 0.351151 ⋅
⋅ ⋅ 0.242416
julia> A * D
3×3 SparseArrays.SparseMatrixCSC{Float64,Int64} with 7 stored entries:
[1, 1] = 0.153776
[2, 1] = 0.134845
[1, 2] = 0.243158
[2, 2] = 0.335608
[3, 2] = 0.161752
[2, 3] = 0.225291
[3, 3] = 0.230026This should be efficiently done as a tridiagonal instead.
Metadata
Metadata
Assignees
Labels
No labels