@@ -72,7 +72,7 @@ using Base: oneto
72
72
end
73
73
74
74
@testset " Evaluation" begin
75
-
75
+
76
76
@testset " 2D" begin
77
77
f2 = Fun (Chebyshev ()^ 2 , [1.0 ])
78
78
@test f2 (0.2 , 0.4 ) == 1.0
@@ -88,7 +88,7 @@ using Base: oneto
88
88
@test f20 (rand (20 )) == 1.0
89
89
end
90
90
end
91
-
91
+
92
92
@testset " Square" begin
93
93
S = Space (ChebyshevInterval ()^ 2 )
94
94
@test @inferred (blocklengths (S)) ≡ oneto (∞)
@@ -149,39 +149,39 @@ using Base: oneto
149
149
# coefficients
150
150
c_1 = rand (20 )
151
151
c_2 = rand (30 )
152
-
152
+
153
153
added_coef = [c_2[1 : 20 ]+ c_1;c_2[21 : end ]]
154
-
154
+
155
155
# 2D
156
156
f2_1 = Fun (Chebyshev ()^ 2 , c_1)
157
157
f2_2 = Fun (Chebyshev ()^ 2 , c_2)
158
158
@test coefficients (f2_1+ f2_2) == added_coef
159
-
159
+
160
160
@test (f2_1+ f2_2)(0.3 , 0.5 )≈ f2_1 (0.3 , 0.5 )+ f2_2 (0.3 , 0.5 )
161
-
161
+
162
162
# 3D
163
163
f3_1 = Fun (Chebyshev ()^ 3 , c_1)
164
164
f3_2 = Fun (Chebyshev ()^ 3 , c_2)
165
165
@test coefficients (f3_1+ f3_2) == added_coef
166
-
166
+
167
167
@test (f3_1+ f3_2)(0.3 , 0.5 , 0.6 )≈ f3_1 (0.3 , 0.5 , 0.6 )+ f3_2 (0.3 , 0.5 , 0.6 )
168
168
end
169
-
169
+
170
170
@testset " Multiplication" begin
171
171
# coefficients
172
172
c_1 = rand (20 )
173
173
c_2 = rand (30 )
174
-
174
+
175
175
# 2D
176
176
f2_1 = Fun (Chebyshev ()^ 2 , c_1)
177
177
f2_2 = Fun (Chebyshev ()^ 2 , c_2)
178
-
178
+
179
179
@test (f2_1 * f2_2)(0.4 , 0.5 ) ≈ f2_1 (0.4 , 0.5 ) * f2_2 (0.4 , 0.5 )
180
-
180
+
181
181
# 3D: not implemented in code yet
182
182
# f3_1 = Fun(Chebyshev()^3, c_1)
183
183
# f3_2 = Fun(Chebyshev()^3, c_2)
184
-
184
+
185
185
# @test (f3_1*f3_2)(0.4,0.5,0.6) ≈ f3_1(0.4,0.5,0.6)*f3_2(0.4,0.5,0.6)
186
186
end
187
187
end
0 commit comments