Skip to content

Commit

Permalink
Added tests for kron! for diagonal matrices (#53184)
Browse files Browse the repository at this point in the history
Co-authored-by: Jishnu Bhattacharya <[email protected]>
  • Loading branch information
ShrutiRDalvi and jishnub committed Feb 8, 2024
1 parent 95df060 commit a0989f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stdlib/LinearAlgebra/test/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1266,4 +1266,15 @@ end
@test copy(Diagonal(1:5)) === Diagonal(1:5)
end

@testset "kron! for Diagonal" begin
a = Diagonal([2,2])
b = Diagonal([1,1])
c = Diagonal([0,0,0,0])
kron!(c,b,a)
@test c == Diagonal([2,2,2,2])
c=Diagonal(Vector{Float64}(undef, 4))
kron!(c,a,b)
@test c == Diagonal([2,2,2,2])
end

end # module TestDiagonal

0 comments on commit a0989f4

Please sign in to comment.