Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Mar 15, 2024
1 parent ecc00ba commit e04592d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Manifest.toml
2 changes: 1 addition & 1 deletion src/RFFT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ RCpair(A::Array{T}, dims=1:ndims(A)) where {T<:AbstractFloat} = copy!(RCpair{T}(
real(RC::RCpair) = RC.R
complex(RC::RCpair) = RC.C

copy!(RC::RCpair, A::AbstractArray{T}) where {T<:Complex} = (copy!(RC.C, A); RC)
copy!(RC::RCpair, A::AbstractArray{T}) where {T<:Real} = (copy!(RC.R, A); RC)
copy!(RC::RCpair, A::AbstractArray{T}) where {T<:Complex} = (copy!(RC.C, A); RC)
function copy(RC::RCpair{T,N}) where {T,N}
C = copy(RC.C)
R = reshape(reinterpret(T, C), size(parent(RC.R)))
Expand Down
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ using Test, FFTW, LinearAlgebra
for dims in (1:2, 1, 2)
for sz in ((5,6), (6,5))
pair = RFFT.RCpair{Float64}(undef, sz, dims)
pair = RFFT.RCpair(pair, dims) # for coverage
r = @inferred(real(pair))
c = @inferred(complex(pair))
b = rand(eltype(r), size(r))
pair = RFFT.RCpair(b, dims)
copyto!(r, b)
copyto!(r, c) # for coverage
copy!(pair, c) # for coverage
RFFT.rfft!(pair)
RFFT.irfft!(pair)
@test r b
Expand Down

0 comments on commit e04592d

Please sign in to comment.