Skip to content

Commit 12778e0

Browse files
authored
tests for bivariate Fun products (#119)
1 parent 17ea2f7 commit 12778e0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/miscAFBase.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
353366
end
354367

0 commit comments

Comments
 (0)