@@ -338,17 +338,30 @@ Base.:(==)(a::UniqueInterval, b::UniqueInterval) = (@assert a.parentinterval ==
338338 end
339339 end
340340
341- @testset " ProductFun " begin
341+ @testset " Bivariate " begin
342342 f = (x,y)-> x^ 2 * y^ 3
343343 P = ProductFun (f, Chebyshev ()⊗ Chebyshev ())
344344 x = 0.2 ; y = 0.3 ;
345345 @test P (x, y) ≈ f (x,y)
346346
347+ @test (P * one (P))(x,y) ≈ P (x,y)
348+ @test (P + zero (P))(x,y) ≈ P (x,y)
349+
347350 # coefficients copied from P above
348351 coeffs = SVector {4} (zeros (3 ), [0.375 , 0 , 0.375 ], zeros (3 ), [0.125 , 0 , 0.125 ])
349352 fv = [Fun (Chebyshev (), c) for c in coeffs]
350353 P2 = @inferred ProductFun (fv, Chebyshev ())
351354 @test P2 (x, y) ≈ f (x, y)
355+
356+ L = LowRankFun (f, Chebyshev ()⊗ Chebyshev ())
357+ @test (@inferred L * P)(x, y) ≈ (@inferred P * L)(x, y) ≈ f (x,y)^ 2
358+
359+ @test (L^ 0 * L)(x,y) ≈ L (x,y)
360+ @test (@inferred ((L -> L^ 1 )(L)))(x,y) ≈ L (x,y)
361+ @test (@inferred ((L -> L^ 2 )(L)))(x,y) ≈ (L* L)(x,y)
362+ @test (@inferred ((L -> L^ 4 )(L)))(x,y) ≈ (L* L* L* L)(x,y)
363+ @test (L * one (L))(x,y) ≈ L (x,y)
364+ @test (L + zero (L))(x,y) ≈ L (x,y)
352365 end
353366end
354367
0 commit comments