Skip to content

Commit 2c4575a

Browse files
committed
fix arg order
1 parent a1f7f05 commit 2c4575a

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/rect.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ function weaklaplacian(P::RectPolynomial)
6262
A,B = P.args
6363
Δ_A,Δ_B = weaklaplacian(A), weaklaplacian(B)
6464
M_A,M_B = grammatrix(A), grammatrix(B)
65-
KronTrav(Δ_A,M_B) + KronTrav(M_A,Δ_B)
65+
KronTrav(M_B,Δ_A) + KronTrav(Δ_B,M_A)
6666
end
6767

6868
function \(P::RectPolynomial, Q::RectPolynomial)
6969
PA,PB = P.args
7070
QA,QB = Q.args
71-
krontrav(PA\QA, PB\QB)
71+
krontrav(PB\QB, PA\QA)
7272
end
7373

7474
@simplify function *(Ac::QuasiAdjoint{<:Any,<:RectPolynomial}, B::RectPolynomial)
7575
PA,PB = Ac'.args
7676
QA,QB = B.args
77-
KronTrav(PA'QA, PB'QB)
77+
KronTrav(PB'QB, PA'QA)
7878
end
7979

80-
grammatrix(P::KronPolynomial) = KronTrav(grammatrix.(P.args)...)
80+
grammatrix(P::KronPolynomial) = KronTrav(reverse(grammatrix.(P.args))...)
8181

8282

8383
struct ApplyPlan{T, F, Pl}
@@ -104,10 +104,8 @@ function *(A::TensorPlan, B::AbstractArray)
104104
B
105105
end
106106

107-
function checkpoints(P::RectPolynomial)
108-
x,y = checkpoints.(P.args)
109-
SVector.(x, y')
110-
end
107+
checkpoints(P::ProductDomain) = tensorgrid(checkpoints.(components(P))...)
108+
tensorgrid(x,y) = SVector.(x, y')
111109

112110
function plan_transform(P::KronPolynomial{d,<:Any,<:Fill}, B::Tuple{Block{1}}, dims=1:1) where d
113111
@assert dims == 1

test/test_rect.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ using Base: oneto
6161
@test (Y * (TU \ f))[KR] (TU \ h)[KR]
6262
end
6363

64+
@testset "gram matrix" begin
65+
P = Legendre()
66+
Q = Ultraspherical(3/2)
67+
PQ = RectPolynomial(P, Q)
68+
M = grammatrix(PQ)
69+
f = expand(PQ, splat((x,y) -> exp(x*cos(y + 1))))
70+
g = expand(PQ, splat((x,y) -> sin(x*cos(y + 1)+2)))
71+
@test coefficients(g)[1:100]'M[1:100,1:100] * coefficients(f)[1:100] sum(expand(T², 𝐱 -> f[𝐱]g[𝐱]))
72+
end
73+
6474
@testset "Conversion" begin
6575
T = ChebyshevT()
6676
U = ChebyshevU()

0 commit comments

Comments
 (0)