Skip to content

Commit e0c2fd9

Browse files
authored
Roots for Fun with Int coeffs (#73)
* roots for Fun with Int coeffs * version bump to v0.5.9
1 parent b3f3e46 commit e0c2fd9

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.5.8"
3+
version = "0.5.9"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/roots.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ function roots(f::Fun)
6363
end
6464
end
6565

66-
roots(f::Fun{<:Chebyshev}) = fromcanonical.(f,roots(setcanonicaldomain(f)))
66+
function roots(f::Fun{<:Chebyshev})
67+
g = Fun(space(f), float.(coefficients(f)))
68+
gg = setcanonicaldomain(g)
69+
r = roots(gg)
70+
fromcanonical.(f,r)
71+
end
6772

6873

6974
for (BF,FF) in ((BigFloat,Float64),(Complex{BigFloat},ComplexF64))

test/ChebyshevTest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ import ApproxFunOrthogonalPolynomials: forwardrecurrence
136136

137137
@test_throws ArgumentError roots(Fun(zero))
138138
@test_throws ArgumentError roots(Fun(Chebyshev(),Float64[]))
139+
140+
f = Fun(Chebyshev(), [1,2,3])
141+
@test sort(roots(f)) 1/6*[-1-√13, -1+√13]
139142
end
140143

141144
@testset "Aliasing" begin

0 commit comments

Comments
 (0)