@@ -41,50 +41,58 @@ canonicalspace(S::Ultraspherical) = Chebyshev(domain(S))
4141pointscompatible (A:: Ultraspherical , B:: Chebyshev ) = domain (A) == domain (B)
4242pointscompatible (A:: Chebyshev , B:: Ultraspherical ) = domain (A) == domain (B)
4343
44- struct UltrasphericalPlan{CT,FT}
44+ struct UltrasphericalPlan{CT,FT,IP }
4545 chebplan:: CT
4646 cheb2legplan:: FT
4747
48- UltrasphericalPlan {CT,FT} (cp,c2lp) where {CT,FT} = new {CT,FT} (cp,c2lp)
48+ UltrasphericalPlan {CT,FT} (cp,c2lp, :: Val{IP} ) where {CT,FT,IP } = new {CT,FT,IP } (cp,c2lp)
4949end
5050
51- struct UltrasphericalIPlan{CT,FT}
51+ struct UltrasphericalIPlan{CT,FT,IP }
5252 chebiplan:: CT
5353 leg2chebplan:: FT
5454
55- UltrasphericalIPlan {CT,FT} (cp,c2lp) where {CT,FT} = new {CT,FT} (cp,c2lp)
55+ UltrasphericalIPlan {CT,FT} (cp,c2lp, :: Val{IP} ) where {CT,FT,IP } = new {CT,FT,IP } (cp,c2lp)
5656end
5757
58- function UltrasphericalPlan (λ:: Number ,vals)
58+ function UltrasphericalPlan (λ:: Number ,vals,inplace = Val ( false ) )
5959 if λ == 0.5
60- cp = plan_transform (Chebyshev (),vals)
60+ cp = ApproxFunBase . _plan_transform!! (inplace) (Chebyshev (),vals)
6161 c2lp = plan_cheb2leg (eltype (vals),length (vals))
62- UltrasphericalPlan {typeof(cp),typeof(c2lp)} (cp,c2lp)
62+ UltrasphericalPlan {typeof(cp),typeof(c2lp)} (cp,c2lp,inplace )
6363 else
6464 error (" Not implemented" )
6565 end
6666end
6767
68- function UltrasphericalIPlan (λ:: Number ,cfs)
68+ function UltrasphericalIPlan (λ:: Number ,cfs,inplace = Val ( false ) )
6969 if λ == 0.5
70- cp= plan_itransform (Chebyshev (),cfs)
70+ cp = ApproxFunBase . _plan_itransform!! (inplace) (Chebyshev (),cfs)
7171 c2lp= plan_leg2cheb (eltype (cfs),length (cfs))
72- UltrasphericalIPlan {typeof(cp),typeof(c2lp)} (cp,c2lp)
72+ UltrasphericalIPlan {typeof(cp),typeof(c2lp)} (cp,c2lp,inplace )
7373 else
7474 error (" Not implemented" )
7575 end
7676end
7777
78- * (UP:: UltrasphericalPlan ,v:: AbstractVector ) =
78+ * (UP:: UltrasphericalPlan{<:Any,<:Any,false} ,v:: AbstractVector ) =
7979 UP. cheb2legplan* (UP. chebplan* v)
80- * (UP:: UltrasphericalIPlan ,v:: AbstractVector ) =
80+ * (UP:: UltrasphericalIPlan{<:Any,<:Any,false} ,v:: AbstractVector ) =
8181 UP. chebiplan* (UP. leg2chebplan* v)
8282
83+ * (UP:: UltrasphericalPlan{<:Any,<:Any,true} ,v:: AbstractVector ) =
84+ lmul! (UP. cheb2legplan, UP. chebplan* v)
85+ * (UP:: UltrasphericalIPlan{<:Any,<:Any,true} ,v:: AbstractVector ) =
86+ UP. chebiplan * lmul! (UP. leg2chebplan, v)
8387
8488plan_transform (sp:: Ultraspherical{Int} ,vals:: AbstractVector ) = CanonicalTransformPlan (sp,vals)
89+ plan_transform! (sp:: Ultraspherical{Int} ,vals:: AbstractVector ) = CanonicalTransformPlan (sp,vals,Val (true ))
8590plan_transform (sp:: Ultraspherical ,vals:: AbstractVector ) = UltrasphericalPlan (order (sp),vals)
91+ plan_transform! (sp:: Ultraspherical ,vals:: AbstractVector ) = UltrasphericalPlan (order (sp),vals,Val (true ))
8692plan_itransform (sp:: Ultraspherical{Int} ,cfs:: AbstractVector ) = ICanonicalTransformPlan (sp,cfs)
93+ plan_itransform! (sp:: Ultraspherical{Int} ,cfs:: AbstractVector ) = ICanonicalTransformPlan (sp,cfs,Val (true ))
8794plan_itransform (sp:: Ultraspherical ,cfs:: AbstractVector ) = UltrasphericalIPlan (order (sp),cfs)
95+ plan_itransform! (sp:: Ultraspherical ,cfs:: AbstractVector ) = UltrasphericalIPlan (order (sp),cfs,Val (true ))
8896
8997# # Construction
9098
0 commit comments