Skip to content

Commit

Permalink
Moved fft docstrings from helpdb.jl to appropriate files in base/fft/
Browse files Browse the repository at this point in the history
  • Loading branch information
nkottary committed Sep 15, 2015
1 parent f21e249 commit 897c6e9
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 155 deletions.
155 changes: 0 additions & 155 deletions base/docs/helpdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -557,68 +557,6 @@ Run the function `f` using the `handler` as the handler.
"""
Test.with_handler

# Base.FFTW

if USE_GPL_LIBS

doc"""
```rst
.. r2r(A, kind [, dims])
Performs a multidimensional real-input/real-output (r2r) transform
of type ``kind`` of the array ``A``, as defined in the FFTW manual.
``kind`` specifies either a discrete cosine transform of various types
(``FFTW.REDFT00``, ``FFTW.REDFT01``, ``FFTW.REDFT10``, or
``FFTW.REDFT11``), a discrete sine transform of various types
(``FFTW.RODFT00``, ``FFTW.RODFT01``, ``FFTW.RODFT10``, or
``FFTW.RODFT11``), a real-input DFT with halfcomplex-format output
(``FFTW.R2HC`` and its inverse ``FFTW.HC2R``), or a discrete
Hartley transform (``FFTW.DHT``). The ``kind`` argument may be
an array or tuple in order to specify different transform types
along the different dimensions of ``A``; ``kind[end]`` is used
for any unspecified dimensions. See the FFTW manual for precise
definitions of these transform types, at http:https://www.fftw.org/doc.
The optional ``dims`` argument specifies an iterable subset of
dimensions (e.g. an integer, range, tuple, or array) to transform
along. ``kind[i]`` is then the transform type for ``dims[i]``,
with ``kind[end]`` being used for ``i > length(kind)``.
See also :func:`plan_r2r` to pre-plan optimized r2r transforms.
```
"""
FFTW.r2r

doc"""
```rst
.. r2r!(A, kind [, dims])
Same as :func:`r2r`, but operates in-place on ``A``, which must be
an array of real or complex floating-point numbers.
```
"""
FFTW.r2r!

doc"""
```rst
.. plan_r2r!(A, kind [, dims [, flags [, timelimit]]])
Similar to :func:`Base.plan_fft`, but corresponds to :func:`r2r!`.
```
"""
FFTW.plan_r2r!

doc"""
```rst
.. plan_r2r(A, kind [, dims [, flags [, timelimit]]])
Pre-plan an optimized r2r transform, similar to :func:`Base.plan_fft`
except that the transforms (and the first three arguments)
correspond to :func:`r2r` and :func:`r2r!`, respectively.
```
"""
FFTW.plan_r2r

doc"""
```rst
.. plan_bfft!(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf)
Expand Down Expand Up @@ -740,99 +678,6 @@ Same as :func:`plan_ifft`, but operates in-place on ``A``.
"""
plan_ifft!

doc"""
```rst
.. dct(A [, dims])
Performs a multidimensional type-II discrete cosine transform (DCT)
of the array ``A``, using the unitary normalization of the DCT.
The optional ``dims`` argument specifies an iterable subset of
dimensions (e.g. an integer, range, tuple, or array) to transform
along. Most efficient if the size of ``A`` along the transformed
dimensions is a product of small primes; see :func:`nextprod`. See
also :func:`plan_dct` for even greater efficiency.
```
"""
dct

doc"""
```rst
.. idct(A [, dims])
Computes the multidimensional inverse discrete cosine transform (DCT)
of the array ``A`` (technically, a type-III DCT with the unitary
normalization).
The optional ``dims`` argument specifies an iterable subset of
dimensions (e.g. an integer, range, tuple, or array) to transform
along. Most efficient if the size of ``A`` along the transformed
dimensions is a product of small primes; see :func:`nextprod`. See
also :func:`plan_idct` for even greater efficiency.
```
"""
idct

doc"""
```rst
.. dct!(A [, dims])
Same as :func:`dct!`, except that it operates in-place
on ``A``, which must be an array of real or complex floating-point
values.
```
"""
dct!

doc"""
```rst
.. idct!(A [, dims])
Same as :func:`idct!`, but operates in-place on ``A``.
```
"""
idct!

doc"""
```rst
.. plan_dct!(A [, dims [, flags [, timelimit]]])
Same as :func:`plan_dct`, but operates in-place on ``A``.
```
"""
plan_dct!

doc"""
```rst
.. plan_idct(A [, dims [, flags [, timelimit]]])
Pre-plan an optimized inverse discrete cosine transform (DCT), similar to
:func:`plan_fft` except producing a function that computes :func:`idct`.
The first two arguments have the same meaning as for :func:`idct`.
```
"""
plan_idct

doc"""
```rst
.. plan_dct(A [, dims [, flags [, timelimit]]])
Pre-plan an optimized discrete cosine transform (DCT), similar to
:func:`plan_fft` except producing a function that computes :func:`dct`.
The first two arguments have the same meaning as for :func:`dct`.
```
"""
plan_dct

doc"""
```rst
.. plan_idct!(A [, dims [, flags [, timelimit]]])
Same as :func:`plan_idct`, but operates in-place on ``A``.
```
"""
plan_idct!

end

# Base.Profile

doc"""
Expand Down
58 changes: 58 additions & 0 deletions base/fft/FFTW.jl
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,64 @@ function plan_r2r!{T<:fftwNumber,N}(X::StridedArray{T,N}, kinds, region;
r2rFFTWPlan{T,ANY,true,N}(X, X, region, kinds, flags, timelimit)
end

doc"""
```rst
.. r2r(A, kind [, dims])
Performs a multidimensional real-input/real-output (r2r) transform
of type ``kind`` of the array ``A``, as defined in the FFTW manual.
``kind`` specifies either a discrete cosine transform of various types
(``FFTW.REDFT00``, ``FFTW.REDFT01``, ``FFTW.REDFT10``, or
``FFTW.REDFT11``), a discrete sine transform of various types
(``FFTW.RODFT00``, ``FFTW.RODFT01``, ``FFTW.RODFT10``, or
``FFTW.RODFT11``), a real-input DFT with halfcomplex-format output
(``FFTW.R2HC`` and its inverse ``FFTW.HC2R``), or a discrete
Hartley transform (``FFTW.DHT``). The ``kind`` argument may be
an array or tuple in order to specify different transform types
along the different dimensions of ``A``; ``kind[end]`` is used
for any unspecified dimensions. See the FFTW manual for precise
definitions of these transform types, at http:https://www.fftw.org/doc.
The optional ``dims`` argument specifies an iterable subset of
dimensions (e.g. an integer, range, tuple, or array) to transform
along. ``kind[i]`` is then the transform type for ``dims[i]``,
with ``kind[end]`` being used for ``i > length(kind)``.
See also :func:`plan_r2r` to pre-plan optimized r2r transforms.
```
"""
FFTW.r2r

doc"""
```rst
.. r2r!(A, kind [, dims])
Same as :func:`r2r`, but operates in-place on ``A``, which must be
an array of real or complex floating-point numbers.
```
"""
FFTW.r2r!

doc"""
```rst
.. plan_r2r!(A, kind [, dims [, flags [, timelimit]]])
Similar to :func:`Base.plan_fft`, but corresponds to :func:`r2r!`.
```
"""
FFTW.plan_r2r!

doc"""
```rst
.. plan_r2r(A, kind [, dims [, flags [, timelimit]]])
Pre-plan an optimized r2r transform, similar to :func:`Base.plan_fft`
except that the transforms (and the first three arguments)
correspond to :func:`r2r` and :func:`r2r!`, respectively.
```
"""
FFTW.plan_r2r

# mapping from r2r kind to the corresponding inverse transform
const inv_kind = Dict{Int,Int}(R2HC => HC2R, HC2R => R2HC, DHT => DHT,
REDFT00 => REDFT00,
Expand Down
91 changes: 91 additions & 0 deletions base/fft/dct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,46 @@ for (pf, pfr, K, inplace) in ((:plan_dct, :plan_r2r, REDFT10, false),
end
end

doc"""
```rst
.. plan_dct!(A [, dims [, flags [, timelimit]]])
Same as :func:`plan_dct`, but operates in-place on ``A``.
```
"""
plan_dct!

doc"""
```rst
.. plan_idct(A [, dims [, flags [, timelimit]]])
Pre-plan an optimized inverse discrete cosine transform (DCT), similar to
:func:`plan_fft` except producing a function that computes :func:`idct`.
The first two arguments have the same meaning as for :func:`idct`.
```
"""
plan_idct

doc"""
```rst
.. plan_dct(A [, dims [, flags [, timelimit]]])
Pre-plan an optimized discrete cosine transform (DCT), similar to
:func:`plan_fft` except producing a function that computes :func:`dct`.
The first two arguments have the same meaning as for :func:`dct`.
```
"""
plan_dct

doc"""
```rst
.. plan_idct!(A [, dims [, flags [, timelimit]]])
Same as :func:`plan_idct`, but operates in-place on ``A``.
```
"""
plan_idct!

function plan_inv{T,K,inplace}(p::DCTPlan{T,K,inplace})
X = Array(T, p.plan.sz)
iK = inv_kind[K]
Expand All @@ -59,6 +99,57 @@ for f in (:dct, :dct!, :idct, :idct!)
end
end

doc"""
```rst
.. dct(A [, dims])
Performs a multidimensional type-II discrete cosine transform (DCT)
of the array ``A``, using the unitary normalization of the DCT.
The optional ``dims`` argument specifies an iterable subset of
dimensions (e.g. an integer, range, tuple, or array) to transform
along. Most efficient if the size of ``A`` along the transformed
dimensions is a product of small primes; see :func:`nextprod`. See
also :func:`plan_dct` for even greater efficiency.
```
"""
dct

doc"""
```rst
.. idct(A [, dims])
Computes the multidimensional inverse discrete cosine transform (DCT)
of the array ``A`` (technically, a type-III DCT with the unitary
normalization).
The optional ``dims`` argument specifies an iterable subset of
dimensions (e.g. an integer, range, tuple, or array) to transform
along. Most efficient if the size of ``A`` along the transformed
dimensions is a product of small primes; see :func:`nextprod`. See
also :func:`plan_idct` for even greater efficiency.
```
"""
idct

doc"""
```rst
.. dct!(A [, dims])
Same as :func:`dct!`, except that it operates in-place
on ``A``, which must be an array of real or complex floating-point
values.
```
"""
dct!

doc"""
```rst
.. idct!(A [, dims])
Same as :func:`idct!`, but operates in-place on ``A``.
```
"""
idct!

const sqrthalf = sqrt(0.5)
const sqrt2 = sqrt(2.0)
const onerange = 1:1
Expand Down

0 comments on commit 897c6e9

Please sign in to comment.