Skip to content

Commit

Permalink
LTM copyto! with ranges, tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
milankl authored Mar 21, 2024
1 parent d458e03 commit a4c34cd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/lower_triangular_matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ end
copyto!(L2, L1)

@test L2 == L2c

# with ranges
L1 = zeros(LowerTriangularMatrix{NF}, 33, 32);
L2 = randn(LowerTriangularMatrix{NF}, 65, 64);
L2T = spectral_truncation(L2,(size(L1) .- 1)...)

copyto!(L1, L2, 1:33, 1:32) # size of smaller matrix
@test L1 == L2T

copyto!(L1, L2, 1:65, 1:64) # size of bigger matrix
@test L1 == L2T

copyto!(L1, L2, 1:50, 1:50) # in between
@test L1 == L2T
end
end

Expand Down

0 comments on commit a4c34cd

Please sign in to comment.