Skip to content

Commit 8e456f2

Browse files
authored
Fix multivariate Dirichlet (#90)
1 parent 875bf05 commit 8e456f2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/FourierOperators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Reverse(S::Fourier{D}) where {D} = ReverseWrapper(NegateEven(S,S))
365365
## Multivariate
366366

367367

368-
for TYP in (:Fourier,:Laurent,:CosSpace,:SinSpace,:Taylor)
368+
for TYP in (:Fourier,)
369369
@eval begin
370370
function Dirichlet(S::TensorSpace{Tuple{$TYP{PeriodicSegment{T},R},PS}},k) where {PS,T,R}
371371
op = [Operator(I,S.spaces[1])Evaluation(S.spaces[2],leftendpoint,k);
@@ -374,7 +374,7 @@ for TYP in (:Fourier,:Laurent,:CosSpace,:SinSpace,:Taylor)
374374
end
375375
function Dirichlet(S::TensorSpace{Tuple{PS,$TYP{PeriodicSegment{T},R}}},k) where {PS,T,R}
376376
op = [Evaluation(S.spaces[1],leftendpoint,k)Operator(I,S.spaces[2]);
377-
Evaluation(S.spaces[1],rightendpoint,k)ReverseOrientation(S[2]) ]
377+
Evaluation(S.spaces[1],rightendpoint,k)ReverseOrientation(S.spaces[2]) ]
378378
DirichletWrapper(SpaceOperator(op,S,PiecewiseSpace(rangespace(op).spaces)),k)
379379
end
380380
end

test/runtests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,18 @@ end
752752
@test f(1.1im) 2exp(-1.1^2)
753753
end
754754

755+
@testset "multivariate Dirichlet" begin
756+
f = Fun((x,y) -> cos(x)*sin(y), CosSpace()*Fourier())
757+
g = Dirichlet() * f
758+
@test f(0, pi/2) g(0, pi/2) atol=1e-10
759+
@test f(2pi, pi/2) g(2pi, pi/2) atol=1e-10
760+
761+
f = Fun((x,y) -> cos(x)*cos(y), Fourier()*CosSpace())
762+
g = Dirichlet() * f
763+
@test f(pi/2, 0) g(pi/2, 0) atol=1e-10
764+
@test f(pi/2, 2pi) g(pi/2, 2pi) atol=1e-10
765+
end
766+
755767
@testset "show" begin
756768
for (spT, spstr) in Any[(Fourier, "Fourier"), (CosSpace, "CosSpace"),
757769
(SinSpace, "SinSpace"), (Laurent, "Laurent"), (Taylor, "Taylor")]

0 commit comments

Comments
 (0)