Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit 918c2c5

Browse files
committed
use truncate_modes as function name
1 parent 08de33b commit 918c2c5

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/Transform/Transform.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ abstract type AbstractTransform end
1818

1919
include("fourier_transform.jl")
2020
include("chebyshev_transform.jl")
21-
22-
const truncate_modes = low_pass

src/Transform/chebyshev_transform.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function transform(t::ChebyshevTransform{N}, 𝐱::AbstractArray) where {N}
1010
return FFTW.r2r(𝐱, FFTW.REDFT00, 1:N) # [size(x)..., in_chs, batch]
1111
end
1212

13-
function low_pass(t::ChebyshevTransform, 𝐱̂::AbstractArray)
14-
return view(𝐱̂, map(d->1:d, t.modes)..., :, :) # [ft.modes..., in_chs, batch]
13+
function truncate_modes(t::ChebyshevTransform, 𝐱̂::AbstractArray)
14+
return view(𝐱̂, map(d->1:d, t.modes)..., :, :) # [t.modes..., in_chs, batch]
1515
end
1616

1717
function inverse(t::ChebyshevTransform{N}, 𝐱̂::AbstractArray) where {N}

src/Transform/fourier_transform.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function low_pass(ft::FourierTransform, 𝐱_fft::AbstractArray)
1414
return view(𝐱_fft, map(d -> 1:d, ft.modes)..., :, :) # [ft.modes..., in_chs, batch]
1515
end
1616

17-
truncate_modes(args...) = low_pass(args...)
17+
truncate_modes(ft::FourierTransform, 𝐱_fft::AbstractArray) = low_pass(ft, 𝐱_fft)
1818

1919
function inverse(ft::FourierTransform, 𝐱_fft::AbstractArray)
2020
return real(ifft(𝐱_fft, 1:ndims(ft))) # [size(x_fft)..., out_chs, batch]

0 commit comments

Comments
 (0)