Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
putianyi889 committed Jan 30, 2024
1 parent 1788108 commit a182ffc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 5 additions & 2 deletions ext/FillArraysSparseArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module FillArraysSparseArraysExt

using SparseArrays
using SparseArrays: SparseVectorUnion
import Base: convert, kron
using FillArrays
using FillArrays: RectDiagonalFill, RectOrDiagonalFill, ZerosVector, ZerosMatrix, getindex_value
using LinearAlgebra
using FillArrays: RectDiagonalFill, RectOrDiagonalFill, ZerosVector, ZerosMatrix, getindex_value, AbstractFillVector, _fill_dot
import LinearAlgebra: dot, kron, I

##################
## Sparse arrays
Expand Down Expand Up @@ -56,4 +57,6 @@ end
# TODO: remove in v2.0
@deprecate kron(E1::RectDiagonalFill, E2::RectDiagonalFill) kron(sparse(E1), sparse(E2))

dot(x::AbstractFillVector, y::SparseVectorUnion) = _fill_dot(x, y)

end # module
11 changes: 8 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1391,9 +1391,14 @@ end
@test axes(E .+ E) === axes(E)
end

@testset "Issue #31" begin
@test convert(SparseMatrixCSC{Float64,Int64}, Zeros{Float64}(3, 3)) == spzeros(3, 3)
@test sparse(Zeros(4, 2)) == spzeros(4, 2)
@testset "Issues" begin
@testset "#31" begin
@test convert(SparseMatrixCSC{Float64,Int64}, Zeros{Float64}(3, 3)) == spzeros(3, 3)
@test sparse(Zeros(4, 2)) == spzeros(4, 2)
end
@testset "#178" begin
@test Zeros(10)'*spzeros(10) == 0
end
end

@testset "Adjoint/Transpose/permutedims" begin
Expand Down

0 comments on commit a182ffc

Please sign in to comment.