@@ -4,17 +4,29 @@ struct ChebyshevDisk{V,T} <: Space{Disk{V},T}
4
4
domain:: Disk{V}
5
5
end
6
6
7
- ChebyshevDisk (d:: Disk{V} ) where V = ChebyshevDisk {V,eltype(V)} (d)
7
+ ChebyshevDisk (d:: Disk{V} ) where V = ChebyshevDisk {V,complex( eltype(V) )} (d)
8
8
ChebyshevDisk () = ChebyshevDisk (Disk ())
9
9
10
10
rectspace (_) = Chebyshev () * Laurent ()
11
11
12
-
13
12
function points (S:: ChebyshevDisk , N)
14
13
pts = points (rectspace (S), N)
15
- fromcanonical .( Ref (S . domain), polar .(pts) )
14
+ polar .(pts)
16
15
end
17
16
17
+ tensorizer (K:: ChebyshevDisk ) = Tensorizer ((Ones {Int} (∞),Ones {Int} (∞)))
18
+
19
+ # we have each polynomial
20
+ blocklengths (K:: ChebyshevDisk ) = 1 : ∞
21
+
22
+ for OP in (:block ,:blockstart ,:blockstop )
23
+ @eval begin
24
+ $ OP (s:: ChebyshevDisk ,M:: Block ) = $ OP (tensorizer (s),M)
25
+ $ OP (s:: ChebyshevDisk ,M) = $ OP (tensorizer (s),M)
26
+ end
27
+ end
28
+
29
+
18
30
plan_transform (S:: ChebyshevDisk , n:: AbstractVector ) =
19
31
TransformPlan (S, plan_transform (rectspace (S),n), Val{false })
20
32
plan_itransform (S:: ChebyshevDisk , n:: AbstractVector ) =
@@ -25,10 +37,8 @@ function checkerboard(A::AbstractMatrix{T}) where T
25
37
m,n = size (A)
26
38
C = zeros (T, (m+ 1 )÷ 2 , n)
27
39
z = @view (A[1 : 2 : end ,1 ])
28
- e1 = @view (A[1 : 2 : end ,4 : 4 : end ])
29
- e2 = @view (A[1 : 2 : end ,5 : 4 : end ])
30
- o1 = @view (A[2 : 2 : end ,2 : 4 : end ])
31
- o2 = @view (A[2 : 2 : end ,3 : 4 : end ])
40
+ e1,e2 = @view (A[1 : 2 : end ,4 : 4 : end ]),@view (A[1 : 2 : end ,5 : 4 : end ])
41
+ o1,o2 = @view (A[2 : 2 : end ,2 : 4 : end ]),@view (A[2 : 2 : end ,3 : 4 : end ])
32
42
C[1 : size (z,1 ),1 ] .= z
33
43
C[1 : size (e1,1 ),4 : 4 : n] .= e1
34
44
C[1 : size (e2,1 ),5 : 4 : n] .= e2
40
50
function icheckerboard (C:: AbstractMatrix{T} ) where T
41
51
m,n = size (C)
42
52
A = zeros (T, 2 * m, n)
43
- A[1 : 2 : end ,1 : 2 : end ] .= C[:,1 : 2 : end ]
44
- A[2 : 2 : end ,2 : 2 : end ] .= C[:,2 : 2 : end ]
53
+ A[1 : 2 : end ,1 ] .= C[:,1 ]
54
+ A[1 : 2 : end ,4 : 4 : end ] .= C[:,4 : 4 : end ]
55
+ A[1 : 2 : end ,5 : 4 : end ] .= C[:,5 : 4 : end ]
56
+ A[2 : 2 : end ,2 : 4 : end ] .= C[:,2 : 4 : end ]
57
+ A[2 : 2 : end ,3 : 4 : end ] .= C[:,3 : 4 : end ]
45
58
A
46
59
end
47
60
48
- * (P:: TransformPlan{<:Any,<:ChebyshevDisk} , v:: AbstractArray ) = checkerboard (P. plan* v)
49
- * (P:: ITransformPlan{<:Any,<:ChebyshevDisk} , v:: AbstractArray ) = P. plan* icheckerboard (v)
61
+ torectcfs (S, v) = fromtensor (rectspace (S), icheckerboard (totensor (S, v)))
62
+ fromrectcfs (S, v) = fromtensor (S, checkerboard (totensor (rectspace (S),v)))
63
+
64
+ * (P:: TransformPlan{<:Any,<:ChebyshevDisk} , v:: AbstractArray ) = fromrectcfs (P. space, P. plan* v)
65
+ * (P:: ITransformPlan{<:Any,<:ChebyshevDisk} , v:: AbstractArray ) = P. plan* torectcfs (P. space, v)
50
66
51
- evaluate (cfs:: AbstractVector , S:: ChebyshevDisk , x) = evaluate (cfs, rectspace (S), ipolar (tocanonical (S . domain,x) ))
67
+ evaluate (cfs:: AbstractVector , S:: ChebyshevDisk , x) = evaluate (torectcfs (S, cfs) , rectspace (S), ipolar (x ))
52
68
0 commit comments