Skip to content

Commit d4922b3

Browse files
authored
Dl/jacobiplan (#6)
* Add type to JacobiTransformPlan * Update Project.toml * Prune exact zeros in roots * update for ApproxFunBase v0.1.2
1 parent 77904ee commit d4922b3

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"
3030

3131
[compat]
3232
AbstractFFTs = "≥ 0.3.1"
33-
ApproxFunBase = "0.1.1"
33+
ApproxFunBase = "0.1.2"
3434
BandedMatrices = "0.9.0"
3535
BlockArrays = "0.9"
3636
BlockBandedMatrices = "0.4.3"
3737
Calculus = "≥ 0.1.15"
3838
DSP = "≥ 0.5.1"
39-
DomainSets = "0.0.2"
39+
DomainSets = "0.0.2, 0.1"
4040
DualNumbers = "≥ 0.4.0"
4141
FFTW = "≥ 0.2.4"
4242
FastGaussQuadrature = "≥ 0.3.2"
4343
FastTransforms = "≥ 0.4.2"
4444
FillArrays = "≥ 0.5.0"
4545
InfiniteArrays = "0.1"
4646
IntervalSets = "≥ 0.3.1"
47-
LazyArrays = "0.8"
47+
LazyArrays = "0.8, 0.9"
4848
LowRankApprox = "≥ 0.2"
4949
Reexport = "≥ 0.2.0"
5050
SpecialFunctions = "≥ 0.7.0"

src/ApproxFunOrthogonalPolynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import BandedMatrices: bandrange, bandshift,
5656
bandwidths, _BandedMatrix, BandedMatrix
5757

5858
import Base: values, convert, getindex, setindex!, *, +, -, ==, <, <=, >, |, !, !=, eltype, iterate,
59-
>=, /, ^, \, , transpose, size, reindex, tail, broadcast, broadcast!, copyto!, copy, to_index, (:),
59+
>=, /, ^, \, , transpose, size, tail, broadcast, broadcast!, copyto!, copy, to_index, (:),
6060
similar, map, vcat, hcat, hvcat, show, summary, stride, sum, cumsum, sign, imag, conj, inv,
6161
complex, reverse, exp, sqrt, abs, abs2, sign, issubset, values, in, first, last, rand, intersect, setdiff,
6262
isless, union, angle, join, isnan, isapprox, isempty, sort, merge, promote_rule,

src/Spaces/Jacobi/jacobitransform.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11

22
points(S::Jacobi, n) = points(Chebyshev(domain(S)), n)
33

4-
struct JacobiTransformPlan{CPLAN,CJT}
4+
struct JacobiTransformPlan{T,CPLAN,CJT} <: AbstractTransformPlan{T}
55
chebplan::CPLAN
66
cjtplan::CJT
77
end
88

9+
JacobiTransformPlan(chebplan::CPLAN, cjtplan::CJT) where {CPLAN,CJT} =
10+
JacobiTransformPlan{eltype(chebplan),CPLAN,CJT}(chebplan, cjtplan)
11+
912
plan_transform(S::Jacobi, v::AbstractVector) =
1013
JacobiTransformPlan(plan_transform(Chebyshev(), v), plan_icjt(v, S.a, S.b))
11-
*(P::JacobiTransformPlan, vals) = P.cjtplan*(P.chebplan*vals)
14+
*(P::JacobiTransformPlan, vals::AbstractVector) = P.cjtplan*(P.chebplan*vals)
1215

1316

14-
struct JacobiITransformPlan{CPLAN,CJT}
17+
struct JacobiITransformPlan{T,CPLAN,CJT} <: AbstractTransformPlan{T}
1518
ichebplan::CPLAN
1619
icjtplan::CJT
1720
end
1821

22+
JacobiITransformPlan(chebplan::CPLAN, cjtplan::CJT) where {CPLAN,CJT} =
23+
JacobiITransformPlan{eltype(chebplan),CPLAN,CJT}(chebplan, cjtplan)
24+
25+
1926

20-
plan_itransform(S::Jacobi,v::AbstractVector) =
27+
plan_itransform(S::Jacobi, v::AbstractVector) =
2128
JacobiITransformPlan(plan_itransform(Chebyshev(), v), plan_cjt(v, S.a, S.b))
22-
*(P::JacobiITransformPlan,cfs) = P.ichebplan*(P.icjtplan*cfs)
29+
*(P::JacobiITransformPlan, cfs::AbstractVector) = P.ichebplan*(P.icjtplan*cfs)
2330

2431

2532
function coefficients(f::AbstractVector,a::Jacobi,b::Chebyshev)

src/roots.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ end
132132
function colleague_matrix( c::Vector{T} ) where T<:Number
133133
#TODO: This is command isn't typed correctly
134134
# COMPUTE THE ROOTS OF A LOW DEGREE POLYNOMIAL BY USING THE COLLEAGUE MATRIX:
135+
c = chop(c,0) # prune exact zeros
135136
n = length(c) - 1
136137
A=zeros(T,n,n)
137138

0 commit comments

Comments
 (0)