Skip to content

Commit

Permalink
add basic documentation examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Nov 11, 2014
1 parent 3c2e2c4 commit e9b99bc
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
48 changes: 48 additions & 0 deletions base/basedocs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@doc doc"""
@time ex
Executes the expression `ex`, printing the time it took to
execute and the total number of bytes its execution caused to be
allocated. Returns the value of the expression. For example:
@time begin
sleep(1)
2+2
end
""" @time

@doc doc"""
r"..."
Construct a regex, such as `r"^[a-z]*$"`.
""" r""

@doc doc"""
push!(collection, items...) → collection
Insert `items` at the end of `collection`.
""" push!

@doc doc"""
fft(A[, dims])
Performs a multidimensional FFT of the array `A`. 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 `nextprod()`. See also
`plan_fft()` for even greater efficiency.
A one-dimensional FFT computes the one-dimensional discrete Fourier
transform (DFT) as defined by
$$\operatorname{DFT}(A)[k] =
\sum_{n=1}^{\operatorname{length}(A)}
\exp\left(-i\frac{2\pi
(n-1)(k-1)}{\operatorname{length}(A)} \right) A[n].$$
A multidimensional FFT simply performs this operation along each
transformed dimension of `A`.
Higher performance is usually possible with multi-threading. Use
`FFTW.set_num_threads(np)` to use `np` threads, if you have `np`
processors.
""" fft
3 changes: 3 additions & 0 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ import .Dates: Date, DateTime, now
# nullable types
include("nullable.jl")

# Some basic documentation
include("basedocs.jl")

function __init__()
# Base library init
reinit_stdio()
Expand Down

0 comments on commit e9b99bc

Please sign in to comment.