@@ -92,7 +92,54 @@ import SpecialFunctions: sinpi, cospi, airy, besselh,
9292 eta, zeta, gamma, polygamma, invdigamma, digamma, trigamma,
9393 abs, sign, log, expm1, tan, abs2, sqrt, angle, max, min, cbrt, log,
9494 atan, acos, asin, erfc, inv
95-
95+
96+ points (d:: IntervalOrSegmentDomain{T} ,n:: Integer ; kind:: Int = 1 ) where {T} =
97+ fromcanonical .(Ref (d), chebyshevpoints (float (real (eltype (T))), n; kind= kind)) # eltype to handle point
98+ bary (v:: AbstractVector{Float64} , d:: IntervalOrSegmentDomain , x:: Float64 ) = bary (v,tocanonical (d,x))
99+
100+ function FastTransforms. chebyshevtransform! (X:: AbstractMatrix{T} ;kind:: Integer = 1 ) where T<: fftwNumber
101+ if kind == 1
102+ if size (X) == (1 ,1 )
103+ X
104+ else
105+ X= r2r! (X,REDFT10)
106+ X[:,1 ]/= 2 ;X[1 ,:]/= 2 ;
107+ lmul! (1 / (size (X,1 )* size (X,2 )),X)
108+ end
109+ elseif kind == 2
110+ if size (X) == (1 ,1 )
111+ X
112+ else
113+ X= r2r! (X,REDFT00)
114+ lmul! (1 / ((size (X,1 )- 1 )* (size (X,2 )- 1 )),X)
115+ X[:,1 ]/= 2 ;X[:,end ]/= 2
116+ X[1 ,:]/= 2 ;X[end ,:]/= 2
117+ X
118+ end
119+ end
120+ end
121+
122+ function FastTransforms. ichebyshevtransform! (X:: AbstractMatrix{T} ;kind:: Integer = 1 ) where T<: fftwNumber
123+ if kind == 1
124+ if size (X) == (1 ,1 )
125+ X
126+ else
127+ X[1 ,:]*= 2 ;X[:,1 ]*= 2
128+ X = r2r (X,REDFT01)
129+ lmul! (1 / 4 ,X)
130+ end
131+ elseif kind == 2
132+ if size (X) == (1 ,1 )
133+ X
134+ else
135+ X[1 ,:]*= 2 ;X[end ,:]*= 2 ;X[:,1 ]*= 2 ;X[:,end ]*= 2
136+ X= chebyshevtransform! (X;kind= kind)
137+ X[1 ,:]*= 2 ;X[end ,:]*= 2 ;X[:,1 ]*= 2 ;X[:,end ]*= 2
138+ lmul! ((size (X,1 )- 1 )* (size (X,2 )- 1 )/ 4 ,X)
139+ end
140+ end
141+ end
142+
96143include (" ultraspherical.jl" )
97144include (" Domains/Domains.jl" )
98145include (" Spaces/Spaces.jl" )
0 commit comments