Skip to content

Commit

Permalink
increase cov
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed May 23, 2022
1 parent 8ad95d2 commit 314a89a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ModalInterlace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ getindex(A::ModalTrav, K::Block{1}) = _modaltravgetindex(A.matrix, K)
_modaltravgetindex(mat, K) = _modaltravgetindex(MemoryLayout(mat), mat, K)
function _modaltravgetindex(_, mat, K::Block{1})
k = Int(K)
m = (k+1)÷2
_modaltravgetindex(Matrix(mat[1:m, 1:4m+1]), K)
m = k ÷ 2 + 1
n = 4(m-1) + 1
_modaltravgetindex(Matrix(mat[1:m, 1:n]), K)
end

function _modaltravgetindex(::AbstractStridedLayout, mat, K::Block{1})
Expand Down
10 changes: 10 additions & 0 deletions test/test_modalinterlace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ import MultivariateOrthogonalPolynomials: ModalInterlace, ModalInterlaceLayout,
@test a+a isa ModalTrav
@test a+b isa PseudoBlockArray
@test a+v isa BlockArray
@test a .+ exp.(a .+ 1) isa ModalTrav

@test exp.(a) == exp.(b)
@test a + a == 2a == a+b

@test a .+ exp.(a .+ 1) == b .+ exp.(b .+ 1)

for k = 1:6
a[k] = k
end
@test a == 1:6

m = ModalTrav(reshape(1:10, 2, 5))
@test m[Block(3)] == [2,7,9]
@test m == [1,3,5,2,7,9]

@test copy(m) isa ModalTrav{Int,Matrix{Int}}
@test copy(m) == m
end

@testset "ModalInterlace" begin
Expand Down

0 comments on commit 314a89a

Please sign in to comment.