Skip to content

Commit 1401ba4

Browse files
another fix for rectangular transforms
1 parent 966c732 commit 1401ba4

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/SphericalHarmonics/fastplan.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ end
1111
function FastSphericalHarmonicPlan(A::Matrix{T}, L::Int; opts...) where T
1212
M, N = size(A)
1313
n = (N+1)÷2
14-
RP = RotationPlan(T, n-1)
14+
RP = RotationPlan(T, M-1)
1515
p1 = plan_normleg2cheb(A)
1616
p2 = plan_normleg12cheb2(A)
1717
p1inv = plan_cheb2normleg(A)

src/SphericalHarmonics/slowplan.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function Base.A_mul_B!(P::RotationPlan, A::AbstractMatrix)
106106
@stepthreads for m = M÷2:-1:2
107107
@inbounds for j = m:-2:2
108108
for l = N-j:-1:1
109-
s = snm[l+(j-2)*(M+2-j)÷2]
110-
c = cnm[l+(j-2)*(M+2-j)÷2]
109+
s = snm[l+(j-2)*(2*N+3-j)÷2]
110+
c = cnm[l+(j-2)*(2*N+3-j)÷2]
111111
a1 = A[l+N*(2*m-1)]
112112
a2 = A[l+2+N*(2*m-1)]
113113
a3 = A[l+N*(2*m)]
@@ -129,8 +129,8 @@ function Base.At_mul_B!(P::RotationPlan, A::AbstractMatrix)
129129
@stepthreads for m = M÷2:-1:2
130130
@inbounds for j = reverse(m:-2:2)
131131
for l = 1:N-j
132-
s = snm[l+(j-2)*(M+2-j)÷2]
133-
c = cnm[l+(j-2)*(M+2-j)÷2]
132+
s = snm[l+(j-2)*(2*N+3-j)÷2]
133+
c = cnm[l+(j-2)*(2*N+3-j)÷2]
134134
a1 = A[l+N*(2*m-1)]
135135
a2 = A[l+2+N*(2*m-1)]
136136
a3 = A[l+N*(2*m)]
@@ -199,8 +199,7 @@ end
199199

200200
function SlowSphericalHarmonicPlan(A::Matrix{T}) where T
201201
M, N = size(A)
202-
n = (N+1)÷2
203-
RP = RotationPlan(T, n-1)
202+
RP = RotationPlan(T, M-1)
204203
p1 = plan_normleg2cheb(A)
205204
p2 = plan_normleg12cheb2(A)
206205
p1inv = plan_cheb2normleg(A)

src/SphericalHarmonics/thinplan.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515
function ThinSphericalHarmonicPlan(A::Matrix{T}, L::Int; opts...) where T
1616
M, N = size(A)
1717
n = (N+1)÷2
18-
RP = RotationPlan(T, n-1)
18+
RP = RotationPlan(T, M-1)
1919
p1 = plan_normleg2cheb(A)
2020
p2 = plan_normleg12cheb2(A)
2121
p1inv = plan_cheb2normleg(A)

0 commit comments

Comments
 (0)