@@ -8,35 +8,38 @@ import AbstractFFTs: Plan, fft, ifft
88import FFTW: plan_r2r!, fftwNumber, REDFT10, REDFT01, REDFT00, RODFT00, R2HC, HC2R,
99 r2r!, r2r, plan_fft, plan_ifft, plan_ifft!, plan_fft!
1010
11- import ApproxFunBase: normalize!, flipsign, FiniteRange, MatrixFun, UnsetSpace, VFun, RowVector,
12- UnivariateSpace, AmbiguousSpace, SumSpace, SubSpace, NoSpace, Space,
11+ import ApproxFunBase: normalize!, flipsign, FiniteRange, Fun, MatrixFun, UnsetSpace, VFun, RowVector,
12+ UnivariateSpace, AmbiguousSpace, SumSpace, SubSpace, WeightSpace, NoSpace, Space,
13+ HeavisideSpace, PointSpace,
1314 IntervalOrSegment, RaggedMatrix, AlmostBandedMatrix,
1415 AnyDomain, ZeroSpace, TrivialInterlacer, BlockInterlacer,
1516 AbstractTransformPlan, TransformPlan, ITransformPlan,
1617 ConcreteConversion, ConcreteMultiplication, ConcreteDerivative, ConcreteIntegral,
18+ ConcreteVolterra, Volterra, VolterraWrapper,
1719 MultiplicationWrapper, ConversionWrapper, DerivativeWrapper, Evaluation,
1820 Conversion, Multiplication, Derivative, Integral, bandwidths,
1921 ConcreteEvaluation, ConcreteDefiniteLineIntegral, ConcreteDefiniteIntegral, ConcreteIntegral,
2022 DefiniteLineIntegral, DefiniteIntegral, ConcreteDefiniteIntegral, ConcreteDefiniteLineIntegral,
21- ReverseOrientation, ReverseOrientationWrapper, ReverseWrapper, Reverse, NegateEven, Dirichlet,
23+ ReverseOrientation, ReverseOrientationWrapper, ReverseWrapper, Reverse, NegateEven, Dirichlet, ConcreteDirichlet,
2224 TridiagonalOperator, SubOperator, Space, @containsconstants , spacescompatible,
23- hasfasttransform, canonicalspace, setdomain, prectype, domainscompatible,
25+ hasfasttransform, canonicalspace, domain, setdomain, prectype, domainscompatible,
2426 plan_transform, plan_itransform, plan_transform!, plan_itransform!, transform, itransform, hasfasttransform, Integral,
2527 domainspace, rangespace, boundary,
2628 union_rule, conversion_rule, maxspace_rule, conversion_type, maxspace, hasconversion, points,
2729 rdirichlet, ldirichlet, lneumann, rneumann, ivp, bvp,
2830 linesum, differentiate, integrate, linebilinearform, bilinearform,
2931 UnsetNumber, coefficienttimes,
30- Segment, isambiguous, Vec, eps, isperiodic,
32+ Segment, IntervalOrSegmentDomain, PiecewiseSegment, isambiguous, Vec, eps, isperiodic,
3133 arclength, complexlength,
3234 invfromcanonicalD, fromcanonical, tocanonical, fromcanonicalD, tocanonicalD, canonicaldomain, setcanonicaldomain, mappoint,
3335 reverseorientation, checkpoints, evaluate, mul_coefficients, coefficients, isconvertible,
3436 clenshaw, ClenshawPlan, sineshaw,
3537 toeplitz_getindex, toeplitz_axpy!, ToeplitzOperator, hankel_getindex,
3638 SpaceOperator, ZeroOperator, InterlaceOperator,
3739 interlace!, reverseeven!, negateeven!, cfstype, pad!,
38- extremal_args, hesseneigvals
40+ extremal_args, hesseneigvals, chebyshev_clenshaw, recA, recB, recC, roots, chebmult_getindex, intpow, alternatingsum
3941
42+
4043import DomainSets: Domain, indomain, UnionDomain, ProductDomain, FullSpace, Point, elements, DifferenceDomain,
4144 Interval, ChebyshevInterval, boundary, ∂, rightendpoint, leftendpoint,
4245 dimension, Domain1d, Domain2d
@@ -236,58 +239,6 @@ plan_itransform(::CosSpace,x::AbstractVector) = plan_ichebyshevtransform(x;kind=
236239transform (:: CosSpace ,vals,plan) = plan* vals
237240itransform (:: CosSpace ,cfs,plan) = plan* cfs
238241
239- function chebyshev_clenshaw (c:: AbstractVector , x)
240- N,T = length (c),promote_type (eltype (c),typeof (x))
241- if N == 0
242- return zero (x)
243- elseif N == 1 # avoid issues with NaN x
244- return first (c)* one (x)
245- end
246-
247- x = 2 x
248- bk1,bk2 = zero (T),zero (T)
249- @inbounds for k = N: - 1 : 2
250- bk2, bk1 = bk1, muladd (x,bk1,c[k]- bk2)
251- end
252-
253- muladd (x/ 2 ,bk1,c[1 ]- bk2)
254- end
255-
256-
257- function chebyshev_clenshaw (c:: AbstractVector ,x:: Vector ,plan:: ClenshawPlan{<:Any,V} ) where V
258- N,n = length (c),length (x)
259- if isempty (c)
260- return zeros (V,n)
261- end
262-
263- bk= plan. bk
264- bk1= plan. bk1
265- bk2= plan. bk2
266-
267- @inbounds for i = 1 : n
268- x[i] = 2 x[i]
269- bk1[i] = zero (V)
270- bk2[i] = zero (V)
271- end
272-
273- @inbounds for k = N: - 1 : 2
274- ck = c[k]
275- for i = 1 : n
276- bk[i] = muladd (x[i],bk1[i],ck- bk2[i])
277- end
278- bk2, bk1, bk = bk1, bk, bk2
279- end
280-
281- ck = c[1 ]
282- @inbounds for i = 1 : n
283- x[i] = x[i]/ 2
284- bk[i] = muladd (x[i],bk1[i],ck- bk2[i])
285- end
286-
287- bk
288- end
289-
290-
291242clenshaw (:: CosSpace , c:: AbstractVector , x) = chebyshev_clenshaw (c, x)
292243
293244clenshaw (sp:: CosSpace , c:: AbstractVector , x:: AbstractArray ) =
@@ -623,4 +574,22 @@ DefiniteLineIntegral(d::PeriodicDomain) = DefiniteLineIntegral(Laurent(d))
623574union_rule (A:: Space{<:PeriodicSegment} , B:: Space{<:IntervalOrSegment} ) =
624575 union (Space (Interval (domain (A))), B)
625576
577+
578+ # # Derivative
579+
580+ function invfromcanonicalD (S:: Laurent{PeriodicLine{false}} )
581+ d= domain (S)
582+ @assert d. center== 0 && d. L== 1.0
583+ a= Fun (Laurent (),[1. ,.5 ,.5 ])
584+ end
585+
586+ function invfromcanonicalD (S:: LaurentDirichlet{PeriodicLine{false}} )
587+ d= domain (S)
588+ @assert d. center== 0 && d. L== 1.0
589+ a= Fun (Laurent (),[1. ,.5 ,.5 ])
590+ end
591+
592+ Space (d:: PeriodicCurve{S} ) where {S<: Fourier } = Fourier (d)
593+ Space (d:: PeriodicCurve{S} ) where {S<: Laurent } = Laurent (d)
594+
626595end # module
0 commit comments