Skip to content

Commit dee2b60

Browse files
committed
Make note of the need to overload *
Also reformat the README to wrap long lines.
1 parent 13cc45c commit dee2b60

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,31 @@ Documentation:
99
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaMath.github.io/AbstractFFTs.jl/stable)
1010
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaMath.github.io/AbstractFFTs.jl/latest)
1111

12-
This package is mainly not intended to be used directly. Instead, developers of packages that implement FFTs (such as [FFTW.jl](https://github.com/JuliaMath/FFTW.jl)) extend the types/functions defined in `AbstractFFTs`. This multiple FFT packages to co-exist with the same underlying `fft(x)` and `plan_fft(x)` interface.
12+
This package is mainly not intended to be used directly.
13+
Instead, developers of packages that implement FFTs (such as [FFTW.jl](https://github.com/JuliaMath/FFTW.jl))
14+
extend the types/functions defined in `AbstractFFTs`.
15+
This allows multiple FFT packages to co-exist with the same underlying `fft(x)` and `plan_fft(x)` interface.
1316

1417
## Developer information
1518

1619
To define a new FFT implementation in your own module, you should
1720

18-
* Define a new subtype (e.g. `MyPlan`) of `AbstractFFTs.Plan{T}` for FFTs and related transforms on arrays of `T`. This must have a `pinv::Plan` field, initially undefined when a `MyPlan` is created, that is used for caching the inverse plan.
21+
* Define a new subtype (e.g. `MyPlan`) of `AbstractFFTs.Plan{T}` for FFTs and related transforms on arrays of `T`.
22+
This must have a `pinv::Plan` field, initially undefined when a `MyPlan` is created, that is used for caching the
23+
inverse plan.
1924

20-
* Define a new method `AbstractFFTs.plan_fft(x, region; kws...)` that returns a `MyPlan` for at least some types of `x` and some set of dimensions `region`.
25+
* Define a new method `AbstractFFTs.plan_fft(x, region; kws...)` that returns a `MyPlan` for at least some types of
26+
`x` and some set of dimensions `region`.
2127

2228
* Define a method of `A_mul_B!(y, p::MyPlan, x)` that computes the transform `p` of `x` and stores the result in `y`.
2329

24-
* If the inverse transform is implemented, you should also define `plan_inv(p::MyPlan)`, which should construct the inverse plan to `p`, and `plan_bfft(x, region; kws...)` for an unnormalized inverse ("backwards") transform of `x`.
30+
* Define a method of `*(p::MyPlan, x)`, which can simply call your `A_mul_B!` method.
31+
This is not defined generically in this package due to subtleties that arise for in-place and real-input FFTs.
32+
33+
* If the inverse transform is implemented, you should also define `plan_inv(p::MyPlan)`, which should construct the
34+
inverse plan to `p`, and `plan_bfft(x, region; kws...)` for an unnormalized inverse ("backwards") transform of `x`.
2535

2636
* You can also define similar methods of `plan_rfft` and `plan_brfft` for real-input FFTs.
2737

28-
The normalization convention for your FFT should be that it computes yₖ = ∑ⱼ xⱼ exp(-2πi jk/n) for a transform of length n, and the "backwards" (unnormalized inverse) transform computes the same thing but with exp(+2πi jk/n).
38+
The normalization convention for your FFT should be that it computes yₖ = ∑ⱼ xⱼ exp(-2πi jk/n) for a transform of
39+
length n, and the "backwards" (unnormalized inverse) transform computes the same thing but with exp(+2πi jk/n).

0 commit comments

Comments
 (0)