Skip to content

Commit

Permalink
Tests for sparse copyto layoutmatrix (#387)
Browse files Browse the repository at this point in the history
* Tests for sparse copyto layoutmatrix

* Fix constructor
  • Loading branch information
jishnub authored Jul 31, 2023
1 parent e5d9918 commit 81ef2e0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_banded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,15 @@ Base.similar(::MyMatrix, ::Type{T}, m::Int, n::Int) where T = MyMatrix{T}(undef,
@test LinearAlgebra.copymutable_oftype(UpperTriangular(B), Float64) == B
end
end

@testset "sparse" begin
B = BandedMatrix(1 => [1:4;])
B2 = copy(B)
S = sparse(B) .* 2
copyto!(B, S)
@test B == 2B2
B .= 0
copyto!(view(B, :, :), S)
@test B == 2B2
end
end

0 comments on commit 81ef2e0

Please sign in to comment.