Skip to content

Commit 04dc78d

Browse files
committed
add tests for vandermonde for chebyshevT
1 parent eca0250 commit 04dc78d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/ChebyshevT.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,18 @@ end
8585
@test companion(c)[1, 1] == -0.5
8686
end
8787

88-
@testset "Arithmetic $i, $j" for i in 1:5, j in 1:5
88+
@testset "Vander" begin
89+
x = 0:3
90+
v = vander(ChebyshevT, x, 5)
91+
@test size(v) == (length(x), 6)
92+
@inbounds for i in eachindex(x)
93+
coef = push!(zeros(i - 1), 1)
94+
c = ChebyshevT(coef)
95+
@test v[:, i] c.(x)
96+
end
97+
end
98+
99+
@testset "Arithmetic $i, $j" for i in 0:5, j in 0:5
89100
# multiplication
90101
target = zeros(i + j + 1)
91102
target[end] += 0.5
@@ -125,7 +136,7 @@ end
125136
@test gcd(c1, c2) ChebyshevT(6)
126137
end
127138

128-
@testset "z-series" for i in 1:5
139+
@testset "z-series" for i in 0:5
129140
# c to z
130141
input = append!([2], ones(i))
131142
target = append!(push!(0.5 .* ones(i), 2), 0.5 .* ones(i))

0 commit comments

Comments
 (0)