Skip to content

Commit 03c4548

Browse files
fix incorrect transpose
1 parent 301d035 commit 03c4548

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/SphericalHarmonics/vectorfield.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ if VERSION < v"0.7-"
106106

107107
Base.Ac_mul_B!(Y1::Matrix, Y2::Matrix, SP::SlowSphericalHarmonicPlan, X1::Matrix, X2::Matrix) = At_mul_B!(Y1, Y2, SP, X1, X2)
108108
else
109-
function LinearAlgebra.mul!(Y1::Matrix, Y2t::Transpose{T,Matrix{T}}, SP::SlowSphericalHarmonicPlan, X1::Matrix, X2::Matrix) where T
110-
Y2 = parent(Y2t)
109+
function LinearAlgebra.mul!(Y1::Matrix, Y2::Matrix, SPt::Transpose{Any,SlowSphericalHarmonicPlan{T}}, X1::Matrix, X2::Matrix) where T
110+
SP = parent(SPt)
111111
RP, p1inv, p2inv, B = SP.RP, SP.p1inv, SP.p2inv, SP.B
112112
copyto!(B, X1)
113113
M, N = size(X1)
@@ -136,8 +136,8 @@ else
136136
Y1
137137
end
138138

139-
LinearAlgebra.mul!(Y1::Matrix, Y2::Adjoint{T,Matrix{T}}, SP::SlowSphericalHarmonicPlan, X1::Matrix, X2::Matrix) where T =
140-
At_mul_B!(Y1, Y2, SP, X1, X2)
139+
LinearAlgebra.mul!(Y1::Matrix, Y2::Matrix, SP::Adjoint{Any,SlowSphericalHarmonicPlan{T}}, X1::Matrix, X2::Matrix) where T =
140+
At_mul_B!(Y1, Y2, transpose(parent(SP)), X1, X2)
141141
end
142142

143143

test/sphericalharmonics/vectorfieldtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if VERSION < v"0.7-"
3636

3737
@test vecnorm(∇θF - G1)/vecnorm(∇θF) < n*eps()
3838
@test vecnorm(∇φF - G2)/vecnorm(∇φF) < n*eps()
39-
39+
4040
y = (1.0, 2.0, 3.0)
4141
for k in (10, 20, 40)
4242
∇θf = (θ,φ) -> -2k*sin(k*((sinpi(θ)*cospi(φ) - y[1])^2 + (sinpi(θ)*sinpi(φ) - y[2])^2 + (cospi(θ) - y[3])^2))*( (sinpi(θ)*cospi(φ) - y[1])*(cospi(θ)*cospi(φ)) + (sinpi(θ)*sinpi(φ) - y[2])*(cospi(θ)*sinpi(φ)) - (cospi(θ) - y[3])*sinpi(θ) )
@@ -92,7 +92,7 @@ else
9292

9393
U1 = zero(V1)
9494
U2 = zero(V2)
95-
mul!(U1, transpose(U2), P, V1, V2)
95+
mul!(U1, U2, transpose(P), V1, V2)
9696

9797
W1 = zero(U1)
9898
W2 = zero(U2)
@@ -127,7 +127,7 @@ else
127127

128128
U1 = zero(V1)
129129
U2 = zero(V2)
130-
FastTransforms.mul!(U1, transpose(U2), P, V1, V2)
130+
FastTransforms.mul!(U1, U2, transpose(P), V1, V2)
131131

132132
W1 = zero(U1)
133133
W2 = zero(U2)

0 commit comments

Comments
 (0)