@@ -7,46 +7,46 @@ using FastTransforms
7
7
8
8
# first kind points -> first kind polynomials
9
9
n = 20
10
- p_1 = chebyshevpoints (Float64, n; kind = 1 )
10
+ p_1 = chebyshevpoints (Float64, n, Val ( 1 ) )
11
11
f = exp .(p_1)
12
- f̌ = chebyshevtransform (f; kind = 1 )
12
+ f̌ = chebyshevtransform (f, Val ( 1 ) )
13
13
14
14
f̃ = x -> [cos (k* acos (x)) for k= 0 : n- 1 ]' * f̌
15
15
f̃ (0.1 ) ≈ exp (0.1 )
16
16
17
17
# first kind polynomials -> first kind points
18
- ichebyshevtransform (f̌; kind = 1 ) ≈ exp .(p_1)
18
+ ichebyshevtransform (f̌, Val ( 1 ) ) ≈ exp .(p_1)
19
19
20
20
# second kind points -> first kind polynomials
21
- p_2 = chebyshevpoints (Float64, n; kind = 2 )
21
+ p_2 = chebyshevpoints (Float64, n, Val ( 2 ) )
22
22
f = exp .(p_2)
23
- f̌ = chebyshevtransform (f; kind = 2 )
23
+ f̌ = chebyshevtransform (f, Val ( 2 ) )
24
24
25
25
f̃ = x -> [cos (k* acos (x)) for k= 0 : n- 1 ]' * f̌
26
26
f̃ (0.1 ) ≈ exp (0.1 )
27
27
28
28
# first kind polynomials -> second kind points
29
- ichebyshevtransform (f̌; kind = 2 ) ≈ exp .(p_2)
29
+ ichebyshevtransform (f̌, Val ( 2 ) ) ≈ exp .(p_2)
30
30
31
31
32
32
# first kind points -> second kind polynomials
33
33
n = 20
34
- p_1 = chebyshevpoints (Float64, n; kind = 1 )
34
+ p_1 = chebyshevpoints (Float64, n, Val ( 1 ) )
35
35
f = exp .(p_1)
36
- f̌ = chebyshevutransform (f; kind = 1 )
36
+ f̌ = chebyshevutransform (f, Val ( 1 ) )
37
37
f̃ = x -> [sin ((k+ 1 )* acos (x))/ sin (acos (x)) for k= 0 : n- 1 ]' * f̌
38
38
f̃ (0.1 ) ≈ exp (0.1 )
39
39
40
40
# second kind polynomials -> first kind points
41
- ichebyshevutransform (f̌; kind = 1 ) ≈ exp .(p_1)
41
+ ichebyshevutransform (f̌, Val ( 1 ) ) ≈ exp .(p_1)
42
42
43
43
44
44
# second kind points -> second kind polynomials
45
- p_2 = chebyshevpoints (Float64, n; kind = 2 )[2 : n- 1 ]
45
+ p_2 = chebyshevpoints (Float64, n, Val ( 2 ) )[2 : n- 1 ]
46
46
f = exp .(p_2)
47
- f̌ = chebyshevutransform (f; kind = 2 )
47
+ f̌ = chebyshevutransform (f, Val ( 2 ) )
48
48
f̃ = x -> [sin ((k+ 1 )* acos (x))/ sin (acos (x)) for k= 0 : n- 3 ]' * f̌
49
49
f̃ (0.1 ) ≈ exp (0.1 )
50
50
51
51
# second kind polynomials -> second kind points
52
- ichebyshevutransform (f̌; kind = 2 ) ≈ exp .(p_2)
52
+ ichebyshevutransform (f̌, Val ( 2 ) ) ≈ exp .(p_2)
0 commit comments