Skip to content

Commit ed19422

Browse files
committed
fix non-determinism of chebyshev
1 parent 8417fe0 commit ed19422

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/contrib.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ end
2727
end
2828
end
2929

30-
##
30+
##

src/polynomials/ChebyshevT.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ julia> c.(-1:0.5:1)
8181
```
8282
"""
8383
function (ch::ChebyshevT{T})(x::S) where {T,S}
84-
any(x . domain(ch)) && error("$x outside of domain")
84+
x domain(ch) && error("$x outside of domain")
8585
R = promote_type(T, S)
8686
length(ch) == 0 && return zero(R)
8787
length(ch) == 1 && return R(ch[0])
@@ -217,8 +217,8 @@ zseries
217217

218218
function _c_to_z(cs::AbstractVector{T}) where {T}
219219
n = length(cs)
220-
U = promote_type(T, typeof(one(T) / 2))
221-
zs = Vector{U}(undef, 2n - 1)
220+
U = typeof(one(T) / 2)
221+
zs = zeros(U, 2n - 1)
222222
zs[n:end] = cs ./ 2
223223
return zs .+ reverse(zs)
224224
end

test/ChebyshevT.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ end
9595
end
9696

9797
@testset "Vander" begin
98-
x = 0:3
98+
x = 0:0.1:1
9999
v = vander(ChebyshevT, x, 5)
100100
@test size(v) == (length(x), 6)
101-
@inbounds for i in eachindex(x)
101+
@inbounds for i in 1:6
102102
coef = vcat(zeros(i - 1), 1)
103103
c = ChebyshevT(coef)
104104
@test v[:, i] c.(x)

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ import SparseArrays: sparse, nnz
1010
@testset "Polynomial" begin include("Polynomial.jl") end
1111
@testset "ChebyshevT" begin include("ChebyshevT.jl") end
1212
@testset "Deprecations" begin include("deprecated.jl") end
13-
@testset "Poly (deprecaterd)" begin include("Poly.jl") end
13+
@testset "Poly (deprecated)" begin include("Poly.jl") end

0 commit comments

Comments
 (0)