Skip to content

Commit 9219308

Browse files
committed
fix removedc bug
make a note of a failing unit test on windows.
1 parent 2648c07 commit 9219308

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/jop_removedc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function JopRemoveDC_df!(d::AbstractArray{T,2}, m::AbstractArray{T,2}; kwargs...
2020
mean = sum(_m[:,k2]) / length(_m[:,k2])
2121
_d[:,k2] .= _m[:,k2] .- mean
2222
end
23-
_d
23+
d
2424
end
2525

2626
function JopRemoveDC_df′!(m::AbstractArray{T,2}, d::AbstractArray{T,2}; kwargs...) where {T}
@@ -32,5 +32,5 @@ function JopRemoveDC_df′!(m::AbstractArray{T,2}, d::AbstractArray{T,2}; kwargs
3232
mean = sum(_d[:,k2]) / length(_d[:,k2])
3333
_m[:,k2] .= _d[:,k2] .- mean
3434
end
35-
_m
35+
m
3636
end

test/jop_removedc.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ end
1919
end
2020

2121
@testset "JopRemoveDC, dot product test, T=$T" for T in (Float32,Float64,Complex{Float32},Complex{Float64})
22-
A = JopRemoveDC(JetSpace(T,n1,n2))
23-
lhs,rhs = dot_product_test(A, rand(domain(A)), rand(range(A)))
24-
@test lhs rhs
22+
#=
23+
I observe the following bug on windows:
24+
x = rand(Complex{Float64},101,201)
25+
using LinearAlgebra
26+
dot(x,x) # crashes Julia, presumably due to an issue with BLAS on windows.
27+
=#
28+
if Sys.iswindows() && T == Complex{Float64}
29+
@warn "dot product test fails on Windows due to the LinearAlgebra.dot method not working for Complex{Float64}"
30+
else
31+
A = JopRemoveDC(JetSpace(T,n1,n2))
32+
lhs,rhs = dot_product_test(A, rand(domain(A)), rand(range(A)))
33+
@test lhs rhs
34+
end
2535
end

0 commit comments

Comments
 (0)