Skip to content

Commit e408b88

Browse files
committed
some more fixes
1 parent dee4f32 commit e408b88

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

src/FastTransforms.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ else
2121
const LAmul! = LinearAlgebra.mul!
2222
const libfftw = libfftw3
2323
const libfftwf = libfftw3f
24-
import LinearAlgebra: Factorization, transpose, adjoint
24+
import LinearAlgebra: Factorization
2525
flipdim(A,d) = reverse(A; dims=d)
2626
end
2727

28+
2829
import Base: *, \, size, view
2930
import Base: getindex, setindex!, length
3031
import Compat.LinearAlgebra: BlasFloat, BlasInt
@@ -33,7 +34,7 @@ import HierarchicalMatrices: mul!, At_mul_B!, Ac_mul_B!
3334
import HierarchicalMatrices: ThreadSafeVector, threadsafezeros
3435
import LowRankApprox: ColPerm
3536
import AbstractFFTs: Plan
36-
import Compat: range
37+
import Compat: range, transpose, adjoint
3738

3839
export cjt, icjt, jjt, plan_cjt, plan_icjt
3940
export leg2cheb, cheb2leg, leg2chebu, ultra2ultra, jac2jac

src/SphericalHarmonics/synthesisanalysis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ end
230230

231231
function row_synthesis!(P, C, cfs::Vector{T}) where T
232232
n = length(cfs)
233-
lmul!(C, reverseeven!(negateeven!(cfs)))
233+
lmul!(C', reverseeven!(negateeven!(cfs)))
234234
if iseven(n)
235235
cfs[n÷2+1] *= two(T)
236236
end

test/sphericalharmonics/synthesisanalysistests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ using Compat.Test
33

44
import FastTransforms: normalizecolumns!, maxcolnorm
55

6+
if VERSION v"0.7-"
7+
vecnorm(A, p...) = norm(A, p...)
8+
end
9+
610
@testset "Synthesis and analysis" begin
711

812
# Starting with normalized spherical harmonic coefficients,

test/sphericalharmonics/vectorfieldtests.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ using Compat.Test
1414
V1 = zero(∇θF)
1515
V2 = zero(∇φF)
1616
Pa = FastTransforms.plan_analysis(∇θF)
17-
A_mul_B!(V1, V2, Pa, ∇θF, ∇φF)
17+
mul!(V1, V2, Pa, ∇θF, ∇φF)
1818
P = SlowSphericalHarmonicPlan(V1)
1919

2020
U1 = zero(V1)
2121
U2 = zero(V2)
22-
At_mul_B!(U1, U2, P, V1, V2)
22+
FastTransforms.At_mul_B!(U1, U2, P, V1, V2)
2323

2424
W1 = zero(U1)
2525
W2 = zero(U2)
2626

27-
A_mul_B!(W1, W2, P, U1, U2)
27+
mul!(W1, W2, P, U1, U2)
2828

2929
Ps = FastTransforms.plan_synthesis(W1)
3030

3131
G1 = zero(∇θF)
3232
G2 = zero(∇φF)
3333

34-
A_mul_B!(G1, G2, Ps, W1, W2)
34+
mul!(G1, G2, Ps, W1, W2)
3535

3636
@test vecnorm(∇θF - G1)/vecnorm(∇θF) < n*eps()
3737
@test vecnorm(∇φF - G2)/vecnorm(∇φF) < n*eps()
@@ -49,24 +49,24 @@ using Compat.Test
4949
V1 = zero(∇θF)
5050
V2 = zero(∇φF)
5151
Pa = FastTransforms.plan_analysis(∇θF)
52-
A_mul_B!(V1, V2, Pa, ∇θF, ∇φF)
52+
mul!(V1, V2, Pa, ∇θF, ∇φF)
5353
P = SlowSphericalHarmonicPlan(V1)
5454

5555
U1 = zero(V1)
5656
U2 = zero(V2)
57-
At_mul_B!(U1, U2, P, V1, V2)
57+
FastTransforms.At_mul_B!(U1, U2, P, V1, V2)
5858

5959
W1 = zero(U1)
6060
W2 = zero(U2)
6161

62-
A_mul_B!(W1, W2, P, U1, U2)
62+
mul!(W1, W2, P, U1, U2)
6363

6464
Ps = FastTransforms.plan_synthesis(W1)
6565

6666
G1 = zero(∇θF)
6767
G2 = zero(∇φF)
6868

69-
A_mul_B!(G1, G2, Ps, W1, W2)
69+
mul!(G1, G2, Ps, W1, W2)
7070

7171
@test vecnorm(∇θF - G1)/vecnorm(∇θF) < n*eps()
7272
@test vecnorm(∇φF - G2)/vecnorm(∇φF) < n*eps()

0 commit comments

Comments
 (0)