Skip to content

Commit 3e59cd3

Browse files
committed
Working Reals
1 parent 0e19f26 commit 3e59cd3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/algos.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ function fft_dft!(out::AbstractVector{Complex{T}}, in::AbstractVector{T}, N::Int
127127
wk *= w
128128
wkn = wk
129129
end
130-
@inbounds @turbo for i in 1:halfN-1
131-
out[start_out + stride_out*(N-i)] = conj(out[start_out + stride_out*i])
130+
@inbounds @turbo for k in halfN+1:N-1
131+
out[start_out + stride_out*k] = conj(out[start_out + stride_out*(N-k)])
132132
end
133133
end
134134

test/real_forward.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using FFTA, Test
22
test_nums = [8, 11, 15, 100]
3-
@testset verbose = true "forward" begin
3+
@testset verbose = true " forward" begin
44
for N in test_nums
55
x = ones(Float64, N)
66
y = fft(x)

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ end
1212
@testset verbose = true "Complex" begin
1313
include("complex_forward.jl")
1414
include("complex_backward.jl")
15+
x = rand(ComplexF64, 100)
16+
y = fft(x)
17+
x2 = bfft(y)/length(x)
18+
@test x x2 atol=1e-12
1519
end
1620
@testset verbose = true "Real" begin
1721
include("real_forward.jl")
1822
include("real_backward.jl")
23+
x = rand(Float64, 100)
24+
y = fft(x)
25+
x2 = bfft(y)/length(x)
26+
@test x x2 atol=1e-12
1927
end
2028
end

0 commit comments

Comments
 (0)