@@ -13,9 +13,9 @@ recγ(::Type{T},::Chebyshev,k) where {T} = one(T)/2 # one(T) ensures we get co
13
13
14
14
# # Evaluation
15
15
16
- Evaluation (S:: MaybeNormalized{<:Chebyshev} ,x:: Number ,o:: Integer ) = ConcreteEvaluation (S,x,o)
16
+ Evaluation (S:: MaybeNormalized{<:Chebyshev} , x:: Number , o:: Integer ) = ConcreteEvaluation (S,x,o)
17
17
18
- function evaluatechebyshev (n:: Integer ,x:: T ) where T<: Number
18
+ function evaluatechebyshev (n:: Integer , x:: T ) where T<: Number
19
19
if n == 1
20
20
[one (T)]
21
21
else
@@ -33,7 +33,7 @@ function evaluatechebyshev(n::Integer,x::T) where T<:Number
33
33
end
34
34
35
35
# We assume that x is already scaled to the canonical domain. S is unused here
36
- function forwardrecurrence (:: Type{T} ,S:: Chebyshev ,r:: AbstractUnitRange{<:Integer} ,x:: Number ) where {T}
36
+ function forwardrecurrence (:: Type{T} , S:: Chebyshev , r:: AbstractUnitRange{<:Integer} , x:: Number ) where {T}
37
37
@assert ! isempty (r) && first (r) >= 0
38
38
v = evaluatechebyshev (maximum (r)+ 1 , T (x))
39
39
first (r) == 0 ? v : v[r .+ 1 ]
@@ -64,7 +64,8 @@ function _getindex_eval_leftendpoint(op::ConcreteEvaluation{<:Chebyshev{<:Interv
64
64
op[j: j][1 ]
65
65
end
66
66
end
67
- function _getindex_eval_rightendpoint (op:: ConcreteEvaluation{<:Chebyshev{<:IntervalOrSegment}} , x, j:: Integer )
67
+ function _getindex_eval_rightendpoint (op:: ConcreteEvaluation{<:Chebyshev{<:IntervalOrSegment}} ,
68
+ x, j:: Integer )
68
69
T= eltype (op)
69
70
if op. order == 0
70
71
one (T)
@@ -73,7 +74,8 @@ function _getindex_eval_rightendpoint(op::ConcreteEvaluation{<:Chebyshev{<:Inter
73
74
op[j: j][1 ]
74
75
end
75
76
end
76
- function _getindex_eval_leftendpoint (op:: ConcreteEvaluation{<:Chebyshev{<:IntervalOrSegment}} , x, k:: AbstractUnitRange )
77
+ function _getindex_eval_leftendpoint (op:: ConcreteEvaluation{<:Chebyshev{<:IntervalOrSegment}} ,
78
+ x, k:: AbstractUnitRange )
77
79
Base. require_one_based_indexing (k)
78
80
T= eltype (op)
79
81
x = op. x
@@ -96,7 +98,8 @@ function _getindex_eval_leftendpoint(op::ConcreteEvaluation{<:Chebyshev{<:Interv
96
98
97
99
scal! (cst,ret)
98
100
end
99
- function _getindex_eval_rightendpoint (op:: ConcreteEvaluation{<:Chebyshev{<:IntervalOrSegment}} , x, k:: AbstractUnitRange )
101
+ function _getindex_eval_rightendpoint (op:: ConcreteEvaluation{<:Chebyshev{<:IntervalOrSegment}} ,
102
+ x, k:: AbstractUnitRange )
100
103
Base. require_one_based_indexing (k)
101
104
T= eltype (op)
102
105
x = op. x
134
137
end
135
138
end
136
139
137
- function getindex (op:: ConcreteDirichlet{<:Chebyshev} ,
138
- k:: Integer ,j:: Integer )
140
+ function getindex (op:: ConcreteDirichlet{<:Chebyshev} , k:: Integer , j:: Integer )
139
141
if op. order == 0
140
142
k == 1 && iseven (j) && return - one (eltype (op))
141
143
return one (eltype (op))
@@ -144,8 +146,8 @@ function getindex(op::ConcreteDirichlet{<:Chebyshev},
144
146
end
145
147
end
146
148
147
- function Matrix (S:: SubOperator {T,ConcreteDirichlet{C,V ,T},
148
- NTuple{2 ,UnitRange{Int}}}) where {C <: Chebyshev ,V, T}
149
+ function Matrix (S:: SubOperator {T,<: ConcreteDirichlet{<:Chebyshev,<:Any ,T} ,
150
+ NTuple{2 ,UnitRange{Int}}}) where {T}
149
151
ret = Array {T} (undef, size (S)... )
150
152
kr,jr = parentindices (S)
151
153
isempty (kr) && return ret
@@ -168,13 +170,12 @@ end
168
170
169
171
# Multiplication
170
172
171
- Base. stride (M:: ConcreteMultiplication{U,V} ) where {U<: Chebyshev ,V<: Chebyshev } =
172
- stride (M. f)
173
+ Base. stride (M:: ConcreteMultiplication{<:Chebyshev,<:Chebyshev} ) = stride (M. f)
173
174
174
- getindex (M:: ConcreteMultiplication{C,C,T } ,k:: Integer ,j:: Integer ) where {T, C<: Chebyshev } =
175
+ getindex (M:: ConcreteMultiplication{C,C} ,k:: Integer ,j:: Integer ) where {C<: Chebyshev } =
175
176
chebmult_getindex (coefficients (M. f),k,j)
176
177
177
- getindex (M:: ConcreteMultiplication{C,PS,T } ,k:: Integer ,j:: Integer ) where {PS <: PolynomialSpace ,T,C <: Chebyshev } =
178
+ getindex (M:: ConcreteMultiplication{<:Chebyshev,<:PolynomialSpace } ,k:: Integer ,j:: Integer ) =
178
179
M[k: k,j: j][1 ,1 ]
179
180
180
181
@@ -211,21 +212,21 @@ end
211
212
212
213
# # Derivative
213
214
214
- function Derivative (sp:: Chebyshev{DD} , order:: Number ) where {DD <: IntervalOrSegment }
215
+ function Derivative (sp:: Chebyshev{<:IntervalOrSegment} , order:: Number )
215
216
assert_integer (order)
216
217
ConcreteDerivative (sp,order)
217
218
end
218
219
219
220
220
- rangespace (D:: ConcreteDerivative{Chebyshev{DD,RR}} ) where {DD <: IntervalOrSegment ,RR} =
221
+ rangespace (D:: ConcreteDerivative{<: Chebyshev{<:IntervalOrSegment}} ) =
221
222
Ultraspherical (D. order,domain (D))
222
223
223
- bandwidths (D:: ConcreteDerivative{Chebyshev{DD,RR}} ) where {DD <: IntervalOrSegment ,RR} = - D. order,D. order
224
- Base. stride (D:: ConcreteDerivative{Chebyshev{DD,RR}} ) where {DD <: IntervalOrSegment ,RR} = D. order
224
+ bandwidths (D:: ConcreteDerivative{<: Chebyshev{<:IntervalOrSegment}} ) = - D. order,D. order
225
+ Base. stride (D:: ConcreteDerivative{<: Chebyshev{<:IntervalOrSegment}} ) = D. order
225
226
226
227
isdiag (D:: ConcreteDerivative{<:Chebyshev{<:IntervalOrSegment}} ) = false
227
228
228
- function getindex (D:: ConcreteDerivative{Chebyshev{DD,RR},K ,T} ,k:: Integer ,j:: Integer ) where {DD <: IntervalOrSegment ,RR,K, T}
229
+ function getindex (D:: ConcreteDerivative{<: Chebyshev{<:IntervalOrSegment},<:Any ,T} ,k:: Integer ,j:: Integer ) where {T}
229
230
m= D. order
230
231
d= domain (D)
231
232
@@ -237,7 +238,7 @@ function getindex(D::ConcreteDerivative{Chebyshev{DD,RR},K,T},k::Integer,j::Inte
237
238
end
238
239
end
239
240
240
- linesum (f:: Fun{Chebyshev{DD,RR}} ) where {DD <: IntervalOrSegment ,RR} =
241
+ linesum (f:: Fun{<: Chebyshev{<:IntervalOrSegment}} ) =
241
242
sum (setcanonicaldomain (f))* arclength (domain (f))/ 2
242
243
243
244
@@ -247,8 +248,8 @@ linesum(f::Fun{Chebyshev{DD,RR}}) where {DD<:IntervalOrSegment,RR} =
247
248
for (Func,Len) in ((:DefiniteIntegral ,:complexlength ),(:DefiniteLineIntegral ,:arclength ))
248
249
ConcFunc = Symbol (:Concrete , Func)
249
250
@eval begin
250
- $ Func (S:: Chebyshev{D} ) where {D <: IntervalOrSegment } = $ ConcFunc (S)
251
- function getindex (Σ:: $ConcFunc{Chebyshev{D,R },T} ,k:: Integer ) where {D <: IntervalOrSegment ,R, T}
251
+ $ Func (S:: Chebyshev{<:IntervalOrSegment} ) = $ ConcFunc (S)
252
+ function getindex (Σ:: $ConcFunc{<: Chebyshev{<:IntervalOrSegment },T} , k:: Integer ) where {T}
252
253
d = domain (Σ)
253
254
C = $ Len (d)/ 2
254
255
0 commit comments