diff --git a/base/Enums.jl b/base/Enums.jl index 44d77e76771bb..0435d6cb8bcc0 100644 --- a/base/Enums.jl +++ b/base/Enums.jl @@ -29,7 +29,7 @@ end """ @enum EnumName EnumValue1[=x] EnumValue2[=y] -Create an [`Enum`](:obj:`Enum`) type with name `EnumName` and enum member values of +Create an `Enum` type with name `EnumName` and enum member values of `EnumValue1` and `EnumValue2` with optional assigned values of `x` and `y`, respectively. `EnumName` can be used just like other types and enum member values as regular values, such as diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 1e604fa279710..f568763e12ae0 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -267,9 +267,9 @@ linearindexing(::LinearIndexing, ::LinearIndexing) = LinearSlow() Return `true` if the specified indices `I` are in bounds for the given array `A`. Subtypes of `AbstractArray` should specialize this method if they need to provide custom bounds checking behaviors; however, in -many cases one can rely on `A`'s indices and [`checkindex`](:func:`checkindex`). +many cases one can rely on `A`'s indices and [`checkindex`](@ref). -See also [`checkindex`](:func:`checkindex`). +See also [`checkindex`](@ref). """ function checkbounds(::Type{Bool}, A::AbstractArray, I...) @_inline_meta @@ -304,7 +304,7 @@ usually in a 1-for-1 fashion, checkbounds_indices(Bool, (IA1, IA...), (I1, I...)) = checkindex(Bool, IA1, I1) & checkbounds_indices(Bool, IA, I) -Note that [`checkindex`](:func:`checkindex`) is being used to perform the actual +Note that [`checkindex`](@ref) is being used to perform the actual bounds-check for a single dimension of the array. There are two important exceptions to the 1-1 rule: linear indexing and @@ -714,8 +714,8 @@ A[iter] = 0 ``` If you supply more than one `AbstractArray` argument, `eachindex` will create an -iterable object that is fast for all arguments (a [`UnitRange`](:obj:`UnitRange`) -if all inputs have fast linear indexing, a [`CartesianRange`](:obj:`CartesianRange`) +iterable object that is fast for all arguments (a `UnitRange` +if all inputs have fast linear indexing, a `CartesianRange` otherwise). If the arrays have different sizes and/or dimensionalities, `eachindex` returns an iterable that spans the largest range along each dimension. @@ -1512,7 +1512,7 @@ sub2ind(::Tuple{}, I::Integer...) = (@_inline_meta; _sub2ind((), 1, 1, I...)) """ sub2ind(dims, i, j, k...) -> index -The inverse of [`ind2sub`](:func:`ind2sub`), returns the linear index corresponding to the provided subscripts. +The inverse of [`ind2sub`](@ref), returns the linear index corresponding to the provided subscripts. ```jldoctest julia> sub2ind((5,6,7),1,2,3) @@ -1789,7 +1789,7 @@ promote_eltype_op(op, A, B, C, D...) = (@_pure_meta; promote_eltype_op(op, eltyp """ map!(function, collection) -In-place version of [`map`](:func:`map`). +In-place version of [`map`](@ref). """ map!{F}(f::F, A::AbstractArray) = map!(f, A, A) function map!{F}(f::F, dest::AbstractArray, A::AbstractArray) @@ -1848,7 +1848,7 @@ end """ map!(function, destination, collection...) -Like [`map`](:func:`map`), but stores the result in `destination` rather than a new +Like [`map`](@ref), but stores the result in `destination` rather than a new collection. `destination` must be at least as large as the first collection. """ map!{F}(f::F, dest::AbstractArray, As::AbstractArray...) = map_n!(f, dest, As) diff --git a/base/abstractarraymath.jl b/base/abstractarraymath.jl index d3a00f628e61e..20864e69d5abc 100644 --- a/base/abstractarraymath.jl +++ b/base/abstractarraymath.jl @@ -210,7 +210,7 @@ julia> circshift(b, (-1,0)) 1 5 9 13 ``` -See also [`circshift!`](:func:`circshift!`). +See also [`circshift!`](@ref). """ function circshift(a::AbstractArray, shiftamt) circshift!(similar(a), a, map(Integer, (shiftamt...,))) diff --git a/base/array.jl b/base/array.jl index dcdeeb5f1fae6..3c94cb1d4309c 100644 --- a/base/array.jl +++ b/base/array.jl @@ -261,7 +261,7 @@ julia> eye(A) 0 0 1 ``` -Note the difference from [`ones`](:func:`ones`). +Note the difference from [`ones`](@ref). """ eye{T}(x::AbstractMatrix{T}) = eye(T, size(x, 1), size(x, 2)) diff --git a/base/arraymath.jl b/base/arraymath.jl index 0588165a4a5f9..d8486bfd3a8aa 100644 --- a/base/arraymath.jl +++ b/base/arraymath.jl @@ -7,7 +7,7 @@ Transform an array to its complex conjugate in-place. -See also [`conj`](:func:`conj`). +See also [`conj`](@ref). """ function conj!{T<:Number}(A::AbstractArray{T}) for i in eachindex(A) diff --git a/base/associative.jl b/base/associative.jl index 4baae3832a21e..b8cb3f43adc8d 100644 --- a/base/associative.jl +++ b/base/associative.jl @@ -115,7 +115,7 @@ end merge!(d::Associative, others::Associative...) Update collection with pairs from the other collections. -See also [`merge`](:func:`merge`). +See also [`merge`](@ref). """ function merge!(d::Associative, others::Associative...) for other in others @@ -138,7 +138,7 @@ end """ keytype(type) -Get the key type of an associative collection type. Behaves similarly to [`eltype`](:func:`eltype`). +Get the key type of an associative collection type. Behaves similarly to [`eltype`](@ref). """ keytype{K,V}(::Type{Associative{K,V}}) = K keytype(a::Associative) = keytype(typeof(a)) @@ -147,7 +147,7 @@ keytype{A<:Associative}(::Type{A}) = keytype(supertype(A)) """ valtype(type) -Get the value type of an associative collection type. Behaves similarly to [`eltype`](:func:`eltype`). +Get the value type of an associative collection type. Behaves similarly to [`eltype`](@ref). """ valtype{K,V}(::Type{Associative{K,V}}) = V valtype{A<:Associative}(::Type{A}) = valtype(supertype(A)) diff --git a/base/asyncmap.jl b/base/asyncmap.jl index c6d0265a8bcdf..47a465c5f247b 100644 --- a/base/asyncmap.jl +++ b/base/asyncmap.jl @@ -232,7 +232,7 @@ asyncmap(f, c...) = collect(AsyncGenerator(f, c...)) """ asyncmap!(f, c) -In-place version of [`asyncmap()`](:func:`asyncmap`). +In-place version of [`asyncmap()`](@ref). """ asyncmap!(f, c) = (for x in AsyncCollector(f, c, c) end; c) @@ -240,6 +240,6 @@ asyncmap!(f, c) = (for x in AsyncCollector(f, c, c) end; c) """ asyncmap!(f, results, c...) -Like [`asyncmap()`](:func:`asyncmap`), but stores output in `results` rather returning a collection. +Like [`asyncmap()`](@ref), but stores output in `results` rather returning a collection. """ asyncmap!(f, r, c1, c...) = (for x in AsyncCollector(f, r, c1, c...) end; r) diff --git a/base/base64.jl b/base/base64.jl index 2a8812af64b37..2c42ef29cbe3d 100644 --- a/base/base64.jl +++ b/base/base64.jl @@ -19,7 +19,7 @@ export Base64EncodePipe, Base64DecodePipe, base64encode, base64decode Returns a new write-only I/O stream, which converts any bytes written to it into base64-encoded ASCII bytes written to `ostream`. -Calling [`close`](:func:`close`) on the `Base64EncodePipe` stream +Calling [`close`](@ref) on the `Base64EncodePipe` stream is necessary to complete the encoding (but does not close `ostream`). """ type Base64EncodePipe <: IO @@ -166,10 +166,10 @@ end base64encode(writefunc, args...) base64encode(args...) -Given a [`write`](:func:`write`)-like function `writefunc`, which takes an I/O stream as its first argument, +Given a [`write`](@ref)-like function `writefunc`, which takes an I/O stream as its first argument, `base64encode(writefunc, args...)` calls `writefunc` to write `args...` to a base64-encoded string, and returns the string. `base64encode(args...)` is equivalent to `base64encode(write, args...)`: -it converts its arguments into bytes using the standard [`write`](:func:`write`) functions and returns the +it converts its arguments into bytes using the standard [`write`](@ref) functions and returns the base64-encoded string. """ function base64encode(f::Function, args...) diff --git a/base/bitarray.jl b/base/bitarray.jl index 198a3f89fe265..16e08b4852a5e 100644 --- a/base/bitarray.jl +++ b/base/bitarray.jl @@ -33,7 +33,7 @@ end BitArray{N}(dims::NTuple{N,Int}) Construct an uninitialized `BitArray` with the given dimensions. -Behaves identically to the [`Array`](:func:`Array`) constructor. +Behaves identically to the [`Array`](@ref) constructor. """ BitArray(dims::Integer...) = BitArray(map(Int,dims)) BitArray{N}(dims::NTuple{N,Int}) = BitArray{N}(dims...) @@ -1187,7 +1187,7 @@ end """ flipbits!(B::BitArray{N}) -> BitArray{N} -Performs a bitwise not operation on `B`. See [`~`](:ref:`~ operator <~>`). +Performs a bitwise not operation on `B`. See [`~`](@ref). ```jldoctest julia> A = trues(2,2) @@ -1632,7 +1632,7 @@ rol!(B::BitVector, i::Integer) = rol!(B, B, i) Performs a left rotation operation, returning a new `BitVector`. `i` controls how far to rotate the bits. -See also [`rol!`](:func:`rol!`). +See also [`rol!`](@ref). ```jldoctest julia> A = BitArray([true, true, false, false, true]) @@ -1701,7 +1701,7 @@ ror!(B::BitVector, i::Integer) = ror!(B, B, i) Performs a right rotation operation on `B`, returning a new `BitVector`. `i` controls how far to rotate the bits. -See also [`ror!`](:func:`ror!`). +See also [`ror!`](@ref). ```jldoctest julia> A = BitArray([true, true, false, false, true]) diff --git a/base/broadcast.jl b/base/broadcast.jl index 585bbf3ba2a56..fa09ac08c46e8 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -183,7 +183,7 @@ end """ broadcast!(f, dest, As...) -Like [`broadcast`](:func:`broadcast`), but store the result of +Like [`broadcast`](@ref), but store the result of `broadcast(f, As...)` in the `dest` array. Note that `dest` is only used to store the result, and does not supply arguments to `f` unless it is also listed in the `As`, @@ -356,7 +356,7 @@ julia> string.(("one","two","three","four"), ": ", 1:4) """ bitbroadcast(f, As...) -Like [`broadcast`](:func:`broadcast`), but allocates a `BitArray` to store the +Like [`broadcast`](@ref), but allocates a `BitArray` to store the result, rather then an `Array`. ```jldoctest @@ -374,7 +374,7 @@ julia> bitbroadcast(isodd,[1,2,3,4,5]) """ broadcast_getindex(A, inds...) -Broadcasts the `inds` arrays to a common size like [`broadcast`](:func:`broadcast`) +Broadcasts the `inds` arrays to a common size like [`broadcast`](@ref) and returns an array of the results `A[ks...]`, where `ks` goes over the positions in the broadcast result `A`. diff --git a/base/channels.jl b/base/channels.jl index 1df560a486963..f272052141be5 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -7,7 +7,7 @@ abstract AbstractChannel Constructs a `Channel` with an internal buffer that can hold a maximum of `sz` objects of type `T`. -[`put!`](:func:`put!`) calls on a full channel block until an object is removed with [`take!`](:func:`take!`). +[`put!`](@ref) calls on a full channel block until an object is removed with [`take!`](@ref). `Channel(0)` constructs an unbuffered channel. `put!` blocks until a matching `take!` is called. And vice-versa. @@ -65,8 +65,8 @@ isbuffered(c::Channel) = c.sz_max==0 ? false : true Closes a channel. An exception is thrown by: -* [`put!`](:func:`put!`) on a closed channel. -* [`take!`](:func:`take!`) and [`fetch`](:func:`fetch`) on an empty, closed channel. +* [`put!`](@ref) on a closed channel. +* [`take!`](@ref) and [`fetch`](@ref) on an empty, closed channel. """ function close(c::Channel) c.state = :closed @@ -85,7 +85,7 @@ end Appends an item `v` to the channel `c`. Blocks if the channel is full. -For unbuffered channels, blocks until a [`take!`](:func:`take!`) is performed by a different +For unbuffered channels, blocks until a [`take!`](@ref) is performed by a different task. """ function put!(c::Channel, v) @@ -131,9 +131,9 @@ fetch_unbuffered(c::Channel) = throw(ErrorException("`fetch` is not supported on """ take!(c::Channel) -Removes and returns a value from a [`Channel`](:obj:`Channel`). Blocks until data is available. +Removes and returns a value from a [`Channel`](@ref). Blocks until data is available. -For unbuffered channels, blocks until a [`put!`](:func:`put!`) is performed by a different +For unbuffered channels, blocks until a [`put!`](@ref) is performed by a different task. """ take!(c::Channel) = isbuffered(c) ? take_buffered(c) : take_unbuffered(c) @@ -167,11 +167,11 @@ end """ isready(c::Channel) -Determine whether a [`Channel`](:obj:`Channel`) has a value stored to it. Returns +Determine whether a [`Channel`](@ref) has a value stored to it. Returns immediately, does not block. For unbuffered channels returns `true` if there are tasks waiting -on a [`put!`](:func:`put!`). +on a [`put!`](@ref). """ isready(c::Channel) = n_avail(c) > 0 n_avail(c::Channel) = isbuffered(c) ? length(c.data) : n_waiters(c.cond_put) diff --git a/base/collections.jl b/base/collections.jl index caeebf673fa86..43fd55f7f803c 100644 --- a/base/collections.jl +++ b/base/collections.jl @@ -111,7 +111,7 @@ end """ heapify!(v, ord::Ordering=Forward) -In-place [`heapify`](:func:`heapify`). +In-place [`heapify`](@ref). """ function heapify!(xs::AbstractArray, o::Ordering=Forward) for i in heapparent(length(xs)):-1:1 @@ -182,7 +182,7 @@ end """ PriorityQueue(K, V, [ord]) -Construct a new [`PriorityQueue`](:obj:`PriorityQueue`), with keys of type +Construct a new [`PriorityQueue`](@ref), with keys of type `K` and values/priorites of type `V`. If an order is not given, the priority queue is min-ordered using the default comparison for `V`. diff --git a/base/complex.jl b/base/complex.jl index 934b00538b363..be34002a3ca2e 100644 --- a/base/complex.jl +++ b/base/complex.jl @@ -831,8 +831,8 @@ end round(z, RoundingModeReal, RoundingModeImaginary) Returns the nearest integral value of the same type as the complex-valued `z` to `z`, -breaking ties using the specified [`RoundingMode`](:obj:`RoundingMode`)s. The first -[`RoundingMode`](:obj:`RoundingMode`) is used for rounding the real components while the +breaking ties using the specified [`RoundingMode`](@ref)s. The first +[`RoundingMode`](@ref) is used for rounding the real components while the second is used for rounding the imaginary components. """ function round{T<:AbstractFloat, MR, MI}(z::Complex{T}, ::RoundingMode{MR}, ::RoundingMode{MI}) diff --git a/base/datafmt.jl b/base/datafmt.jl index 9f4b63d5936df..47503f95a1a3c 100644 --- a/base/datafmt.jl +++ b/base/datafmt.jl @@ -703,7 +703,7 @@ end writedlm(f, A, delim='\\t'; opts) Write `A` (a vector, matrix, or an iterable collection of iterable rows) as text to `f` -(either a filename string or an [`IO`](:class:`IO`) stream) using the given delimiter +(either a filename string or an `IO` stream) using the given delimiter `delim` (which defaults to tab, but can be any printable Julia object, typically a `Char` or `AbstractString`). @@ -715,7 +715,7 @@ writedlm(io, a; opts...) = writedlm(io, a, '\t'; opts...) """ writecsv(filename, A; opts) -Equivalent to [`writedlm`](:func:`writedlm`) with `delim` set to comma. +Equivalent to [`writedlm`](@ref) with `delim` set to comma. """ writecsv(io, a; opts...) = writedlm(io, a, ','; opts...) diff --git a/base/dates/io.jl b/base/dates/io.jl index f482502eafe50..4d70bdc9da189 100644 --- a/base/dates/io.jl +++ b/base/dates/io.jl @@ -88,8 +88,8 @@ duplicates(slots) = any(map(x->count(y->x.parser==y.parser,slots),slots) .> 1) Construct a date formatting object that can be used for parsing date strings or formatting a date object as a string. For details on the syntax for `format` see -[`DateTime(::AbstractString, ::AbstractString)`](:ref:`parsing `) and -[`format`](:ref:`formatting `). +[`DateTime(::AbstractString, ::AbstractString)`](@ref) and +[`format`](@ref). """ function DateFormat(f::AbstractString, locale::AbstractString="english") slots = Slot[] @@ -261,7 +261,7 @@ DateTime(dt::AbstractString,format::AbstractString;locale::AbstractString="engli DateTime(dt::AbstractString, df::DateFormat) -> DateTime Construct a `DateTime` by parsing the `dt` date string following the pattern given in -the [`DateFormat`](:func:`Dates.DateFormat`) object. Similar to +the [`DateFormat`](@ref) object. Similar to `DateTime(::AbstractString, ::AbstractString)` but more efficient when repeatedly parsing similarly formatted date strings with a pre-created `DateFormat` object. """ diff --git a/base/dates/periods.jl b/base/dates/periods.jl index 98a2efbd1c6f3..def492fc65e26 100644 --- a/base/dates/periods.jl +++ b/base/dates/periods.jl @@ -18,7 +18,7 @@ for period in (:Year, :Month, :Week, :Day, :Hour, :Minute, :Second, :Millisecond # Period accessors typ_str = period in (:Hour, :Minute, :Second, :Millisecond) ? "DateTime" : "TimeType" description = typ_str == "TimeType" ? "`Date` or `DateTime`" : "`$typ_str`" - reference = period == :Week ? " For details see [`$accessor_str(::$typ_str)`](:func:`$accessor_str`)." : "" + reference = period == :Week ? " For details see [`$accessor_str(::$typ_str)`](@ref)." : "" @eval begin @doc """ $($period_str)(dt::$($typ_str)) -> $($period_str) diff --git a/base/dft.jl b/base/dft.jl index f1072d2ae99e6..9116ef9754ee7 100644 --- a/base/dft.jl +++ b/base/dft.jl @@ -62,30 +62,30 @@ end """ plan_ifft(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Same as [`plan_fft`](:func:`plan_fft`), but produces a plan that performs inverse transforms -[`ifft`](:func:`ifft`). +Same as [`plan_fft`](@ref), but produces a plan that performs inverse transforms +[`ifft`](@ref). """ plan_ifft """ plan_ifft!(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Same as [`plan_ifft`](:func:`plan_ifft`), but operates in-place on `A`. +Same as [`plan_ifft`](@ref), but operates in-place on `A`. """ plan_ifft! """ plan_bfft!(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Same as [`plan_bfft`](:func:`plan_bfft`), but operates in-place on `A`. +Same as [`plan_bfft`](@ref), but operates in-place on `A`. """ plan_bfft! """ plan_bfft(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Same as [`plan_fft`](:func:`plan_fft`), but produces a plan that performs an unnormalized -backwards transform [`bfft`](:func:`bfft`). +Same as [`plan_fft`](@ref), but produces a plan that performs an unnormalized +backwards transform [`bfft`](@ref). """ plan_bfft @@ -93,7 +93,7 @@ plan_bfft plan_fft(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) Pre-plan an optimized FFT along given dimensions (`dims`) of arrays matching the shape and -type of `A`. (The first two arguments have the same meaning as for [`fft`](:func:`fft`).) +type of `A`. (The first two arguments have the same meaning as for [`fft`](@ref).) Returns an object `P` which represents the linear operator computed by the FFT, and which contains all of the information needed to compute `fft(A, dims)` quickly. @@ -114,17 +114,17 @@ rough upper bound on the allowed planning time, in seconds. Passing `FFTW.MEASUR `FFTW.PATIENT` may cause the input array `A` to be overwritten with zeros during plan creation. -[`plan_fft!`](:func:`plan_fft!`) is the same as [`plan_fft`](:func:`plan_fft`) but creates a +[`plan_fft!`](@ref) is the same as [`plan_fft`](@ref) but creates a plan that operates in-place on its argument (which must be an array of complex -floating-point numbers). [`plan_ifft`](:func:`plan_ifft`) and so on are similar but produce -plans that perform the equivalent of the inverse transforms [`ifft`](:func:`ifft`) and so on. +floating-point numbers). [`plan_ifft`](@ref) and so on are similar but produce +plans that perform the equivalent of the inverse transforms [`ifft`](@ref) and so on. """ plan_fft """ plan_fft!(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Same as [`plan_fft`](:func:`plan_fft`), but operates in-place on `A`. +Same as [`plan_fft`](@ref), but operates in-place on `A`. """ plan_fft! @@ -133,11 +133,11 @@ plan_fft! Multidimensional FFT of a real array `A`, exploiting the fact that the transform has conjugate symmetry in order to save roughly half the computational time and storage costs -compared with [`fft`](:func:`fft`). If `A` has size `(n_1, ..., n_d)`, the result has size +compared with [`fft`](@ref). If `A` has size `(n_1, ..., n_d)`, the result has size `(div(n_1,2)+1, ..., n_d)`. The optional `dims` argument specifies an iterable subset of one or more dimensions of `A` -to transform, similar to [`fft`](:func:`fft`). Instead of (roughly) halving the first +to transform, similar to [`fft`](@ref). Instead of (roughly) halving the first dimension of `A` in the result, the `dims[1]` dimension is (roughly) halved in the same way. """ rfft @@ -145,7 +145,7 @@ rfft """ ifft!(A [, dims]) -Same as [`ifft`](:func:`ifft`), but operates in-place on `A`. +Same as [`ifft`](@ref), but operates in-place on `A`. """ ifft! @@ -169,7 +169,7 @@ ifft """ fft!(A [, dims]) -Same as [`fft`](:func:`fft`), but operates in-place on `A`, which must be an array of +Same as [`fft`](@ref), but operates in-place on `A`, which must be an array of complex floating-point numbers. """ fft! @@ -177,9 +177,9 @@ fft! """ bfft(A [, dims]) -Similar to [`ifft`](:func:`ifft`), but computes an unnormalized inverse (backward) +Similar to [`ifft`](@ref), but computes an unnormalized inverse (backward) transform, which must be divided by the product of the sizes of the transformed dimensions -in order to obtain the inverse. (This is slightly more efficient than [`ifft`](:func:`ifft`) +in order to obtain the inverse. (This is slightly more efficient than [`ifft`](@ref) because it omits a scaling step, which in some applications can be combined with other computational steps elsewhere.) @@ -192,7 +192,7 @@ bfft """ bfft!(A [, dims]) -Same as [`bfft`](:func:`bfft`), but operates in-place on `A`. +Same as [`bfft`](@ref), but operates in-place on `A`. """ bfft! @@ -302,8 +302,8 @@ end """ irfft(A, d [, dims]) -Inverse of [`rfft`](:func:`rfft`): for a complex array `A`, gives the corresponding real -array whose FFT yields `A` in the first half. As for [`rfft`](:func:`rfft`), `dims` is an +Inverse of [`rfft`](@ref): for a complex array `A`, gives the corresponding real +array whose FFT yields `A` in the first half. As for [`rfft`](@ref), `dims` is an optional subset of dimensions to transform, defaulting to `1:ndims(A)`. `d` is the length of the transformed real array along the `dims[1]` dimension, which must @@ -316,8 +316,8 @@ irfft """ brfft(A, d [, dims]) -Similar to [`irfft`](:func:`irfft`) but computes an unnormalized inverse transform (similar -to [`bfft`](:func:`bfft`)), which must be divided by the product of the sizes of the +Similar to [`irfft`](@ref) but computes an unnormalized inverse transform (similar +to [`bfft`](@ref)), which must be divided by the product of the sizes of the transformed dimensions (of the real output array) in order to obtain the inverse transform. """ brfft @@ -344,9 +344,9 @@ plan_irfft{T}(x::AbstractArray{Complex{T}}, d::Integer, region; kws...) = """ plan_irfft(A, d [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Pre-plan an optimized inverse real-input FFT, similar to [`plan_rfft`](:func:`plan_rfft`) -except for [`irfft`](:func:`irfft`) and [`brfft`](:func:`brfft`), respectively. The first -three arguments have the same meaning as for [`irfft`](:func:`irfft`). +Pre-plan an optimized inverse real-input FFT, similar to [`plan_rfft`](@ref) +except for [`irfft`](@ref) and [`brfft`](@ref), respectively. The first +three arguments have the same meaning as for [`irfft`](@ref). """ plan_irfft @@ -423,7 +423,7 @@ if Base.USE_GPL_LIBS * This performs a multidimensional FFT by default. FFT libraries in other languages such as Python and Octave perform a one-dimensional FFT along the first non-singleton dimension of the array. This is worth noting while performing comparisons. For more details, - refer to the ["Noteworthy Differences from other Languages"](:ref:`man-noteworthy-differences`) + refer to the [Noteworthy Differences from other Languages](@ref) section of the manual. """ -> fft diff --git a/base/dict.jl b/base/dict.jl index 92a27d59bcbed..5950b8adb3aaa 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -70,7 +70,7 @@ _tablesz(x::Integer) = x < 16 ? 16 : one(x)<<((sizeof(x)<<3)-leading_zeros(x-1)) `Dict{K,V}()` constructs a hash table with keys of type `K` and values of type `V`. -Given a single iterable argument, constructs a [`Dict`](:obj:`Dict`) whose key-value pairs +Given a single iterable argument, constructs a [`Dict`](@ref) whose key-value pairs are taken from 2-tuples `(key,value)` generated by the argument. ```jldoctest diff --git a/base/docs/helpdb/Base.jl b/base/docs/helpdb/Base.jl index f6a35a9a14614..93c39ad3177e7 100644 --- a/base/docs/helpdb/Base.jl +++ b/base/docs/helpdb/Base.jl @@ -122,7 +122,7 @@ minabs! """ eigfact!(A, [B]) -Same as [`eigfact`](:func:`eigfact`), but saves space by overwriting the input `A` (and +Same as [`eigfact`](@ref), but saves space by overwriting the input `A` (and `B`), instead of creating a copy. """ eigfact! @@ -217,7 +217,7 @@ getindex(::Type, elements...) Returns a subset of array `A` as specified by `inds`, where each `ind` may be an `Int`, a `Range`, or a `Vector`. See the manual section on -[array indexing](:ref:`array indexing `) for details. +[array indexing](@ref man-array-indexing) for details. ```jldoctest julia> A = [1 2; 3 4] @@ -265,9 +265,9 @@ getindex(collection, key...) Convert `x` to a value of type `T`, typically by calling `convert(T,x)` -In cases where `x` cannot be safely converted to `T`, unlike [`convert`](:func:`convert`), `cconvert` may +In cases where `x` cannot be safely converted to `T`, unlike [`convert`](@ref), `cconvert` may return an object of a type different from `T`, which however is suitable for -[`unsafe_convert`](:func:`unsafe_convert`) to handle. +[`unsafe_convert`](@ref) to handle. Neither `convert` nor `cconvert` should take a Julia object and turn it into a `Ptr`. """ @@ -276,7 +276,7 @@ cconvert """ assert(cond) -Throw an [`AssertionError`](:obj:`AssertionError`) if `cond` is `false`. +Throw an [`AssertionError`](@ref) if `cond` is `false`. Also available as the macro `@assert expr`. """ assert @@ -346,7 +346,7 @@ julia> Float32(1/3, RoundUp) 0.33333334f0 ``` -See [`RoundingMode`](:obj:`RoundingMode`) for available rounding modes. +See [`RoundingMode`](@ref) for available rounding modes. """ Float32 @@ -414,7 +414,7 @@ Mmap.mmap(io, ::Type, dims, offset) Mmap.mmap(io, BitArray, [dims, offset]) Create a `BitArray` whose values are linked to a file, using memory-mapping; it has the same -purpose, works in the same way, and has the same arguments, as [`mmap`](:func:`mmap`), but +purpose, works in the same way, and has the same arguments, as [`mmap`](@ref Mmap.mmap), but the byte representation is different. **Example**: `B = Mmap.mmap(s, BitArray, (25,30000))` @@ -491,8 +491,8 @@ ReadOnlyMemoryError last(coll) Get the last element of an ordered collection, if it can be computed in O(1) time. This is -accomplished by calling [`endof`](:func:`endof`) to get the last index. Returns the end -point of a [`Range`](:obj:`Range`) even if it is empty. +accomplished by calling [`endof`](@ref) to get the last index. Returns the end +point of a `Range` even if it is empty. ```jldoctest julia> last(1:2:10) @@ -520,7 +520,7 @@ equal to `x`. `ceil(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is not representable. -`digits` and `base` work as for [`round`](:func:`round`). +`digits` and `base` work as for [`round`](@ref). """ ceil @@ -569,7 +569,7 @@ julia> push!([1, 2, 3], 4, 5, 6) 6 ``` -Use [`append!`](:func:`append!`) to add all the elements of another collection to +Use [`append!`](@ref) to add all the elements of another collection to `collection`. The result of the preceding example is equivalent to `append!([1, 2, 3], [4, 5, 6])`. """ @@ -674,7 +674,7 @@ reshape """ randsubseq!(S, A, p) -Like [`randsubseq`](:func:`randsubseq`), but the results are stored in `S` +Like [`randsubseq`](@ref), but the results are stored in `S` (which is resized as needed). """ randsubseq! @@ -683,7 +683,7 @@ randsubseq! maximum(A, dims) Compute the maximum value of an array over the given dimensions. See also the -[`max(a,b)`](:func:`max`) function to take the maximum of two or more arguments, +[`max(a,b)`](@ref) function to take the maximum of two or more arguments, which can be applied elementwise to arrays via `max.(a,b)`. """ maximum(A,dims) @@ -694,7 +694,7 @@ maximum(A,dims) redisplay(mime, x) redisplay(d::Display, mime, x) -By default, the `redisplay` functions simply call [`display`](:func:`display`). +By default, the `redisplay` functions simply call [`display`](@ref). However, some display backends may override `redisplay` to modify an existing display of `x` (if any). Using `redisplay` is also a hint to the backend that `x` may be redisplayed @@ -771,7 +771,7 @@ sum! display(d::Display, mime, x) Display `x` using the topmost applicable display in the display stack, typically using the -richest supported multimedia output for `x`, with plain-text [`STDOUT`](:obj:`STDOUT`) output as a fallback. +richest supported multimedia output for `x`, with plain-text [`STDOUT`](@ref) output as a fallback. The `display(d, x)` variant attempts to display `x` on the given display `d` only, throwing a `MethodError` if `d` cannot display objects of this type. @@ -788,7 +788,7 @@ display @spawnat Accepts two arguments, `p` and an expression. A closure is created around the expression and -run asynchronously on process `p`. Returns a [`Future`](:obj:`Future`) to the result. +run asynchronously on process `p`. Returns a [`Future`](@ref) to the result. """ :@spawnat @@ -820,7 +820,7 @@ eachmatch log10(x) Compute the logarithm of `x` to base 10. -Throws [`DomainError`](:obj:`DomainError`) for negative `Real` arguments. +Throws [`DomainError`](@ref) for negative `Real` arguments. ```jldoctest julia> log10(100) @@ -931,7 +931,7 @@ equal to `x`. `floor(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is not representable. -`digits` and `base` work as for [`round`](:func:`round`). +`digits` and `base` work as for [`round`](@ref). """ floor @@ -952,7 +952,7 @@ reverse """ reverse!(v [, start=1 [, stop=length(v) ]]) -> v -In-place version of [`reverse`](:func:`reverse`). +In-place version of [`reverse`](@ref). """ reverse! @@ -1009,7 +1009,7 @@ julia> append!([1, 2, 3], [4, 5, 6]) 6 ``` -Use [`push!`](:func:`push!`) to add individual items to `collection` which are not already +Use [`push!`](@ref) to add individual items to `collection` which are not already themselves in another collection. The result is of the preceding example is equivalent to `push!([1, 2, 3], 4, 5, 6)`. """ @@ -1132,7 +1132,7 @@ prod(A, dims) """ log1p(x) -Accurate natural logarithm of `1+x`. Throws [`DomainError`](:obj:`DomainError`) for `Real` arguments less than -1. +Accurate natural logarithm of `1+x`. Throws [`DomainError`](@ref) for `Real` arguments less than -1. There is an experimental variant in the `Base.Math.JuliaLibm` module, which is typically faster and more accurate. @@ -1151,7 +1151,7 @@ flipsign Create a random ASCII string of length `len`, consisting of upper- and lower-case letters and the digits 0-9. The optional `rng` argument -specifies a random number generator, see [Random Numbers](:ref:`Random Numbers `). +specifies a random number generator, see [Random Numbers](@ref). """ randstring @@ -1169,7 +1169,7 @@ julia> Float64(pi, RoundUp) 3.1415926535897936 ``` -See [`RoundingMode`](:obj:`RoundingMode`) for available rounding modes. +See [`RoundingMode`](@ref) for available rounding modes. """ Float64 @@ -1192,7 +1192,7 @@ realmax serialize(stream, value) Write an arbitrary value to a stream in an opaque format, such that it can be read back by -[`deserialize`](:func:`deserialize`). The read-back value will be as identical as possible to the original. In +[`deserialize`](@ref). The read-back value will be as identical as possible to the original. In general, this process will not work if the reading and writing are done by different versions of Julia, or an instance of Julia with a different system image. `Ptr` values are serialized as all-zero bit patterns (`NULL`). @@ -1239,7 +1239,7 @@ typeof """ log(x) -Compute the natural logarithm of `x`. Throws [`DomainError`](:obj:`DomainError`) for negative `Real` arguments. +Compute the natural logarithm of `x`. Throws [`DomainError`](@ref) for negative `Real` arguments. Use complex negative arguments to obtain complex results. There is an experimental variant in the `Base.Math.JuliaLibm` module, which is typically @@ -1256,7 +1256,7 @@ is less than or equal to `x`. `trunc(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is not representable. -`digits` and `base` work as for [`round`](:func:`round`). +`digits` and `base` work as for [`round`](@ref). """ trunc @@ -1265,7 +1265,7 @@ trunc Convert `x` to a value of type `T` -In cases where [`convert`](:func:`convert`) would need to take a Julia object +In cases where [`convert`](@ref) would need to take a Julia object and turn it into a `Ptr`, this function should be used to define and perform that conversion. @@ -1329,10 +1329,10 @@ popdisplay cglobal((symbol, library) [, type=Void]) Obtain a pointer to a global variable in a C-exported shared library, specified exactly as -in [`ccall`](:func:`ccall`). +in [`ccall`](@ref). Returns a `Ptr{Type}`, defaulting to `Ptr{Void}` if no `Type` argument is supplied. -The values can be read or written by [`unsafe_load`](:func:`unsafe_load`) or [`unsafe_store!`](:func:`unsafe_store!`), +The values can be read or written by [`unsafe_load`](@ref) or [`unsafe_store!`](@ref), respectively. """ cglobal @@ -1367,7 +1367,7 @@ next """ log2(x) -Compute the logarithm of `x` to base 2. Throws [`DomainError`](:obj:`DomainError`) for negative `Real` arguments. +Compute the logarithm of `x` to base 2. Throws [`DomainError`](@ref) for negative `Real` arguments. ```jldoctest julia> log2(4) @@ -1596,7 +1596,7 @@ searchsortedfirst big(x) Convert a number to a maximum precision representation (typically `BigInt` or `BigFloat`). -See [`BigFloat`](:obj:`BigFloat`) for information about some pitfalls with floating-point numbers. +See [`BigFloat`](@ref) for information about some pitfalls with floating-point numbers. """ big @@ -1604,7 +1604,7 @@ big quit() Quit the program indicating that the processes completed successfully. This function calls -`exit(0)` (see [`exit`](:func:`exit`)). +`exit(0)` (see [`exit`](@ref)). """ quit @@ -1648,7 +1648,7 @@ asinh minimum(A, dims) Compute the minimum value of an array over the given dimensions. See also the -[`min(a,b)`](:func:`min`) function to take the minimum of two or more arguments, +[`min(a,b)`](@ref) function to take the minimum of two or more arguments, which can be applied elementwise to arrays via `min.(a,b)`. ```jldoctest @@ -1688,7 +1688,7 @@ get(collection,key,default) get(f::Function, collection, key) Return the value stored for the given key, or if no mapping for the key is present, return -`f()`. Use [`get!`](:func:`get!`) to also store the default value in the dictionary. +`f()`. Use [`get!`](@ref) to also store the default value in the dictionary. This is intended to be called using `do` block syntax @@ -1775,7 +1775,7 @@ shift! """ spawn(command) -Run a command object asynchronously, returning the resulting [`Process`](:obj:`Process`) object. +Run a command object asynchronously, returning the resulting `Process` object. """ spawn @@ -1802,18 +1802,18 @@ cotd Block the current task until some event occurs, depending on the type of the argument: -* [`RemoteChannel`](:obj:`RemoteChannel`) : Wait for a value to become available on the specified remote channel. -* [`Future`](:obj:`Future`) : Wait for a value to become available for the specified future. -* [`Channel`](:obj:`Channel`): Wait for a value to be appended to the channel. -* [`Condition`](:obj:`Condition`): Wait for [`notify`](:func:`notify`) on a condition. -* [`Process`](:obj:`Process`): Wait for a process or process chain to exit. The `exitcode` field of a process +* [`RemoteChannel`](@ref) : Wait for a value to become available on the specified remote channel. +* [`Future`](@ref) : Wait for a value to become available for the specified future. +* [`Channel`](@ref): Wait for a value to be appended to the channel. +* [`Condition`](@ref): Wait for [`notify`](@ref) on a condition. +* `Process`: Wait for a process or process chain to exit. The `exitcode` field of a process can be used to determine success or failure. -* [`Task`](:obj:`Task`): Wait for a `Task` to finish, returning its result value. If the task fails with an +* [`Task`](@ref): Wait for a `Task` to finish, returning its result value. If the task fails with an exception, the exception is propagated (re-thrown in the task that called `wait`). -* [`RawFD`](:obj:`RawFD`): Wait for changes on a file descriptor (see [`poll_fd`](:func:`poll_fd`) for keyword arguments and return code) +* `RawFD`: Wait for changes on a file descriptor (see [`poll_fd`](@ref) for keyword arguments and return code) If no argument is passed, the task blocks for an undefined period. A task can only be -restarted by an explicit call to [`schedule`](:func:`schedule`) or [`yieldto`](:func:`yieldto`). +restarted by an explicit call to [`schedule`](@ref) or [`yieldto`](@ref). Often `wait` is called within a `while` loop to ensure a waited-for condition is met before proceeding. """ @@ -1923,7 +1923,7 @@ acosh Construct a sorted set of positive `Int`s generated by the given iterable object, or an empty set. Implemented as a bit string, and therefore designed for dense integer sets. Only `Int`s greater than 0 can be stored. If the set will be sparse (for example holding a few -very large integers), use [`Set`](:obj:`Set`) instead. +very large integers), use [`Set`](@ref) instead. """ IntSet @@ -1975,7 +1975,7 @@ Create an arbitrary precision integer. `x` may be an `Int` (or anything that can converted to an `Int`). The usual mathematical operators are defined for this type, and results are promoted to a `BigInt`. -Instances can be constructed from strings via [`parse`](:func:`parse`), or using the `big` +Instances can be constructed from strings via [`parse`](@ref), or using the `big` string literal. """ BigInt @@ -2037,8 +2037,8 @@ Technically, the `MIME"mime"` macro defines a singleton type for the given `mime which allows us to exploit Julia's dispatch mechanisms in determining how to display objects of any given type. -The first argument to `show` can be an [`IOContext`](:obj:`IOContext`) specifying output format properties. -See [`IOContext`](:obj:`IOContext`) for details. +The first argument to `show` can be an [`IOContext`](@ref) specifying output format properties. +See [`IOContext`](@ref) for details. """ show(stream, mime, x) @@ -2084,7 +2084,7 @@ error """ readcsv(source, [T::Type]; options...) -Equivalent to [`readdlm`](:func:`readdlm`) with `delim` set to comma, and type optionally defined by `T`. +Equivalent to [`readdlm`](@ref) with `delim` set to comma, and type optionally defined by `T`. """ readcsv @@ -2346,7 +2346,7 @@ julia> C .\\ D [1.0,0.0] ``` -See also [`broadcast`](:func:`broadcast`). +See also [`broadcast`](@ref). """ Base.:(.\)(x,y) @@ -2383,7 +2383,7 @@ exp """ matchall(r::Regex, s::AbstractString[, overlap::Bool=false]) -> Vector{AbstractString} -Return a vector of the matching substrings from [`eachmatch`](:func:`eachmatch`). +Return a vector of the matching substrings from [`eachmatch`](@ref). """ matchall @@ -2421,8 +2421,8 @@ Message `text` is optionally displayed upon assertion failure. """ deserialize(stream) -Read a value written by [`serialize`](:func:`serialize`). `deserialize` assumes the binary data read from -`stream` is correct and has been serialized by a compatible implementation of [`serialize`](:func:`serialize`). +Read a value written by [`serialize`](@ref). `deserialize` assumes the binary data read from +`stream` is correct and has been serialized by a compatible implementation of [`serialize`](@ref). It has been designed with simplicity and performance as a goal and does not validate the data read. Malformed data can result in process termination. The caller has to ensure the integrity and correctness of data read from `stream`. @@ -2433,7 +2433,7 @@ deserialize first(coll) Get the first element of an iterable collection. Returns the start point of a -[`Range`](:obj:`Range`) even if it is empty. +`Range` even if it is empty. ```jldoctest julia> first(2:2:10) @@ -2448,7 +2448,7 @@ first """ median!(v) -Like [`median`](:func:`median`), but may overwrite the input vector. +Like [`median`](@ref), but may overwrite the input vector. """ median! @@ -2528,7 +2528,7 @@ issubnormal """ NullException() -An attempted access to a [`Nullable`](:obj:`Nullable`) with no defined value. +An attempted access to a [`Nullable`](@ref) with no defined value. """ NullException @@ -2577,14 +2577,14 @@ intersect @spawn Creates a closure around an expression and runs it on an automatically-chosen process, -returning a [`Future`](:obj:`Future`) to the result. +returning a [`Future`](@ref) to the result. """ :@spawn """ promote_rule(type1, type2) -Specifies what type should be used by [`promote`](:func:`promote`) when given values of types `type1` and +Specifies what type should be used by [`promote`](@ref) when given values of types `type1` and `type2`. This function should not be called directly, but should have definitions added to it for new types as appropriate. """ @@ -2600,7 +2600,7 @@ sumabs2(A,dims) """ showall(x) -Similar to [`show`](:func:`show`), except shows all elements of arrays. +Similar to [`show`](@ref), except shows all elements of arrays. """ showall @@ -2676,7 +2676,7 @@ done Convert `x` to a value of type `T`. -If `T` is an `Integer` type, an [`InexactError`](:exc:`InexactError`) will be raised if `x` +If `T` is an `Integer` type, an [`InexactError`](@ref) will be raised if `x` is not representable by `T`, for example if `x` is not integer-valued, or is outside the range supported by `T`. @@ -2690,7 +2690,7 @@ ERROR: InexactError() ... ``` -If `T` is a [`AbstractFloat`](:obj:`AbstractFloat`) or [`Rational`](:obj:`Rational`) type, +If `T` is a `AbstractFloat` or `Rational` type, then it will return the closest value to `x` representable by `T`. ```jldoctest @@ -2765,7 +2765,7 @@ applicable Computes `x*y+z` without rounding the intermediate result `x*y`. On some systems this is significantly more expensive than `x*y+z`. `fma` is used to improve accuracy in certain -algorithms. See [`muladd`](:func:`muladd`). +algorithms. See [`muladd`](@ref). """ fma @@ -2826,7 +2826,7 @@ setindex!(collection,value,key...) """ signif(x, digits, [base]) -Rounds (in the sense of [`round`](:func:`round`)) `x` so that there are `digits` significant digits, under a +Rounds (in the sense of [`round`](@ref)) `x` so that there are `digits` significant digits, under a base `base` representation, default 10. E.g., `signif(123.456, 2)` is `120.0`, and `signif(357.913, 4, 2)` is `352.0`. """ @@ -2852,7 +2852,7 @@ throw ⊈(a,b) -> Bool ⊊(a,b) -> Bool -Determine whether every element of `a` is also in `b`, using [`in`](:func:`in`). +Determine whether every element of `a` is also in `b`, using [`in`](@ref). """ issubset(a,b) @@ -2973,7 +2973,7 @@ julia> C .+ [[1; 2] [3; 4]] [7 8; 9 10] [9 10; 11 12] ``` -See also [`broadcast`](:func:`broadcast`). +See also [`broadcast`](@ref). """ Base.:(.+) @@ -3017,7 +3017,7 @@ cscd """ tryparse(type, str, [base]) -Like [`parse`](:func:`parse`), but returns a [`Nullable`](:obj:`Nullable`) of the requested type. The result will be null if the +Like [`parse`](@ref), but returns a [`Nullable`](@ref) of the requested type. The result will be null if the string does not contain a valid number. """ tryparse @@ -3102,8 +3102,8 @@ widen """ Set([itr]) -Construct a [`Set`](:obj:`Set`) of the values generated by the given iterable object, or an -empty set. Should be used instead of [`IntSet`](:obj:`IntSet`) for sparse integer sets, or +Construct a [`Set`](@ref) of the values generated by the given iterable object, or an +empty set. Should be used instead of [`IntSet`](@ref) for sparse integer sets, or for sets of arbitrary objects. """ Set diff --git a/base/dsp.jl b/base/dsp.jl index 8341e6fd0914e..f7a7bd02cff6a 100644 --- a/base/dsp.jl +++ b/base/dsp.jl @@ -25,7 +25,7 @@ end """ filt!(out, b, a, x, [si]) -Same as [`filt`](:func:`filt`) but writes the result into the `out` argument, which may +Same as [`filt`](@ref) but writes the result into the `out` argument, which may alias the input `x` to modify it in-place. """ function filt!{T,S,N}(out::AbstractArray, b::Union{AbstractVector, Number}, a::Union{AbstractVector, Number}, diff --git a/base/essentials.jl b/base/essentials.jl index 4737917681664..8bd8d17ad6aaa 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -146,7 +146,7 @@ end esc(e::ANY) Only valid in the context of an `Expr` returned from a macro. Prevents the macro hygiene -pass from turning embedded variables into gensym variables. See the [macro](:ref:`man-macros`) +pass from turning embedded variables into gensym variables. See the [Macros](@ref man-macros) section of the Metaprogramming chapter of the manual for more details and examples. """ esc(e::ANY) = Expr(:escape, e) diff --git a/base/event.jl b/base/event.jl index 200eae56eea3d..8c153f387409e 100644 --- a/base/event.jl +++ b/base/event.jl @@ -5,11 +5,11 @@ """ Condition() -Create an edge-triggered event source that tasks can wait for. Tasks that call [`wait`](:func:`wait`) on a -`Condition` are suspended and queued. Tasks are woken up when [`notify`](:func:`notify`) is later called on -the `Condition`. Edge triggering means that only tasks waiting at the time [`notify`](:func:`notify`) is +Create an edge-triggered event source that tasks can wait for. Tasks that call [`wait`](@ref) on a +`Condition` are suspended and queued. Tasks are woken up when [`notify`](@ref) is later called on +the `Condition`. Edge triggering means that only tasks waiting at the time [`notify`](@ref) is called can be woken up. For level-triggered notifications, you must keep extra state to keep -track of whether a notification has happened. The [`Channel`](:class:`Channel`) type does +track of whether a notification has happened. The [`Channel`](@ref) type does this, and so can be used for level-triggered events. """ type Condition @@ -60,7 +60,7 @@ n_waiters(c::Condition) = length(c.waitq) """ @schedule -Wrap an expression in a [`Task`](:obj:`Task`) and add it to the local machine's scheduler queue. +Wrap an expression in a [`Task`](@ref) and add it to the local machine's scheduler queue. """ macro schedule(expr) expr = :(()->($expr)) @@ -84,11 +84,11 @@ schedule(t::Task) = enq_work(t) """ schedule(t::Task, [val]; error=false) -Add a [`Task`](:obj:`Task`) to the scheduler's queue. This causes the task to run constantly when the system -is otherwise idle, unless the task performs a blocking operation such as [`wait`](:func:`wait`). +Add a [`Task`](@ref) to the scheduler's queue. This causes the task to run constantly when the system +is otherwise idle, unless the task performs a blocking operation such as [`wait`](@ref). If a second argument `val` is provided, it will be passed to the task (via the return value of -[`yieldto`](:func:`yieldto`)) when it runs again. If `error` is `true`, the value is raised as an exception in +[`yieldto`](@ref)) when it runs again. If `error` is `true`, the value is raised as an exception in the woken task. ```jldoctest @@ -223,10 +223,10 @@ end AsyncCondition() Create a async condition that wakes up tasks waiting for it -(by calling [`wait`](:func:`wait`) on the object) +(by calling [`wait`](@ref) on the object) when notified from C by a call to `uv_async_send`. -Waiting tasks are woken with an error when the object is closed (by [`close`](:func:`close`). -Use [`isopen`](:func:`isopen`) to check whether it is still active. +Waiting tasks are woken with an error when the object is closed (by [`close`](@ref). +Use [`isopen`](@ref) to check whether it is still active. """ type AsyncCondition handle::Ptr{Void} @@ -297,9 +297,9 @@ end """ Timer(delay, repeat=0) -Create a timer that wakes up tasks waiting for it (by calling [`wait`](:func:`wait`) on the timer object) at +Create a timer that wakes up tasks waiting for it (by calling [`wait`](@ref) on the timer object) at a specified interval. Times are in seconds. Waiting tasks are woken with an error when the -timer is closed (by [`close`](:func:`close`). Use [`isopen`](:func:`isopen`) to check whether a timer is still active. +timer is closed (by [`close`](@ref). Use [`isopen`](@ref) to check whether a timer is still active. """ type Timer handle::Ptr{Void} @@ -387,7 +387,7 @@ Create a timer to call the given `callback` function. The `callback` is passed o the timer object itself. The callback will be invoked after the specified initial `delay`, and then repeating with the given `repeat` interval. If `repeat` is `0`, the timer is only triggered once. Times are in seconds. A timer is stopped and has its resources freed by -calling [`close`](:func:`close`) on it. +calling [`close`](@ref) on it. """ function Timer(cb::Function, timeout::Real, repeat::Real=0.0) t = Timer(timeout, repeat) diff --git a/base/expr.jl b/base/expr.jl index d094f01e069e2..f5b08279e5a12 100644 --- a/base/expr.jl +++ b/base/expr.jl @@ -50,7 +50,7 @@ copy_exprargs(x::Array{Any,1}) = Any[copy_exprs(a) for a in x] expand(x) Takes the expression `x` and returns an equivalent expression in lowered form. -See also [`code_lowered`](:func:`code_lowered`). +See also [`code_lowered`](@ref). """ expand(x::ANY) = ccall(:jl_expand, Any, (Any,), x) diff --git a/base/fft/FFTW.jl b/base/fft/FFTW.jl index fba05d2b3b3fa..ea885ce670c2e 100644 --- a/base/fft/FFTW.jl +++ b/base/fft/FFTW.jl @@ -715,9 +715,9 @@ end """ plan_rfft(A [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) -Pre-plan an optimized real-input FFT, similar to [`plan_fft`](:func:`plan_fft`) except for -[`rfft`](:func:`rfft`) instead of [`fft`](:func:`fft`). The first two arguments, and the -size of the transformed result, are the same as for [`rfft`](:func:`rfft`). +Pre-plan an optimized real-input FFT, similar to [`plan_fft`](@ref) except for +[`rfft`](@ref) instead of [`fft`](@ref). The first two arguments, and the +size of the transformed result, are the same as for [`rfft`](@ref). """ plan_rfft @@ -725,9 +725,9 @@ plan_rfft plan_brfft(A, d [, dims]; flags=FFTW.ESTIMATE; timelimit=Inf) Pre-plan an optimized real-input unnormalized transform, similar to -[`plan_rfft`](:func:`plan_rfft`) except for [`brfft`](:func:`brfft`) instead of -[`rfft`](:func:`rfft`). The first two arguments and the size of the transformed result, are -the same as for [`brfft`](:func:`brfft`). +[`plan_rfft`](@ref) except for [`brfft`](@ref) instead of +[`rfft`](@ref). The first two arguments and the size of the transformed result, are +the same as for [`brfft`](@ref). """ plan_brfft @@ -781,14 +781,14 @@ 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 [`plan_r2r`](:func:`plan_r2r`) to pre-plan optimized r2r transforms. +See also [`plan_r2r`](@ref) to pre-plan optimized r2r transforms. """ FFTW.r2r """ r2r!(A, kind [, dims]) -Same as [`r2r`](:func:`r2r`), but operates in-place on `A`, which must be +Same as [`r2r`](@ref), but operates in-place on `A`, which must be an array of real or complex floating-point numbers. """ FFTW.r2r! @@ -796,16 +796,16 @@ FFTW.r2r! """ plan_r2r!(A, kind [, dims [, flags [, timelimit]]]) -Similar to [`plan_fft`](:func:`Base.plan_fft`), but corresponds to [`r2r!`](:func:`r2r!`). +Similar to [`plan_fft`](@ref), but corresponds to [`r2r!`](@ref). """ FFTW.plan_r2r! """ plan_r2r(A, kind [, dims [, flags [, timelimit]]]) -Pre-plan an optimized r2r transform, similar to [`plan_fft`](:func:`Base.plan_fft`) +Pre-plan an optimized r2r transform, similar to [`plan_fft`](@ref) except that the transforms (and the first three arguments) -correspond to [`r2r`](:func:`r2r`) and [`r2r!`](:func:`r2r!`), respectively. +correspond to [`r2r`](@ref) and [`r2r!`](@ref), respectively. """ FFTW.plan_r2r diff --git a/base/fft/dct.jl b/base/fft/dct.jl index d3d955e44c2f5..00e8675ffac97 100644 --- a/base/fft/dct.jl +++ b/base/fft/dct.jl @@ -41,7 +41,7 @@ end """ plan_dct!(A [, dims [, flags [, timelimit]]]) -Same as [`plan_dct`](:func:`plan_dct`), but operates in-place on `A`. +Same as [`plan_dct`](@ref), but operates in-place on `A`. """ plan_dct! @@ -49,9 +49,9 @@ plan_dct! plan_idct(A [, dims [, flags [, timelimit]]]) Pre-plan an optimized inverse discrete cosine transform (DCT), similar to -[`plan_fft`](:func:`plan_fft`) except producing a function that computes -[`idct`](:func:`idct`). The first two arguments have the same meaning as for -[`idct`](:func:`idct`). +[`plan_fft`](@ref) except producing a function that computes +[`idct`](@ref). The first two arguments have the same meaning as for +[`idct`](@ref). """ plan_idct @@ -59,16 +59,16 @@ plan_idct plan_dct(A [, dims [, flags [, timelimit]]]) Pre-plan an optimized discrete cosine transform (DCT), similar to -[`plan_fft`](:func:`plan_fft`) except producing a function that computes -[`dct`](:func:`dct`). The first two arguments have the same meaning as for -[`dct`](:func:`dct`). +[`plan_fft`](@ref) except producing a function that computes +[`dct`](@ref). The first two arguments have the same meaning as for +[`dct`](@ref). """ plan_dct """ plan_idct!(A [, dims [, flags [, timelimit]]]) -Same as [`plan_idct`](:func:`plan_idct`), but operates in-place on `A`. +Same as [`plan_idct`](@ref), but operates in-place on `A`. """ plan_idct! @@ -100,7 +100,7 @@ Performs a multidimensional type-II discrete cosine transform (DCT) of the array 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 [`nextprod`](:func:`nextprod`). See also [`plan_dct`](:func:`plan_dct`) for even greater +see [`nextprod`](@ref). See also [`plan_dct`](@ref) for even greater efficiency. """ dct @@ -112,15 +112,15 @@ Computes the multidimensional inverse discrete cosine transform (DCT) of the arr (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 [`nextprod`](:func:`nextprod`). See also -[`plan_idct`](:func:`plan_idct`) for even greater efficiency. +product of small primes; see [`nextprod`](@ref). See also +[`plan_idct`](@ref) for even greater efficiency. """ idct """ dct!(A [, dims]) -Same as [`dct!`](:func:`dct!`), except that it operates in-place on `A`, which must be an +Same as [`dct!`](@ref), except that it operates in-place on `A`, which must be an array of real or complex floating-point values. """ dct! @@ -128,7 +128,7 @@ dct! """ idct!(A [, dims]) -Same as [`idct!`](:func:`idct!`), but operates in-place on `A`. +Same as [`idct!`](@ref), but operates in-place on `A`. """ idct! diff --git a/base/file.jl b/base/file.jl index bde6502dec787..1b00945b620d2 100644 --- a/base/file.jl +++ b/base/file.jl @@ -430,7 +430,7 @@ readdir() = readdir(".") The `walkdir` method returns an iterator that walks the directory tree of a directory. The iterator returns a tuple containing `(rootpath, dirs, files)`. The directory tree can be traversed top-down or bottom-up. -If `walkdir` encounters a [`SystemError`](:obj:`SystemError`) +If `walkdir` encounters a [`SystemError`](@ref) it will rethrow the error by default. A custom error handling function can be provided through `onerror` keyword argument. `onerror` is called with a `SystemError` as argument. diff --git a/base/floatfuncs.jl b/base/floatfuncs.jl index 24b998a2a22d3..492c3d5f25d36 100644 --- a/base/floatfuncs.jl +++ b/base/floatfuncs.jl @@ -42,10 +42,10 @@ end round([T,] x, [digits, [base]], [r::RoundingMode]) Rounds `x` to an integer value according to the provided -[`RoundingMode`](:obj:`RoundingMode`), returning a value of the same type as `x`. When not +[`RoundingMode`](@ref), returning a value of the same type as `x`. When not specifying a rounding mode the global mode will be used -(see [`rounding`](:func:`rounding`)), which by default is round to the nearest integer -([`RoundNearest`](:obj:`RoundNearest`) mode), with ties (fractional values of 0.5) being +(see [`rounding`](@ref)), which by default is round to the nearest integer +([`RoundNearest`](@ref) mode), with ties (fractional values of 0.5) being rounded to the nearest even integer. ```jldoctest @@ -59,11 +59,11 @@ julia> round(2.5) 2.0 ``` -The optional [`RoundingMode`](:obj:`RoundingMode`) argument will change how the number gets +The optional [`RoundingMode`](@ref) argument will change how the number gets rounded. `round(T, x, [r::RoundingMode])` converts the result to type `T`, throwing an -[`InexactError`](:exc:`InexactError`) if the value is not representable. +[`InexactError`](@ref) if the value is not representable. `round(x, digits)` rounds to the specified number of digits after the decimal place (or before if negative). `round(x, digits, base)` rounds using a base other than 10. diff --git a/base/initdefs.jl b/base/initdefs.jl index eee96cf5f2e9a..5c44c62f32f2e 100644 --- a/base/initdefs.jl +++ b/base/initdefs.jl @@ -7,7 +7,7 @@ A string containing the script name passed to Julia from the command line. Note that the script name remains unchanged from within included files. Alternatively see -[`@__FILE__`](:data:`@__FILE__`). +[`@__FILE__`](@ref). """ PROGRAM_FILE = "" diff --git a/base/interactiveutil.jl b/base/interactiveutil.jl index 3c59fefb8932b..1cc3bc35c10fd 100644 --- a/base/interactiveutil.jl +++ b/base/interactiveutil.jl @@ -315,7 +315,7 @@ and type signature to `io` which defaults to `STDOUT`. The ASTs are annotated in as to cause "non-leaf" types to be emphasized (if color is available, displayed in red). This serves as a warning of potential type instability. Not all non-leaf types are particularly problematic for performance, so the results need to be used judiciously. -See [Manual](:ref:`man-code-warntype`) for more information. +See [`@code_warntype`](@ref man-code-warntype) for more information. """ function code_warntype(io::IO, f, t::ANY) emph_io = IOContext(io, :TYPEEMPHASIZE => true) @@ -460,7 +460,7 @@ It calls out to the `functionloc` function. @code_typed Evaluates the arguments to the function or macro call, determines their types, and calls -[`code_typed`](:func:`code_typed`) on the resulting expression. +[`code_typed`](@ref) on the resulting expression. """ :@code_typed @@ -468,7 +468,7 @@ Evaluates the arguments to the function or macro call, determines their types, a @code_warntype Evaluates the arguments to the function or macro call, determines their types, and calls -[`code_warntype`](:func:`code_warntype`) on the resulting expression. +[`code_warntype`](@ref) on the resulting expression. """ :@code_warntype @@ -476,7 +476,7 @@ Evaluates the arguments to the function or macro call, determines their types, a @code_lowered Evaluates the arguments to the function or macro call, determines their types, and calls -[`code_lowered`](:func:`code_lowered`) on the resulting expression. +[`code_lowered`](@ref) on the resulting expression. """ :@code_lowered @@ -484,7 +484,7 @@ Evaluates the arguments to the function or macro call, determines their types, a @code_llvm Evaluates the arguments to the function or macro call, determines their types, and calls -[`code_llvm`](:func:`code_llvm`) on the resulting expression. +[`code_llvm`](@ref) on the resulting expression. """ :@code_llvm @@ -492,7 +492,7 @@ Evaluates the arguments to the function or macro call, determines their types, a @code_native Evaluates the arguments to the function or macro call, determines their types, and calls -[`code_native`](:func:`code_native`) on the resulting expression. +[`code_native`](@ref) on the resulting expression. """ :@code_native diff --git a/base/io.jl b/base/io.jl index 66705d8027507..1db1968ea09a9 100644 --- a/base/io.jl +++ b/base/io.jl @@ -14,15 +14,15 @@ buffer_writes(x::IO, bufsize=SZ_UNBUFFERED_IO) = nothing Determine whether an object - such as a stream, timer, or mmap -- is not yet closed. Once an object is closed, it will never produce a new event. However, a closed stream may still have -data to read in its buffer, use [`eof`](:func:`eof`) to check for the ability to read data. -Use [`poll_fd`](:func:`poll_fd`) to be notified when a stream might be writable or readable. +data to read in its buffer, use [`eof`](@ref) to check for the ability to read data. +Use [`poll_fd`](@ref) to be notified when a stream might be writable or readable. """ function isopen end """ close(stream) -Close an I/O stream. Performs a [`flush`](:func:`flush`) first. +Close an I/O stream. Performs a [`flush`](@ref) first. """ function close end function flush end @@ -555,7 +555,7 @@ iteratorsize(::Type{EachLine}) = SizeUnknown() Add a mark at the current position of stream `s`. Returns the marked position. -See also [`unmark`](:func:`unmark`), [`reset`](:func:`reset`), [`ismarked`](:func:`ismarked`). +See also [`unmark`](@ref), [`reset`](@ref), [`ismarked`](@ref). """ function mark(io::IO) io.mark = position(io) @@ -566,7 +566,7 @@ end Remove a mark from stream `s`. Returns `true` if the stream was marked, `false` otherwise. -See also [`mark`](:func:`mark`), [`reset`](:func:`reset`), [`ismarked`](:func:`ismarked`). +See also [`mark`](@ref), [`reset`](@ref), [`ismarked`](@ref). """ function unmark(io::IO) !ismarked(io) && return false @@ -580,7 +580,7 @@ end Reset a stream `s` to a previously marked position, and remove the mark. Returns the previously marked position. Throws an error if the stream is not marked. -See also [`mark`](:func:`mark`), [`unmark`](:func:`unmark`), [`ismarked`](:func:`ismarked`). +See also [`mark`](@ref), [`unmark`](@ref), [`ismarked`](@ref). """ function reset{T<:IO}(io::T) ismarked(io) || throw(ArgumentError("$(T) not marked")) @@ -595,7 +595,7 @@ end Returns `true` if stream `s` is marked. -See also [`mark`](:func:`mark`), [`unmark`](:func:`unmark`), [`reset`](:func:`reset`). +See also [`mark`](@ref), [`unmark`](@ref), [`reset`](@ref). """ ismarked(io::IO) = io.mark >= 0 diff --git a/base/iobuffer.jl b/base/iobuffer.jl index f4515bcc84cdb..a99963ab6bacd 100644 --- a/base/iobuffer.jl +++ b/base/iobuffer.jl @@ -55,9 +55,9 @@ IOBuffer(maxsize::Int) = (x=IOBuffer(Array{UInt8}(maxsize), true, true, maxsize) """ PipeBuffer(data::Vector{UInt8}=UInt8[],[maxsize::Int=typemax(Int)]) -An [`IOBuffer`](:obj:`IOBuffer`) that allows reading and performs writes by appending. +An [`IOBuffer`](@ref) that allows reading and performs writes by appending. Seeking and truncating are not supported. -See [`IOBuffer`](:obj:`IOBuffer`) for the available constructors. +See [`IOBuffer`](@ref) for the available constructors. If `data` is given, creates a `PipeBuffer` to operate on a data vector, optionally specifying a size beyond which the underlying `Array` may not be grown. """ diff --git a/base/iostream.jl b/base/iostream.jl index 35c92a6263d27..5899db85c5d29 100644 --- a/base/iostream.jl +++ b/base/iostream.jl @@ -263,7 +263,7 @@ Read at most `nb` bytes from `stream` into `b`, returning the number of bytes re The size of `b` will be increased if needed (i.e. if `nb` is greater than `length(b)` and enough bytes could be read), but it will never be decreased. -See [`read`](:func:`read`) for a description of the `all` option. +See [`read`](@ref) for a description of the `all` option. """ function readbytes!(s::IOStream, b::Array{UInt8}, nb=length(b); all::Bool=true) return all ? readbytes_all!(s, b, nb) : readbytes_some!(s, b, nb) diff --git a/base/iterators.jl b/base/iterators.jl index aa3bf0ae77177..9f759ad92941d 100644 --- a/base/iterators.jl +++ b/base/iterators.jl @@ -129,7 +129,7 @@ end For a set of iterable objects, returns an iterable of tuples, where the `i`th tuple contains the `i`th component of each input iterable. -Note that [`zip`](:func:`zip`) is its own inverse: `collect(zip(zip(a...)...)) == collect(a)`. +Note that [`zip`](@ref) is its own inverse: `collect(zip(zip(a...)...)) == collect(a)`. ```jldoctest julia> a = 1:5 diff --git a/base/libdl.jl b/base/libdl.jl index 73b66dc3ac40e..5f2b696d35853 100644 --- a/base/libdl.jl +++ b/base/libdl.jl @@ -9,7 +9,7 @@ export DL_LOAD_PATH, RTLD_DEEPBIND, RTLD_FIRST, RTLD_GLOBAL, RTLD_LAZY, RTLD_LOC """ DL_LOAD_PATH -When calling [`dlopen`](:func:`dlopen`), the paths in this list will be searched first, in +When calling [`dlopen`](@ref), the paths in this list will be searched first, in order, before searching the system locations for a valid library handle. """ const DL_LOAD_PATH = String[] @@ -39,7 +39,7 @@ const RTLD_FIRST = 0x00000080 RTLD_NOLOAD RTLD_NOW -Enum constant for [`dlopen`](:func:`dlopen`). See your platform man page for details, if +Enum constant for [`dlopen`](@ref). See your platform man page for details, if applicable. """ -> (RTLD_DEEPBIND, RTLD_FIRST, RTLD_GLOBAL, RTLD_LAZY, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_NOW) @@ -100,7 +100,7 @@ dlopen(s::AbstractString, flags::Integer = RTLD_LAZY | RTLD_DEEPBIND) = """ dlopen_e(libfile::AbstractString [, flags::Integer]) -Similar to [`dlopen`](:func:`dlopen`), except returns a `NULL` pointer instead of raising errors. +Similar to [`dlopen`](@ref), except returns a `NULL` pointer instead of raising errors. """ function dlopen_e end diff --git a/base/linalg/arnoldi.jl b/base/linalg/arnoldi.jl index b33e312d18ebd..e78832fe1c039 100644 --- a/base/linalg/arnoldi.jl +++ b/base/linalg/arnoldi.jl @@ -115,10 +115,10 @@ The following keyword arguments are supported: | `:BE` | compute half of the eigenvalues from each end of the spectrum, biased in favor of the high end. (real symmetric `A` only) | * `tol`: relative tolerance used in the convergence criterion for eigenvalues, similar to - `tol` in the [`eigs(A)`](:func:`eigs`) method for the ordinary eigenvalue + `tol` in the [`eigs(A)`](@ref) method for the ordinary eigenvalue problem, but effectively for the eigenvalues of ``B^{-1} A`` instead of ``A``. See the documentation for the ordinary eigenvalue problem in - [`eigs(A)`](:func:`eigs`) and the accompanying note about `tol`. + [`eigs(A)`](@ref) and the accompanying note about `tol`. * `maxiter`: Maximum number of iterations (default = 300) * `sigma`: Specifies the level shift used in inverse iteration. If `nothing` (default), defaults to ordinary (forward) iterations. Otherwise, find eigenvalues close to `sigma` @@ -317,7 +317,7 @@ end svds(A; nsv=6, ritzvec=true, tol=0.0, maxiter=1000, ncv=2*nsv, u0=zeros((0,)), v0=zeros((0,))) -> (SVD([left_sv,] s, [right_sv,]), nconv, niter, nmult, resid) Computes the largest singular values `s` of `A` using implicitly restarted Lanczos -iterations derived from [`eigs`](:func:`eigs`). +iterations derived from [`eigs`](@ref). **Inputs** @@ -328,9 +328,9 @@ iterations derived from [`eigs`](:func:`eigs`). * `nsv`: Number of singular values. Default: 6. * `ritzvec`: If `true`, return the left and right singular vectors `left_sv` and `right_sv`. If `false`, omit the singular vectors. Default: `true`. -* `tol`: tolerance, see [`eigs`](:func:`eigs`). -* `maxiter`: Maximum number of iterations, see [`eigs`](:func:`eigs`). Default: 1000. -* `ncv`: Maximum size of the Krylov subspace, see [`eigs`](:func:`eigs`) (there called `nev`). Default: `2*nsv`. +* `tol`: tolerance, see [`eigs`](@ref). +* `maxiter`: Maximum number of iterations, see [`eigs`](@ref). Default: 1000. +* `ncv`: Maximum size of the Krylov subspace, see [`eigs`](@ref) (there called `nev`). Default: `2*nsv`. * `u0`: Initial guess for the first left Krylov vector. It may have length `m` (the first dimension of `A`), or 0. * `v0`: Initial guess for the first right Krylov vector. It may have length `n` (the second dimension of `A`), or 0. diff --git a/base/linalg/bidiag.jl b/base/linalg/bidiag.jl index 16c9729d7d9c2..b10d7c33f5744 100644 --- a/base/linalg/bidiag.jl +++ b/base/linalg/bidiag.jl @@ -18,7 +18,7 @@ end Constructs an upper (`isupper=true`) or lower (`isupper=false`) bidiagonal matrix using the given diagonal (`dv`) and off-diagonal (`ev`) vectors. The result is of type `Bidiagonal` and provides efficient specialized linear solvers, but may be converted into a regular -matrix with [`convert(Array, _)`](:func:`convert`) (or `Array(_)` for short). `ev`'s length +matrix with [`convert(Array, _)`](@ref) (or `Array(_)` for short). `ev`'s length must be one less than the length of `dv`. # Example @@ -61,7 +61,7 @@ Bidiagonal(dv::AbstractVector, ev::AbstractVector) = throw(ArgumentError("did yo Constructs an upper (`uplo='U'`) or lower (`uplo='L'`) bidiagonal matrix using the given diagonal (`dv`) and off-diagonal (`ev`) vectors. The result is of type `Bidiagonal` and provides efficient specialized linear solvers, but may be converted into a regular -matrix with [`convert(Array, _)`](:func:`convert`) (or `Array(_)` for short). `ev`'s +matrix with [`convert(Array, _)`](@ref) (or `Array(_)` for short). `ev`'s length must be one less than the length of `dv`. # Example diff --git a/base/linalg/bunchkaufman.jl b/base/linalg/bunchkaufman.jl index c8f81296e6b97..316cebffbe9ae 100644 --- a/base/linalg/bunchkaufman.jl +++ b/base/linalg/bunchkaufman.jl @@ -19,7 +19,7 @@ BunchKaufman{T}(A::AbstractMatrix{T}, ipiv::Vector{BlasInt}, uplo::Char, symmetr """ bkfact!(A, uplo::Symbol=:U, symmetric::Bool=issymmetric(A), rook::Bool=false) -> BunchKaufman -`bkfact!` is the same as [`bkfact`](:func:`bkfact`), but saves space by overwriting the +`bkfact!` is the same as [`bkfact`](@ref), but saves space by overwriting the input `A`, instead of creating a copy. """ function bkfact!{T<:BlasReal}(A::StridedMatrix{T}, uplo::Symbol = :U, @@ -64,7 +64,7 @@ If `symmetric` is `true`, `A` is assumed to be symmetric. If `symmetric` is `fal `A` is assumed to be Hermitian. If `rook` is `true`, rook pivoting is used. If `rook` is false, rook pivoting is not used. The following functions are available for -`BunchKaufman` objects: [`size`](:func:`size`), `\\`, [`inv`](:func:`inv`), [`issymmetric`](:func:`issymmetric`), [`ishermitian`](:func:`ishermitian`). +`BunchKaufman` objects: [`size`](@ref), `\\`, [`inv`](@ref), [`issymmetric`](@ref), [`ishermitian`](@ref). [^Bunch1977]: J R Bunch and L Kaufman, Some stable methods for calculating inertia and solving symmetric linear systems, Mathematics of Computation 31:137 (1977), 163-179. [url](http://www.ams.org/journals/mcom/1977-31-137/S0025-5718-1977-0428694-0). diff --git a/base/linalg/dense.jl b/base/linalg/dense.jl index c81bd12518b37..3421655ca0e23 100644 --- a/base/linalg/dense.jl +++ b/base/linalg/dense.jl @@ -190,7 +190,7 @@ end """ diagind(M, k::Integer=0) -A [`Range`](:class:`Range`) giving the indices of the `k`th diagonal of the matrix `M`. +A `Range` giving the indices of the `k`th diagonal of the matrix `M`. # Example @@ -211,7 +211,7 @@ diagind(A::AbstractMatrix, k::Integer=0) = diagind(size(A,1), size(A,2), k) diag(M, k::Integer=0) The `k`th diagonal of a matrix, as a vector. -Use [`diagm`](:func:`diagm`) to construct a diagonal matrix. +Use [`diagm`](@ref) to construct a diagonal matrix. # Example @@ -333,7 +333,7 @@ Compute the matrix exponential of `A`, defined by e^A = \\sum_{n=0}^{\\infty} \\frac{A^n}{n!}. ``` -For symmetric or Hermitian `A`, an eigendecomposition ([`eigfact`](:func:`eigfact`)) is +For symmetric or Hermitian `A`, an eigendecomposition ([`eigfact`](@ref)) is used, otherwise the scaling and squaring algorithm (see [^H05]) is chosen. [^H05]: Nicholas J. Higham, "The squaring and scaling method for the matrix exponential revisited", SIAM Journal on Matrix Analysis and Applications, 26(4), 2005, 1179-1193. [doi:10.1137/090768539](http://dx.doi.org/10.1137/090768539) @@ -459,10 +459,10 @@ the unique matrix ``X`` such that ``e^X = A`` and ``-\\pi < Im(\\lambda) < \\pi` the eigenvalues ``\\lambda`` of ``X``. If `A` has nonpositive eigenvalues, a nonprincipal matrix function is returned whenever possible. -If `A` is symmetric or Hermitian, its eigendecomposition ([`eigfact`](:func:`eigfact`)) is +If `A` is symmetric or Hermitian, its eigendecomposition ([`eigfact`](@ref)) is used, if `A` is triangular an improved version of the inverse scaling and squaring method is employed (see [^AH12] and [^AHR13]). For general matrices, the complex Schur form -([`schur`](:func:`schur`)) is computed and the triangular algorithm is used on the +([`schur`](@ref)) is computed and the triangular algorithm is used on the triangular factor. [^AH12]: Awad H. Al-Mohy and Nicholas J. Higham, "Improved inverse scaling and squaring algorithms for the matrix logarithm", SIAM Journal on Scientific Computing, 34(4), 2012, C153-C169. [doi:10.1137/110852553](http://dx.doi.org/10.1137/110852553) @@ -528,9 +528,9 @@ If `A` has no negative real eigenvalues, compute the principal matrix square roo that is the unique matrix ``X`` with eigenvalues having positive real part such that ``X^2 = A``. Otherwise, a nonprincipal square root is returned. -If `A` is symmetric or Hermitian, its eigendecomposition ([`eigfact`](:func:`eigfact`)) is +If `A` is symmetric or Hermitian, its eigendecomposition ([`eigfact`](@ref)) is used to compute the square root. Otherwise, the square root is determined by means of the -Björck-Hammarling method, which computes the complex Schur form ([`schur`](:func:`schur`)) +Björck-Hammarling method, which computes the complex Schur form ([`schur`](@ref)) and then the complex square root of the triangular factor. [^BH83]: Åke Björck and Sven Hammarling, "A Schur method for the square root of a matrix", Linear Algebra and its Applications, 52-53, 1983, 127-140. [doi:10.1016/0024-3795(83)80010-X](http://dx.doi.org/10.1016/0024-3795(83)80010-X) @@ -603,16 +603,16 @@ systems. For example: `A=factorize(A); x=A\\b; y=A\\C`. | Properties of `A` | type of factorization | |:---------------------------|:-----------------------------------------------| -| Positive-definite | Cholesky (see [`cholfact`](:func:`cholfact`)) | -| Dense Symmetric/Hermitian | Bunch-Kaufman (see [`bkfact`](:func:`bkfact`)) | -| Sparse Symmetric/Hermitian | LDLt (see [`ldltfact`](:func:`ldltfact`)) | +| Positive-definite | Cholesky (see [`cholfact`](@ref)) | +| Dense Symmetric/Hermitian | Bunch-Kaufman (see [`bkfact`](@ref)) | +| Sparse Symmetric/Hermitian | LDLt (see [`ldltfact`](@ref)) | | Triangular | Triangular | | Diagonal | Diagonal | | Bidiagonal | Bidiagonal | -| Tridiagonal | LU (see [`lufact`](:func:`lufact`)) | -| Symmetric real tridiagonal | LDLt (see [`ldltfact`](:func:`ldltfact`)) | -| General square | LU (see [`lufact`](:func:`lufact`)) | -| General non-square | QR (see [`qrfact`](:func:`qrfact`)) | +| Tridiagonal | LU (see [`lufact`](@ref)) | +| Symmetric real tridiagonal | LDLt (see [`ldltfact`](@ref)) | +| General square | LU (see [`lufact`](@ref)) | +| General non-square | QR (see [`qrfact`](@ref)) | If `factorize` is called on a Hermitian positive-definite matrix, for instance, then `factorize` will return a Cholesky factorization. diff --git a/base/linalg/eigen.jl b/base/linalg/eigen.jl index 301b54d6684bf..0c6bf4c984c9e 100644 --- a/base/linalg/eigen.jl +++ b/base/linalg/eigen.jl @@ -58,15 +58,15 @@ end """ eigfact(A,[irange,][vl,][vu,][permute=true,][scale=true]) -> Eigen -Computes the eigenvalue decomposition of `A`, returning an [`Eigen`](:obj:`Eigen`) factorization object `F` +Computes the eigenvalue decomposition of `A`, returning an `Eigen` factorization object `F` which contains the eigenvalues in `F[:values]` and the eigenvectors in the columns of the matrix `F[:vectors]`. (The `k`th eigenvector can be obtained from the slice `F[:vectors][:, k]`.) -The following functions are available for `Eigen` objects: [`inv`](:func:`inv`), [`det`](:func:`det`), and [`isposdef`](:func:`isposdef`). +The following functions are available for `Eigen` objects: [`inv`](@ref), [`det`](@ref), and [`isposdef`](@ref). -If `A` is [`Symmetric`](:class:`Symmetric`), [`Hermitian`](:class:`Hermitian`) or -[`SymTridiagonal`](:class:`SymTridiagonal`), it is possible to calculate only a subset of -the eigenvalues by specifying either a [`UnitRange`](:class:`UnitRange`) `irange` covering +If `A` is [`Symmetric`](@ref), [`Hermitian`](@ref) or +[`SymTridiagonal`](@ref), it is possible to calculate only a subset of +the eigenvalues by specifying either a `UnitRange` `irange` covering indices of the sorted eigenvalues or a pair `vl` and `vu` for the lower and upper boundaries of the eigenvalues. @@ -109,7 +109,7 @@ end eig(A,[irange,][vl,][vu,][permute=true,][scale=true]) -> D, V Computes eigenvalues (`D`) and eigenvectors (`V`) of `A`. -See [`eigfact`](:func:`eigfact`) for details on the +See [`eigfact`](@ref) for details on the `irange`, `vl`, and `vu` arguments and the `permute` and `scale` keyword arguments. The eigenvectors are returned columnwise. @@ -122,8 +122,8 @@ julia> eig([1.0 0.0 0.0; 0.0 3.0 0.0; 0.0 0.0 18.0]) [1.0 0.0 0.0; 0.0 1.0 0.0; 0.0 0.0 1.0]) ``` -`eig` is a wrapper around [`eigfact`](:func:`eigfact`), extracting all parts of the -factorization to a tuple; where possible, using [`eigfact`](:func:`eigfact`) is recommended. +`eig` is a wrapper around [`eigfact`](@ref), extracting all parts of the +factorization to a tuple; where possible, using [`eigfact`](@ref) is recommended. """ function eig(A::AbstractMatrix, args...) F = eigfact(A, args...) @@ -135,9 +135,9 @@ end Returns a matrix `M` whose columns are the eigenvectors of `A`. (The `k`th eigenvector can be obtained from the slice `M[:, k]`.) The `permute` and `scale` keywords are the same as -for [`eigfact`](:func:`eigfact`). +for [`eigfact`](@ref). -For [`SymTridiagonal`](:class:`SymTridiagonal`) matrices, if the optional vector of +For [`SymTridiagonal`](@ref) matrices, if the optional vector of eigenvalues `eigvals` is specified, returns the specific corresponding eigenvectors. # Example @@ -159,7 +159,7 @@ eigvals{T,V,S,U}(F::Union{Eigen{T,V,S,U}, GeneralizedEigen{T,V,S,U}}) = F[:value """ eigvals!(A,[irange,][vl,][vu]) -> values -Same as [`eigvals`](:func:`eigvals`), but saves space by overwriting the input `A`, instead of creating a copy. +Same as [`eigvals`](@ref), but saves space by overwriting the input `A`, instead of creating a copy. """ function eigvals!{T<:BlasReal}(A::StridedMatrix{T}; permute::Bool=true, scale::Bool=true) issymmetric(A) && return eigvals!(Symmetric(A)) @@ -316,8 +316,8 @@ eigfact(A::Number, B::Number) = eigfact(fill(A,1,1), fill(B,1,1)) Computes generalized eigenvalues (`D`) and vectors (`V`) of `A` with respect to `B`. -`eig` is a wrapper around [`eigfact`](:func:`eigfact`), extracting all parts of the -factorization to a tuple; where possible, using [`eigfact`](:func:`eigfact`) is recommended. +`eig` is a wrapper around [`eigfact`](@ref), extracting all parts of the +factorization to a tuple; where possible, using [`eigfact`](@ref) is recommended. # Example @@ -349,7 +349,7 @@ end """ eigvals!(A, B) -> values -Same as [`eigvals`](:func:`eigvals`), but saves space by overwriting the input `A` (and `B`), instead of creating copies. +Same as [`eigvals`](@ref), but saves space by overwriting the input `A` (and `B`), instead of creating copies. """ function eigvals!{T<:BlasReal}(A::StridedMatrix{T}, B::StridedMatrix{T}) issymmetric(A) && isposdef(B) && return eigvals!(Symmetric(A), Symmetric(B)) diff --git a/base/linalg/factorization.jl b/base/linalg/factorization.jl index 045d88212a755..374ee7949d40e 100644 --- a/base/linalg/factorization.jl +++ b/base/linalg/factorization.jl @@ -68,9 +68,9 @@ If only two arguments are passed, then `A_ldiv_B!(A, B)` overwrites `B` with the result. The argument `A` should *not* be a matrix. Rather, instead of matrices it should be a -factorization object (e.g. produced by [`factorize`](:func:`factorize`) or [`cholfact`](:func:`cholfact`)). +factorization object (e.g. produced by [`factorize`](@ref) or [`cholfact`](@ref)). The reason for this is that factorization itself is both expensive and typically allocates memory -(although it can also be done in-place via, e.g., [`lufact!`](:func:`lufact!`)), +(although it can also be done in-place via, e.g., [`lufact!`](@ref)), and performance-critical situations requiring `A_ldiv_B!` usually also require fine-grained control over the factorization of `A`. """ @@ -79,7 +79,7 @@ A_ldiv_B! """ Ac_ldiv_B!([Y,] A, B) -> Y -Similar to [`A_ldiv_B!`](:func:`A_ldiv_B!`), but return ``Aᴴ`` \\ ``B``, +Similar to [`A_ldiv_B!`](@ref), but return ``Aᴴ`` \\ ``B``, computing the result in-place in `Y` (or overwriting `B` if `Y` is not supplied). """ Ac_ldiv_B! @@ -87,7 +87,7 @@ Ac_ldiv_B! """ At_ldiv_B!([Y,] A, B) -> Y -Similar to [`A_ldiv_B!`](:func:`A_ldiv_B!`), but return ``Aᵀ`` \\ ``B``, +Similar to [`A_ldiv_B!`](@ref), but return ``Aᵀ`` \\ ``B``, computing the result in-place in `Y` (or overwriting `B` if `Y` is not supplied). """ At_ldiv_B! diff --git a/base/linalg/generic.jl b/base/linalg/generic.jl index 7d4d2ef987dbf..f70d76f1731e0 100644 --- a/base/linalg/generic.jl +++ b/base/linalg/generic.jl @@ -233,7 +233,7 @@ tril(M::AbstractMatrix,k::Integer) = tril!(copy(M),k) triu!(M) Upper triangle of a matrix, overwriting `M` in the process. -See also [`triu`](:func:`triu`). +See also [`triu`](@ref). """ triu!(M::AbstractMatrix) = triu!(M,0) @@ -241,7 +241,7 @@ triu!(M::AbstractMatrix) = triu!(M,0) tril!(M) Lower triangle of a matrix, overwriting `M` in the process. -See also [`tril`](:func:`tril`). +See also [`tril`](@ref). """ tril!(M::AbstractMatrix) = tril!(M,0) @@ -516,7 +516,7 @@ julia> norm(v, Inf) For matrices, the matrix norm induced by the vector `p`-norm is used, where valid values of `p` are `1`, `2`, or `Inf`. (Note that for sparse matrices, `p=2` is currently not -implemented.) Use [`vecnorm`](:func:`vecnorm`) to compute the Frobenius norm. +implemented.) Use [`vecnorm`](@ref) to compute the Frobenius norm. # Example @@ -625,8 +625,8 @@ dot(x::AbstractVector, y::AbstractVector) = vecdot(x, y) Compute the rank of a matrix by counting how many singular values of `M` have magnitude greater than `tol`. By default, the value of `tol` is the largest -dimension of `M` multiplied by the [`eps`](:func:`eps`) -of the [`eltype`](:func:`eltype`) of `M`. +dimension of `M` multiplied by the [`eps`](@ref) +of the [`eltype`](@ref) of `M`. """ rank(A::AbstractMatrix, tol::Real) = sum(svdvals(A) .> tol) function rank(A::AbstractMatrix) @@ -972,7 +972,7 @@ the squared error between `y` and `a + b*x` is minimized. See also: -`\\`, [`cov`](:func:`cov`), [`std`](:func:`std`), [`mean`](:func:`mean`). +`\\`, [`cov`](@ref), [`std`](@ref), [`mean`](@ref). """ function linreg(x::AbstractVector, y::AbstractVector) @@ -1010,10 +1010,10 @@ scale!(b::AbstractVector, A::AbstractMatrix) = scale!(A,b,A) peakflops(n::Integer=2000; parallel::Bool=false) `peakflops` computes the peak flop rate of the computer by using double precision -[`gemm!`](:func:`Base.LinAlg.BLAS.gemm!`). By default, if no arguments are specified, it +[`gemm!`](@ref Base.LinAlg.BLAS.gemm!). By default, if no arguments are specified, it multiplies a matrix of size `n x n`, where `n = 2000`. If the underlying BLAS is using multiple threads, higher flop rates are realized. The number of BLAS threads can be set with -[`BLAS.set_num_threads(n)`](:func:`Base.LinAlg.BLAS.set_num_threads`). +[`BLAS.set_num_threads(n)`](@ref). If the keyword argument `parallel` is set to `true`, `peakflops` is run in parallel on all the worker processors. The flop rate of the entire parallel computer is returned. When @@ -1180,7 +1180,7 @@ end normalize!(v, [p::Real=2]) Normalize the vector `v` in-place with respect to the `p`-norm. -See also [`vecnorm`](:func:`vecnorm`) and [`normalize`](:func:`normalize`). +See also [`vecnorm`](@ref) and [`normalize`](@ref). """ function normalize!(v::AbstractVector, p::Real=2) nrm = norm(v, p) @@ -1209,7 +1209,7 @@ end normalize(v, [p::Real=2]) Normalize the vector `v` with respect to the `p`-norm. -See also [`normalize!`](:func:`normalize!`) and [`vecnorm`](:func:`vecnorm`). +See also [`normalize!`](@ref) and [`vecnorm`](@ref). # Example diff --git a/base/linalg/givens.jl b/base/linalg/givens.jl index f543ed5477521..8096347f9b1ce 100644 --- a/base/linalg/givens.jl +++ b/base/linalg/givens.jl @@ -22,7 +22,7 @@ conjugated transpose right multiplication `A*G'`. The type doesn't have a `size` therefore be multiplied with matrices of arbitrary size as long as `i2<=size(A,2)` for `G*A` or `i2<=size(A,1)` for `A*G'`. -See also: [`givens`](:func:`givens`) +See also: [`givens`](@ref) """ immutable Givens{T} <: AbstractRotation{T} i1::Int @@ -249,7 +249,7 @@ y[i1] = r y[i2] = 0 ``` -See also: [`LinAlg.Givens`](:class:`LinAlg.Givens`) +See also: [`LinAlg.Givens`](@ref) """ function givens{T}(f::T, g::T, i1::Integer, i2::Integer) if i1 == i2 @@ -275,7 +275,7 @@ B[i1,j] = r B[i2,j] = 0 ``` -See also: [`LinAlg.Givens`](:class:`LinAlg.Givens`) +See also: [`LinAlg.Givens`](@ref) """ givens(A::AbstractMatrix, i1::Integer, i2::Integer, j::Integer) = givens(A[i1,j], A[i2,j],i1,i2) @@ -294,7 +294,7 @@ B[i1] = r B[i2] = 0 ``` -See also: [`LinAlg.Givens`](:class:`LinAlg.Givens`) +See also: [`LinAlg.Givens`](@ref) """ givens(x::AbstractVector, i1::Integer, i2::Integer) = givens(x[i1], x[i2], i1, i2) diff --git a/base/linalg/hessenberg.jl b/base/linalg/hessenberg.jl index 385cdea50c241..faa7c4813a569 100644 --- a/base/linalg/hessenberg.jl +++ b/base/linalg/hessenberg.jl @@ -13,7 +13,7 @@ Hessenberg(A::StridedMatrix) = Hessenberg(LAPACK.gehrd!(A)...) """ hessfact!(A) -> Hessenberg -`hessfact!` is the same as [`hessfact`](:func:`hessfact`), but saves space by overwriting +`hessfact!` is the same as [`hessfact`](@ref), but saves space by overwriting the input `A`, instead of creating a copy. """ hessfact!{T<:BlasFloat}(A::StridedMatrix{T}) = Hessenberg(A) @@ -26,7 +26,7 @@ hessfact{T<:BlasFloat}(A::StridedMatrix{T}) = hessfact!(copy(A)) Compute the Hessenberg decomposition of `A` and return a `Hessenberg` object. If `F` is the factorization object, the unitary matrix can be accessed with `F[:Q]` and the Hessenberg matrix with `F[:H]`. When `Q` is extracted, the resulting type is the `HessenbergQ` object, -and may be converted to a regular matrix with [`convert(Array, _)`](:func:`convert`) +and may be converted to a regular matrix with [`convert(Array, _)`](@ref) (or `Array(_)` for short). # Example diff --git a/base/linalg/ldlt.jl b/base/linalg/ldlt.jl index 1c0bcf002053a..4d2c5b79fe8f7 100644 --- a/base/linalg/ldlt.jl +++ b/base/linalg/ldlt.jl @@ -18,7 +18,7 @@ convert{T,S,U}(::Type{Factorization{T}}, F::LDLt{S,U}) = convert(LDLt{T,U}, F) """ ldltfact!(S::SymTridiagonal) -> LDLt -Same as [`ldltfact`](:func:`ldltfact`), but saves space by overwriting the input `A`, instead of creating a copy. +Same as [`ldltfact`](@ref), but saves space by overwriting the input `A`, instead of creating a copy. """ function ldltfact!{T<:Real}(S::SymTridiagonal{T}) n = size(S,1) diff --git a/base/linalg/lq.jl b/base/linalg/lq.jl index a08b8e1737f5c..016394c091d52 100644 --- a/base/linalg/lq.jl +++ b/base/linalg/lq.jl @@ -21,13 +21,13 @@ LQPackedQ{T}(factors::AbstractMatrix{T}, τ::Vector{T}) = LQPackedQ{T,typeof(fac lqfact!(A) -> LQ Compute the LQ factorization of `A`, using the input -matrix as a workspace. See also [`lq`](:func:`lq`). +matrix as a workspace. See also [`lq`](@ref). """ lqfact!{T<:BlasFloat}(A::StridedMatrix{T}) = LQ(LAPACK.gelqf!(A)...) """ lqfact(A) -> LQ -Compute the LQ factorization of `A`. See also [`lq`](:func:`lq`). +Compute the LQ factorization of `A`. See also [`lq`](@ref). """ lqfact{T<:BlasFloat}(A::StridedMatrix{T}) = lqfact!(copy(A)) lqfact(x::Number) = lqfact(fill(x,1,1)) diff --git a/base/linalg/lu.jl b/base/linalg/lu.jl index 243a6abefe141..550245ff76410 100644 --- a/base/linalg/lu.jl +++ b/base/linalg/lu.jl @@ -23,8 +23,8 @@ end """ lufact!(A, pivot=Val{true}) -> LU -`lufact!` is the same as [`lufact`](:func:`lufact`), but saves space by overwriting the -input `A`, instead of creating a copy. An [`InexactError`](:obj:`InexactError`) +`lufact!` is the same as [`lufact`](@ref), but saves space by overwriting the +input `A`, instead of creating a copy. An [`InexactError`](@ref) exception is thrown if the factorisation produces a number not representable by the element type of `A`, e.g. for integer types. """ @@ -108,13 +108,13 @@ The relationship between `F` and `A` is | Supported function | `LU` | `LU{T,Tridiagonal{T}}` | |:---------------------------------|:-----|:-----------------------| -| [`/`](:func:`/`) | ✓ | | -| [`\\`](:func:`\\`) | ✓ | ✓ | -| [`cond`](:func:`cond`) | ✓ | | -| [`det`](:func:`det`) | ✓ | ✓ | -| [`logdet`](:func:`logdet`) | ✓ | ✓ | -| [`logabsdet`](:func:`logabsdet`) | ✓ | ✓ | -| [`size`](:func:`size`) | ✓ | ✓ | +| [`/`](@ref) | ✓ | | +| [`\\`](@ref) | ✓ | ✓ | +| [`cond`](@ref) | ✓ | | +| [`det`](@ref) | ✓ | ✓ | +| [`logdet`](@ref) | ✓ | ✓ | +| [`logabsdet`](@ref) | ✓ | ✓ | +| [`size`](@ref) | ✓ | ✓ | # Example @@ -164,7 +164,7 @@ Compute the LU factorization of `A`, such that `A[p,:] = L*U`. By default, pivoting is used. This can be overridden by passing `Val{false}` for the second argument. -See also [`lufact`](:func:`lufact`). +See also [`lufact`](@ref). # Example diff --git a/base/linalg/qr.jl b/base/linalg/qr.jl index 0392d95719aa4..7b9dfc34090ec 100644 --- a/base/linalg/qr.jl +++ b/base/linalg/qr.jl @@ -94,9 +94,9 @@ qrfact!{T<:BlasFloat}(A::StridedMatrix{T}) = qrfact!(A, Val{false}) """ qrfact!(A, pivot=Val{false}) -`qrfact!` is the same as [`qrfact`](:func:`qrfact`) when `A` is a subtype of +`qrfact!` is the same as [`qrfact`](@ref) when `A` is a subtype of `StridedMatrix`, but saves space by overwriting the input `A`, instead of creating a copy. -An [`InexactError`](:obj:`InexactError`) exception is thrown if the factorisation produces a number not +An [`InexactError`](@ref) exception is thrown if the factorisation produces a number not representable by the element type of `A`, e.g. for integer types. """ qrfact!(A::StridedMatrix, ::Type{Val{false}}) = qrfactUnblocked!(A) @@ -126,13 +126,13 @@ The individual components of the factorization `F` can be accessed by indexing: | `F[:p]` | pivot `Vector` | | | ✓ | | `F[:P]` | (pivot) permutation `Matrix` | | | ✓ | -The following functions are available for the `QR` objects: [`size`](:func:`size`) -and [`\\`](:func:`\\`). When `A` is rectangular, `\\` will return a least squares +The following functions are available for the `QR` objects: [`size`](@ref) +and [`\\`](@ref). When `A` is rectangular, `\\` will return a least squares solution and if the solution is not unique, the one with smallest norm is returned. Multiplication with respect to either thin or full `Q` is allowed, i.e. both `F[:Q]*F[:R]` and `F[:Q]*A` are supported. A `Q` matrix can be converted into a regular matrix with -[`full`](:func:`full`) which has a named argument `thin`. +[`full`](@ref) which has a named argument `thin`. !!! note `qrfact` returns multiple types because LAPACK uses several representations @@ -183,7 +183,7 @@ qrfact(x::Number) = qrfact(fill(x,1,1)) qr(A, pivot=Val{false}; thin::Bool=true) -> Q, R, [p] Compute the (pivoted) QR factorization of `A` such that either `A = Q*R` or `A[:,p] = Q*R`. -Also see [`qrfact`](:func:`qrfact`). +Also see [`qrfact`](@ref). The default is to compute a thin factorization. Note that `R` is not extended with zeros when the full `Q` is requested. """ @@ -205,8 +205,8 @@ Computes the polar decomposition of a vector. Returns `w`, a unit vector in the direction of `v`, and `r`, the norm of `v`. -See also [`normalize`](:func:`normalize`), [`normalize!`](:func:`normalize!`), -and [`LinAlg.qr!](:func:`LinAlg.qr!`). +See also [`normalize`](@ref), [`normalize!`](@ref), +and [`LinAlg.qr!`](@ref). # Example @@ -242,8 +242,8 @@ as `qr(v::AbstractVector)`, this function mutates the input vector `v` in place. Returns `w`, a unit vector in the direction of `v` (this is a mutation of `v`), and `r`, the norm of `v`. -See also [`normalize`](:func:`normalize`), [`normalize!`](:func:`normalize!`), -and [`qr`](:func:`qr`). +See also [`normalize`](@ref), [`normalize!`](@ref), +and [`qr`](@ref). """ function qr!(v::AbstractVector) nrm = norm(v) diff --git a/base/linalg/svd.jl b/base/linalg/svd.jl index 666d15fc55308..32656dc5b1a09 100644 --- a/base/linalg/svd.jl +++ b/base/linalg/svd.jl @@ -69,7 +69,7 @@ If `thin=true` (default), a thin SVD is returned. For a ``M \\times N`` matrix `A`, `U` is ``M \\times M`` for a full SVD (`thin=false`) and ``M \\times \\min(M, N)`` for a thin SVD. -`svd` is a wrapper around [`svdfact`](:func:`svdfact(A)`), extracting all parts +`svd` is a wrapper around [`svdfact`](@ref), extracting all parts of the `SVD` factorization to a tuple. Direct use of `svdfact` is therefore more efficient. @@ -178,7 +178,7 @@ GeneralizedSVD{T}(U::AbstractMatrix{T}, V::AbstractMatrix{T}, Q::AbstractMatrix{ """ svdfact!(A, [thin=true]) -> SVD -`svdfact!` is the same as [`svdfact`](:func:`svdfact`), but saves space by +`svdfact!` is the same as [`svdfact`](@ref), but saves space by overwriting the input `A`, instead of creating a copy. If `thin=true` (default), a thin SVD is returned. For a ``M \\times N`` matrix @@ -228,7 +228,7 @@ end """ svd(A, B) -> U, V, Q, D1, D2, R0 -Wrapper around [`svdfact`](:func:`svdfact(A, B)`) extracting all parts of the +Wrapper around [`svdfact`](@ref) extracting all parts of the factorization to a tuple. Direct use of `svdfact` is therefore generally more efficient. The function returns the generalized SVD of `A` and `B`, returning `U`, `V`, `Q`, `D1`, `D2`, and `R0` such that `A = U*D1*R0*Q'` and `B = diff --git a/base/linalg/tridiag.jl b/base/linalg/tridiag.jl index b1fe565ebb088..b9410803b468f 100644 --- a/base/linalg/tridiag.jl +++ b/base/linalg/tridiag.jl @@ -20,7 +20,7 @@ end Construct a symmetric tridiagonal matrix from the diagonal and first sub/super-diagonal, respectively. The result is of type `SymTridiagonal` and provides efficient specialized eigensolvers, but may be converted into a regular matrix with -[`convert(Array, _)`](:func:`convert`) (or `Array(_)` for short). +[`convert(Array, _)`](@ref) (or `Array(_)` for short). # Example @@ -354,7 +354,7 @@ end Construct a tridiagonal matrix from the first subdiagonal, diagonal, and first superdiagonal, respectively. The result is of type `Tridiagonal` and provides efficient specialized linear solvers, but may be converted into a regular matrix with -[`convert(Array, _)`](:func:`convert`) (or `Array(_)` for short). +[`convert(Array, _)`](@ref) (or `Array(_)` for short). The lengths of `dl` and `du` must be one less than the length of `d`. # Example diff --git a/base/loading.jl b/base/loading.jl index 43b2b7e23923b..6bf95515c511a 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -506,7 +506,7 @@ end `@__FILE__` expands to a string with the absolute file path of the file containing the macro. Returns `nothing` if run from a REPL or an empty string if evaluated by -`julia -e `. Alternatively see [`PROGRAM_FILE`](:data:`PROGRAM_FILE`). +`julia -e `. Alternatively see [`PROGRAM_FILE`](@ref). """ macro __FILE__() source_path() end @@ -565,7 +565,7 @@ end """ evalfile(path::AbstractString, args::Vector{String}=String[]) -Load the file using [`include`](:func:`include`), evaluate all expressions, +Load the file using [`include`](@ref), evaluate all expressions, and return the value of the last one. """ function evalfile(path::AbstractString, args::Vector{String}=String[]) @@ -628,11 +628,11 @@ compilecache(mod::Symbol) = compilecache(string(mod)) """ Base.compilecache(module::String) -Creates a [precompiled cache file](:ref:`man-modules-initialization-precompilation`) for +Creates a precompiled cache file for a module and all of its dependencies. This can be used to reduce package load times. Cache files are stored in `LOAD_CACHE_PATH[1]`, which defaults to `~/.julia/lib/VERSION`. See -[Module initialization and precompilation](:ref:`Module initialization and precompilation `) +[Module initialization and precompilation](@ref) for important notes. """ function compilecache(name::String) diff --git a/base/managers.jl b/base/managers.jl index 7bdeee4a538f3..505281ca4dc60 100644 --- a/base/managers.jl +++ b/base/managers.jl @@ -346,7 +346,7 @@ end Implemented by cluster managers. For every Julia worker launched by this function, it should append a `WorkerConfig` entry to `launched` and notify `launch_ntfy`. The function MUST exit once all workers, requested by `manager` have been launched. `params` is a dictionary of all -keyword arguments [`addprocs`](:func:`addprocs`) was called with. +keyword arguments [`addprocs`](@ref) was called with. """ launch @@ -357,7 +357,7 @@ Implemented by cluster managers. It is called on the master process, during a wo lifetime, with appropriate `op` values: - with `:register`/`:deregister` when a worker is added / removed from the Julia worker pool. -- with `:interrupt` when `interrupt(workers)` is called. The [`ClusterManager`](:class:`ClusterManager`) +- with `:interrupt` when `interrupt(workers)` is called. The `ClusterManager` should signal the appropriate worker with an interrupt signal. - with `:finalize` for cleanup purposes. """ @@ -511,7 +511,7 @@ end kill(manager::ClusterManager, pid::Int, config::WorkerConfig) Implemented by cluster managers. -It is called on the master process, by [`rmprocs`](:func:`rmprocs`). +It is called on the master process, by [`rmprocs`](@ref). It should cause the remote worker specified by `pid` to exit. `Base.kill(manager::ClusterManager.....)` executes a remote `exit()` on `pid`. diff --git a/base/math.jl b/base/math.jl index bc4274f4e8ef5..643f52e227aa4 100644 --- a/base/math.jl +++ b/base/math.jl @@ -65,7 +65,7 @@ clamp{T}(x::AbstractArray{T}, lo, hi) = clamp!(array::AbstractArray, lo, hi) Restrict values in `array` to the specified range, in-place. -See also [`clamp`](:func:`clamp`). +See also [`clamp`](@ref). """ function clamp!{T}(x::AbstractArray{T}, lo, hi) @inbounds for i in eachindex(x) @@ -163,7 +163,7 @@ log{T<:Number}(b::T, x::T) = log(x)/log(b) """ log(b,x) -Compute the base `b` logarithm of `x`. Throws [`DomainError`](:obj:`DomainError`) for negative `Real` arguments. +Compute the base `b` logarithm of `x`. Throws [`DomainError`](@ref) for negative `Real` arguments. ```jldoctest julia> log(4,8) @@ -174,7 +174,7 @@ julia> log(4,2) ``` !!! note - If `b` is a power of 2 or 10, [`log2`](:func:`log2`) or [`log10`](:func:`log10`) should be used, as these will + If `b` is a power of 2 or 10, [`log2`](@ref) or [`log10`](@ref) should be used, as these will typically be faster and more accurate. For example, ```jldoctest @@ -272,7 +272,7 @@ sqrt(x::Float32) = box(Float32,sqrt_llvm(unbox(Float32,x))) """ sqrt(x) -Return ``\\sqrt{x}``. Throws [`DomainError`](:obj:`DomainError`) for negative `Real` arguments. Use complex +Return ``\\sqrt{x}``. Throws [`DomainError`](@ref) for negative `Real` arguments. Use complex negative arguments instead. The prefix operator `√` is equivalent to `sqrt`. """ sqrt(x::Real) = sqrt(float(x)) @@ -590,7 +590,7 @@ end Combined multiply-add, computes `x*y+z` in an efficient manner. This may on some systems be equivalent to `x*y+z`, or to `fma(x,y,z)`. `muladd` is used to improve performance. -See [`fma`](:func:`fma`). +See [`fma`](@ref). """ muladd(x,y,z) = x*y+z diff --git a/base/mpfr.jl b/base/mpfr.jl index 1ac8dadb57d3b..71278f7fc1d9b 100644 --- a/base/mpfr.jl +++ b/base/mpfr.jl @@ -51,7 +51,7 @@ promoted to a `BigFloat`. Note that because decimal literals are converted to floating point numbers when parsed, `BigFloat(2.1)` may not yield what you expect. You may instead prefer to initialize -constants from strings via [`parse`](:func:`parse`), or using the `big` string literal. +constants from strings via [`parse`](@ref), or using the `big` string literal. ```jldoctest julia> BigFloat(2.1) diff --git a/base/multi.jl b/base/multi.jl index 09904a2613d14..a7d112df5608f 100644 --- a/base/multi.jl +++ b/base/multi.jl @@ -582,7 +582,7 @@ end A low-level API which given a `IO` connection or a `Worker`, returns the `pid` of the worker it is connected to. -This is useful when writing custom [`serialize`](:func:`serialize`) methods for a type, +This is useful when writing custom [`serialize`](@ref) methods for a type, which optimizes the data written out depending on the receiving process id. """ function worker_id_from_socket(s) @@ -793,7 +793,7 @@ remoteref_id(r::AbstractRemoteRef) = RRID(r.whence, r.id) Base.channel_from_id(id) -> c A low-level API which returns the backing `AbstractChannel` for an `id` returned by -[`remoteref_id`](:func:`Base.remoteref_id`). +[`remoteref_id`](@ref). The call is valid only on the node where the backing channel exists. """ function channel_from_id(id) @@ -823,11 +823,11 @@ end """ isready(rr::Future) -Determine whether a [`Future`](:obj:`Future`) has a value stored to it. +Determine whether a [`Future`](@ref) has a value stored to it. If the argument `Future` is owned by a different node, this call will block to wait for the answer. It is recommended to wait for `rr` in a separate task instead -or to use a local [`Channel`](:obj:`Channel`) as a proxy: +or to use a local [`Channel`](@ref) as a proxy: c = Channel(1) @async put!(c, remotecall_fetch(long_computation, p)) @@ -847,10 +847,10 @@ end """ isready(rr::RemoteChannel, args...) -Determine whether a [`RemoteChannel`](:obj:`RemoteChannel`) has a value stored to it. +Determine whether a [`RemoteChannel`](@ref) has a value stored to it. Note that this function can cause race conditions, since by the time you receive its result it may no longer be true. However, -it can be safely used on a [`Future`](:obj:`Future`) since they are assigned only once. +it can be safely used on a [`Future`](@ref) since they are assigned only once. """ function isready(rr::RemoteChannel, args...) rid = remoteref_id(rr) @@ -1049,7 +1049,7 @@ end remotecall(f, id::Integer, args...; kwargs...) -> Future Call a function `f` asynchronously on the given arguments on the specified process. -Returns a [`Future`](:obj:`Future`). +Returns a [`Future`](@ref). Keyword arguments, if any, are passed through to `f`. """ remotecall(f, id::Integer, args...; kwargs...) = remotecall(f, worker_from_id(id), args...; kwargs...) @@ -1079,9 +1079,9 @@ end Perform `fetch(remotecall(...))` in one message. Keyword arguments, if any, are passed through to `f`. Any remote exceptions are captured in a -[`RemoteException`](:obj:`RemoteException`) and thrown. +[`RemoteException`](@ref) and thrown. -See also [`fetch`](:func:`fetch`) and [`remotecall`](:func:`remotecall`). +See also [`fetch`](@ref) and [`remotecall`](@ref). """ remotecall_fetch(f, id::Integer, args...; kwargs...) = remotecall_fetch(f, worker_from_id(id), args...; kwargs...) @@ -1108,7 +1108,7 @@ end Perform a faster `wait(remotecall(...))` in one message on the `Worker` specified by worker id `id`. Keyword arguments, if any, are passed through to `f`. -See also [`wait`](:func:`wait`) and [`remotecall`](:func:`remotecall`). +See also [`wait`](@ref) and [`remotecall`](@ref). """ remotecall_wait(f, id::Integer, args...; kwargs...) = remotecall_wait(f, worker_from_id(id), args...; kwargs...) @@ -1132,7 +1132,7 @@ end remote_do(f, id::Integer, args...; kwargs...) -> nothing Executes `f` on worker `id` asynchronously. -Unlike [`remotecall`](:func:`remotecall`), it does not store the +Unlike [`remotecall`](@ref), it does not store the result of computation, nor is there a way to wait for its completion. A successful invocation indicates that the request has been accepted for execution on @@ -1144,7 +1144,7 @@ invoked, the order of executions on the remote worker is undetermined. For examp to `f1`, followed by `f2` and `f3` in that order. However, it is not guaranteed that `f1` is executed before `f3` on worker 2. -Any exceptions thrown by `f` are printed to [`STDERR`](:obj:`STDERR`) on the remote worker. +Any exceptions thrown by `f` are printed to [`STDERR`](@ref) on the remote worker. Keyword arguments, if any, are passed through to `f`. """ @@ -1195,10 +1195,10 @@ fetch(r::RemoteChannel, args...) = call_on_owner(fetch_ref, r, args...) Waits and fetches a value from `x` depending on the type of `x`: -* [`Future`](:obj:`Future`): Wait for and get the value of a `Future`. The fetched value is cached locally. +* [`Future`](@ref): Wait for and get the value of a `Future`. The fetched value is cached locally. Further calls to `fetch` on the same reference return the cached value. If the remote value - is an exception, throws a [`RemoteException`](:obj:`RemoteException`) which captures the remote exception and backtrace. -* [`RemoteChannel`](:obj:`RemoteChannel`): Wait for and get the value of a remote reference. Exceptions raised are + is an exception, throws a [`RemoteException`](@ref) which captures the remote exception and backtrace. +* [`RemoteChannel`](@ref): Wait for and get the value of a remote reference. Exceptions raised are same as for a `Future` . Does not remove the item fetched. @@ -1210,7 +1210,7 @@ isready(rv::RemoteValue, args...) = isready(rv.c, args...) """ put!(rr::Future, v) -Store a value to a [`Future`](:obj:`Future`) `rr`. +Store a value to a [`Future`](@ref) `rr`. `Future`s are write-once remote references. A `put!` on an already set `Future` throws an `Exception`. All asynchronous remote calls return `Future`s and set the @@ -1238,7 +1238,7 @@ put_ref(rid, args...) = (put!(lookup_ref(rid), args...); nothing) """ put!(rr::RemoteChannel, args...) -Store a set of values to the [`RemoteChannel`](:obj:`RemoteChannel`). +Store a set of values to the [`RemoteChannel`](@ref). If the channel is full, blocks until space is available. Returns its first argument. """ @@ -1256,7 +1256,7 @@ end """ take!(rr::RemoteChannel, args...) -Fetch value(s) from a [`RemoteChannel`](:obj:`RemoteChannel`) `rr`, +Fetch value(s) from a [`RemoteChannel`](@ref) `rr`, removing the value(s) in the processs. """ take!(rr::RemoteChannel, args...) = call_on_owner(take_ref, rr, myid(), args...) @@ -1320,7 +1320,7 @@ If `incoming` is `true`, the remote peer initiated the connection. Whichever of the pair initiates the connection sends the cluster cookie and its Julia version number to perform the authentication handshake. -See also [`cluster_cookie`](:func:`cluster_cookie`). +See also [`cluster_cookie`](@ref). """ function process_messages(r_stream::IO, w_stream::IO, incoming::Bool=true) @schedule message_handler_loop(r_stream, w_stream, incoming) @@ -1645,7 +1645,7 @@ end Called by cluster managers implementing custom transports. It initializes a newly launched process as a worker. Command line argument `--worker` has the effect of initializing a process as a worker using TCP/IP sockets for transport. -`cookie` is a [`cluster_cookie`](:func:`cluster_cookie`). +`cookie` is a [`cluster_cookie`](@ref). """ function init_worker(cookie::AbstractString, manager::ClusterManager=DefaultClusterManager()) # On workers, the default cluster manager connects via TCP sockets. Custom @@ -1946,7 +1946,7 @@ end @fetch Equivalent to `fetch(@spawn expr)`. -See [`fetch`](:func:`fetch`) and [`@spawn`](:func:`@spawn`). +See [`fetch`](@ref) and [`@spawn`](@ref). """ macro fetch(expr) expr = localize_vars(esc(:(()->($expr))), false) @@ -1960,7 +1960,7 @@ end @fetchfrom Equivalent to `fetch(@spawnat p expr)`. -See [`fetch`](:func:`fetch`) and [`@spawnat`](:func:`@spawnat`). +See [`fetch`](@ref) and [`@spawnat`](@ref). """ macro fetchfrom(p, expr) expr = localize_vars(esc(:(()->($expr))), false) @@ -1978,9 +1978,9 @@ Execute an expression under `Main` everywhere. Equivalent to calling will define `Main.bar` on all processes. -Unlike [`@spawn`](:func:`@spawn`) and [`@spawnat`](:func:`@spawnat`), +Unlike [`@spawn`](@ref) and [`@spawnat`](@ref), `@everywhere` does not capture any local variables. Prefixing -`@everywhere` with [`@eval`](:func:`@eval`) allows us to broadcast +`@everywhere` with [`@eval`](@ref) allows us to broadcast local variables using interpolation : foo = 1 @@ -2093,7 +2093,7 @@ with a final reduction on the calling process. Note that without a reducer function, `@parallel` executes asynchronously, i.e. it spawns independent tasks on all available workers and returns immediately without waiting for -completion. To wait for completion, prefix the call with [`@sync`](:func:`@sync`), like : +completion. To wait for completion, prefix the call with [`@sync`](@ref), like : @sync @parallel for var = range body diff --git a/base/multidimensional.jl b/base/multidimensional.jl index abf38cd25fd79..f3360b1561200 100644 --- a/base/multidimensional.jl +++ b/base/multidimensional.jl @@ -542,7 +542,7 @@ end """ cumsum(A, dim=1) -Cumulative sum along a dimension `dim` (defaults to 1). See also [`cumsum!`](:func:`cumsum!`) +Cumulative sum along a dimension `dim` (defaults to 1). See also [`cumsum!`](@ref) to use a preallocated output array, both for performance and to control the precision of the output (e.g. to avoid overflow). @@ -573,7 +573,7 @@ cumsum!(B, A, axis::Integer=1) = accumulate!(+, B, A, axis) cumprod(A, dim=1) Cumulative product along a dimension `dim` (defaults to 1). See also -[`cumprod!`](:func:`cumprod!`) to use a preallocated output array, both for performance and +[`cumprod!`](@ref) to use a preallocated output array, both for performance and to control the precision of the output (e.g. to avoid overflow). ```jldoctest @@ -600,10 +600,10 @@ cumprod!(B, A, axis::Integer=1) = accumulate!(*, B, A, axis) accumulate(op, A, dim=1) Cumulative operation `op` along a dimension `dim` (defaults to 1). See also -[`accumulate!`](:func:`accumulate!`) to use a preallocated output array, both for performance and +[`accumulate!`](@ref) to use a preallocated output array, both for performance and to control the precision of the output (e.g. to avoid overflow). For common operations there are specialized variants of `accumulate`, see: -[`cumsum`](:func:`cumsum`), [`cumprod`](:func:`cumprod`) +[`cumsum`](@ref), [`cumprod`](@ref) ```jldoctest julia> accumulate(+, [1,2,3]) @@ -683,7 +683,7 @@ end accumulate!(op, B, A, dim=1) Cumulative operation `op` on `A` along a dimension, storing the result in `B`. The dimension defaults to 1. -See also [`accumulate`](:func:`accumulate`). +See also [`accumulate`](@ref). """ function accumulate!(op, B, A, axis::Integer=1) axis > 0 || throw(ArgumentError("axis must be a positive integer")) diff --git a/base/multimedia.jl b/base/multimedia.jl index 3854f47bcba91..d88ba0a4c6f4b 100644 --- a/base/multimedia.jl +++ b/base/multimedia.jl @@ -31,7 +31,7 @@ end Returns a boolean value indicating whether or not the object `x` can be written as the given `mime` type. (By default, this is determined automatically by the existence of the -corresponding [`show`](:func:`show`) method for `typeof(x)`.) +corresponding [`show`](@ref) method for `typeof(x)`.) """ mimewritable{mime}(::MIME{mime}, x) = method_exists(show, Tuple{IO, MIME{mime}, typeof(x)}) @@ -78,7 +78,7 @@ _binreprmime(m::MIME, x::Vector{UInt8}) = x stringmime(mime, x) Returns an `AbstractString` containing the representation of `x` in the -requested `mime` type. This is similar to [`reprmime`](:func:`reprmime`) except +requested `mime` type. This is similar to [`reprmime`](@ref) except that binary data is base64-encoded as an ASCII string. """ stringmime(m::MIME, x) = istextmime(m) ? reprmime(m, x) : _binstringmime(m, x) diff --git a/base/nullable.jl b/base/nullable.jl index e832dd97eac74..c7082c80d5787 100644 --- a/base/nullable.jl +++ b/base/nullable.jl @@ -93,7 +93,7 @@ get(x::Nullable) = isnull(x) ? throw(NullException()) : x.value """ unsafe_get(x) -Return the value of `x` for [`Nullable`](:obj:`Nullable`) `x`; return `x` for +Return the value of `x` for [`Nullable`](@ref) `x`; return `x` for all other `x`. This method does not check whether or not `x` is null before attempting to @@ -127,7 +127,7 @@ unsafe_get(x) = x """ isnull(x) -Return whether or not `x` is null for [`Nullable`](:obj:`Nullable`) `x`; return +Return whether or not `x` is null for [`Nullable`](@ref) `x`; return `false` for all other `x`. # Examples diff --git a/base/number.jl b/base/number.jl index 21185aff75bb5..c96c3dcff8f07 100644 --- a/base/number.jl +++ b/base/number.jl @@ -104,9 +104,9 @@ _default_type(::Type{Number}) = Int """ factorial(n) -Factorial of `n`. If `n` is an [`Integer`](:obj:`Integer`), the factorial is computed as an +Factorial of `n`. If `n` is an `Integer`, the factorial is computed as an integer (promoted to at least 64 bits). Note that this may overflow if `n` is not small, but you can use `factorial(big(n))` to compute the result exactly in arbitrary precision. -If `n` is not an `Integer`, `factorial(n)` is equivalent to [`gamma(n+1)`](:func:`gamma(n+1) `). +If `n` is not an `Integer`, `factorial(n)` is equivalent to [`gamma(n+1)`](@ref). """ factorial(x::Number) = gamma(x + 1) # fallback for x not Integer diff --git a/base/operators.jl b/base/operators.jl index e4ec02d5cce86..a8c4939000c3a 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -217,7 +217,7 @@ cmp(x::Integer, y::Integer) = ifelse(isless(x,y), -1, ifelse(isless(y,x), 1, 0)) """ max(x, y, ...) -Return the maximum of the arguments. See also the [`maximum`](:func:`maximum`) function +Return the maximum of the arguments. See also the [`maximum`](@ref) function to take the maximum element from a collection. """ max(x,y) = ifelse(y < x, x, y) @@ -225,7 +225,7 @@ max(x,y) = ifelse(y < x, x, y) """ min(x, y, ...) -Return the minimum of the arguments. See also the [`minimum`](:func:`minimum`) function +Return the minimum of the arguments. See also the [`minimum`](@ref) function to take the minimum element from a collection. """ min(x,y) = ifelse(y < x, y, x) @@ -233,7 +233,7 @@ min(x,y) = ifelse(y < x, y, x) """ minmax(x, y) -Return `(min(x,y), max(x,y))`. See also: [`extrema`](:func:`extrema`) that returns `(minimum(x), maximum(x))`. +Return `(min(x,y), max(x,y))`. See also: [`extrema`](@ref) that returns `(minimum(x), maximum(x))`. ```jldoctest julia> minmax('c','b') @@ -354,7 +354,7 @@ julia> bits(Int8(3)) julia> bits(Int8(12)) "00001100" ``` -See also [`>>`](:func:`>>`), [`>>>`](:func:`>>>`). +See also [`>>`](@ref), [`>>>`](@ref). """ function <<(x::Integer, c::Integer) typemin(Int) <= c <= typemax(Int) && return x << (c % Int) @@ -392,7 +392,7 @@ julia> bits(Int8(-14)) julia> bits(Int8(-4)) "11111100" ``` -See also [`>>>`](:func:`>>>`), [`<<`](:func:`<<`). +See also [`>>>`](@ref), [`<<`](@ref). """ function >>(x::Integer, c::Integer) typemin(Int) <= c <= typemax(Int) && return x >> (c % Int) @@ -409,7 +409,7 @@ Unsigned right bit shift operator, `x >>> n`. For `n >= 0`, the result is `x` shifted right by `n` bits, where `n >= 0`, filling with `0`s. For `n < 0`, this is equivalent to `x << -n`. -For `Unsigned` integer types, this is equivalent to [`>>`](:func:`>>`). For +For `Unsigned` integer types, this is equivalent to [`>>`](@ref). For `Signed` integer types, this is equivalent to `signed(unsigned(x) >> n)`. ```jldoctest @@ -423,9 +423,9 @@ julia> bits(Int8(60)) "00111100" ``` `BigInt`s are treated as if having infinite size, so no filling is required and this -is equivalent to [`>>`](:func:`>>`). +is equivalent to [`>>`](@ref). -See also [`>>`](:func:`>>`), [`<<`](:func:`<<`). +See also [`>>`](@ref), [`<<`](@ref). """ >>>(x::Integer, c::Integer) = typemin(Int) <= c <= typemax(Int) ? x >>> (c % Int) : zero(x) diff --git a/base/osutils.jl b/base/osutils.jl index f13451c29b792..d858e84ad4b88 100644 --- a/base/osutils.jl +++ b/base/osutils.jl @@ -4,7 +4,7 @@ is_unix([os]) Predicate for testing if the OS provides a Unix-like interface. -See documentation in [Handling Operating System Variation](:ref:`Handling Operating System Variation `). +See documentation in [Handling Operating System Variation](@ref). """ function is_unix(os::Symbol) if is_windows(os) @@ -20,7 +20,7 @@ end is_linux([os]) Predicate for testing if the OS is a derivative of Linux. -See documentation in [Handling Operating System Variation](:ref:`Handling Operating System Variation `). +See documentation in [Handling Operating System Variation](@ref). """ is_linux(os::Symbol) = (os == :Linux) @@ -28,7 +28,7 @@ is_linux(os::Symbol) = (os == :Linux) is_bsd([os]) Predicate for testing if the OS is a derivative of BSD. -See documentation in [Handling Operating System Variation](:ref:`Handling Operating System Variation `). +See documentation in [Handling Operating System Variation](@ref). """ is_bsd(os::Symbol) = (os == :FreeBSD || os == :OpenBSD || os == :NetBSD || os == :Darwin || os == :Apple) @@ -36,7 +36,7 @@ is_bsd(os::Symbol) = (os == :FreeBSD || os == :OpenBSD || os == :NetBSD || os == is_windows([os]) Predicate for testing if the OS is a derivative of Microsoft Windows NT. -See documentation in [Handling Operating System Variation](:ref:`Handling Operating System Variation `). +See documentation in [Handling Operating System Variation](@ref). """ is_windows(os::Symbol) = (os == :Windows || os == :NT) @@ -44,7 +44,7 @@ is_windows(os::Symbol) = (os == :Windows || os == :NT) is_apple([os]) Predicate for testing if the OS is a derivative of Apple Macintosh OS X or Darwin. -See documentation in [Handling Operating System Variation](:ref:`Handling Operating System Variation `). +See documentation in [Handling Operating System Variation](@ref). """ is_apple(os::Symbol) = (os == :Apple || os == :Darwin) diff --git a/base/pmap.jl b/base/pmap.jl index dcc88173b2a9b..9251847b3548a 100644 --- a/base/pmap.jl +++ b/base/pmap.jl @@ -15,8 +15,7 @@ For multiple collection arguments, apply `f` elementwise. Results are returned in order as they become available. Note that `f` must be made available to all worker processes; see -[Code Availability and Loading Packages](:ref:`Code Availability -and Loading Packages `) +[Code Availability and Loading Packages](@ref) for details. """ function pgenerate(p::WorkerPool, f, c) @@ -39,8 +38,7 @@ workers and tasks. For multiple collection arguments, apply `f` elementwise. Note that `f` must be made available to all worker processes; see -[Code Availability and Loading Packages](:ref:`Code Availability -and Loading Packages `) +[Code Availability and Loading Packages](@ref) for details. If a worker pool is not specified, all available workers, i.e., the default worker pool @@ -48,7 +46,7 @@ is used. By default, `pmap` distributes the computation over all specified workers. To use only the local process and distribute over tasks, specify `distributed=false`. -This is equivalent to [`asyncmap`](:func:`asyncmap`). +This is equivalent to [`asyncmap`](@ref). `pmap` can also use a mix of processes and tasks via the `batch_size` argument. For batch sizes greater than 1, the collection is split into multiple batches, which are distributed across diff --git a/base/pointer.jl b/base/pointer.jl index 2366945f59c5c..184783033fe6b 100644 --- a/base/pointer.jl +++ b/base/pointer.jl @@ -109,7 +109,7 @@ when the array is no longer referenced. This function is labelled "unsafe" because it will crash if `p` is not a valid memory address to data of the requested length. -See also [`unsafe_string`](:func:`unsafe_string`), which takes a pointer +See also [`unsafe_string`](@ref), which takes a pointer and makes a copy of the data. """ unsafe_wrap(::Type{String}, p::Union{Ptr{UInt8},Ptr{Int8}}, len::Integer, own::Bool=false) = diff --git a/base/poll.jl b/base/poll.jl index 3721430c0da53..f5415bdbd6ae5 100644 --- a/base/poll.jl +++ b/base/poll.jl @@ -521,7 +521,7 @@ Monitor a file for changes by polling every `interval_s` seconds until a change Returns a pair of `StatStruct` objects `(previous, current)` when a change is detected. To determine when a file was modified, compare `mtime(prev) != mtime(current)` to detect -notification of changes. However, using [`watch_file`](:func:`watch_file`) for this operation is preferred, since +notification of changes. However, using [`watch_file`](@ref) for this operation is preferred, since it is more reliable and efficient, although in some situations it may not be available. """ function poll_file(s::AbstractString, interval_seconds::Real=5.007, timeout_s::Real=-1) diff --git a/base/printf.jl b/base/printf.jl index 912c24f0a8b88..21efb146add73 100644 --- a/base/printf.jl +++ b/base/printf.jl @@ -1181,7 +1181,7 @@ Print `args` using C `printf()` style format specification string, with some cav `Inf` and `NaN` are printed consistently as `Inf` and `NaN` for flags `%a`, `%A`, `%e`, `%E`, `%f`, `%F`, `%g`, and `%G`. -Optionally, an [`IOStream`](:obj:`IOStream`) +Optionally, an `IOStream` may be passed as the first argument to redirect output. # Examples diff --git a/base/profile.jl b/base/profile.jl index 25b81bb61ecee..9672b05d88834 100644 --- a/base/profile.jl +++ b/base/profile.jl @@ -152,7 +152,7 @@ end print([io::IO = STDOUT,] data::Vector, lidict::LineInfoDict; kwargs...) Prints profiling results to `io`. This variant is used to examine results exported by a -previous call to [`retrieve`](:func:`retrieve`). Supply the vector `data` of backtraces and +previous call to [`retrieve`](@ref). Supply the vector `data` of backtraces and a dictionary `lidict` of line information. See `Profile.print([io], data)` for an explanation of the valid keyword arguments. @@ -228,7 +228,7 @@ Given a previous profiling run, determine who called a particular function. Supp filename (and optionally, range of line numbers over which the function is defined) allows you to disambiguate an overloaded method. The returned value is a vector containing a count of the number of calls and line information about the caller. One can optionally supply -backtrace `data` obtained from [`retrieve`](:func:`retrieve`); otherwise, the current internal +backtrace `data` obtained from [`retrieve`](@ref); otherwise, the current internal profile buffer is used. """ function callers end @@ -260,7 +260,7 @@ callers(func::Function; kwargs...) = callers(string(func), retrieve()...; kwargs Clears any stored memory allocation data when running julia with `--track-allocation`. Execute the command(s) you want to test (to force JIT-compilation), then call -[`clear_malloc_data`](:func:`clear_malloc_data`). Then execute your command(s) again, quit +[`clear_malloc_data`](@ref). Then execute your command(s) again, quit Julia, and examine the resulting `*.mem` files. """ clear_malloc_data() = ccall(:jl_clear_malloc_data, Void, ()) @@ -289,10 +289,10 @@ error_codes = Dict( fetch() -> data Returns a reference to the internal buffer of backtraces. Note that subsequent operations, -like [`clear`](:func:`clear`), can affect `data` unless you first make a copy. Note that the +like [`clear`](@ref), can affect `data` unless you first make a copy. Note that the values in `data` have meaning only on this machine in the current session, because it depends on the exact memory addresses used in JIT-compiling. This function is primarily for -internal use; [`retrieve`](:func:`retrieve`) may be a better choice for most users. +internal use; [`retrieve`](@ref) may be a better choice for most users. """ function fetch() len = len_data() diff --git a/base/random.jl b/base/random.jl index fce69c2436b87..1e38a43052d8b 100644 --- a/base/random.jl +++ b/base/random.jl @@ -1257,7 +1257,7 @@ end randn!([rng=GLOBAL_RNG], A::AbstractArray) -> A Fill the array `A` with normally-distributed (mean 0, standard deviation 1) random numbers. -Also see the [`rand`](:func:`rand`) function. +Also see the [`rand`](@ref) function. """ function randn! end @@ -1468,7 +1468,7 @@ end """ shuffle!([rng=GLOBAL_RNG,] v) -In-place version of [`shuffle`](:func:`shuffle`): randomly permute the array `v` in-place, +In-place version of [`shuffle`](@ref): randomly permute the array `v` in-place, optionally supplying the random-number generator `rng`. """ function shuffle!(r::AbstractRNG, a::AbstractVector) @@ -1489,9 +1489,9 @@ shuffle!(a::AbstractVector) = shuffle!(GLOBAL_RNG, a) shuffle([rng=GLOBAL_RNG,] v) Return a randomly permuted copy of `v`. The optional `rng` argument specifies a random -number generator (see [Random Numbers](:ref:`Random Numbers `)). -To permute `v` in-place, see [`shuffle!`](:func:`shuffle!`). To obtain randomly permuted -indices, see [`randperm`](:func:`randperm`). +number generator (see [Random Numbers](@ref)). +To permute `v` in-place, see [`shuffle!`](@ref). To obtain randomly permuted +indices, see [`randperm`](@ref). """ shuffle(r::AbstractRNG, a::AbstractVector) = shuffle!(r, copymutable(a)) shuffle(a::AbstractVector) = shuffle(GLOBAL_RNG, a) @@ -1500,9 +1500,9 @@ shuffle(a::AbstractVector) = shuffle(GLOBAL_RNG, a) randperm([rng=GLOBAL_RNG,] n::Integer) Construct a random permutation of length `n`. The optional `rng` argument specifies a random -number generator (see [Random Numbers](:ref:`Random Numbers `)). -To randomly permute a arbitrary vector, see [`shuffle`](:func:`shuffle`) -or [`shuffle!`](:func:`shuffle!`). +number generator (see [Random Numbers](@ref)). +To randomly permute a arbitrary vector, see [`shuffle`](@ref) +or [`shuffle!`](@ref). """ function randperm(r::AbstractRNG, n::Integer) a = Array{typeof(n)}(n) @@ -1528,7 +1528,7 @@ randperm(n::Integer) = randperm(GLOBAL_RNG, n) randcycle([rng=GLOBAL_RNG,] n::Integer) Construct a random cyclic permutation of length `n`. The optional `rng` -argument specifies a random number generator, see [Random Numbers](:ref:`Random Numbers `). +argument specifies a random number generator, see [Random Numbers](@ref). """ function randcycle(r::AbstractRNG, n::Integer) a = Array{typeof(n)}(n) diff --git a/base/range.jl b/base/range.jl index 457dba926a279..e22514ccde58c 100644 --- a/base/range.jl +++ b/base/range.jl @@ -380,7 +380,7 @@ isempty(r::LinSpace) = length(r) == 0 """ step(r) -Get the step size of a [`Range`](:obj:`Range`) object. +Get the step size of a `Range` object. ```jldoctest julia> step(1:10) 1 diff --git a/base/reduce.jl b/base/reduce.jl index f8a2a37c27442..78a7ee3ccf5e6 100644 --- a/base/reduce.jl +++ b/base/reduce.jl @@ -52,7 +52,7 @@ end """ mapfoldl(f, op, v0, itr) -Like [`mapreduce`](:func:`mapreduce`), but with guaranteed left associativity. `v0` will be +Like [`mapreduce`](@ref), but with guaranteed left associativity. `v0` will be used exactly once. """ mapfoldl(f, op, v0, itr) = mapfoldl_impl(f, op, v0, itr, start(itr)) @@ -76,7 +76,7 @@ end """ foldl(op, v0, itr) -Like [`reduce`](:func:`reduce`), but with guaranteed left associativity. `v0` will be used +Like [`reduce`](@ref), but with guaranteed left associativity. `v0` will be used exactly once. """ foldl(op, v0, itr) = mapfoldl(identity, op, v0, itr) @@ -110,7 +110,7 @@ end """ mapfoldr(f, op, v0, itr) -Like [`mapreduce`](:func:`mapreduce`), but with guaranteed right associativity. `v0` will be +Like [`mapreduce`](@ref), but with guaranteed right associativity. `v0` will be used exactly once. """ mapfoldr(f, op, v0, itr) = mapfoldr_impl(f, op, v0, itr, endof(itr)) @@ -126,7 +126,7 @@ mapfoldr(f, op, itr) = (i = endof(itr); mapfoldr_impl(f, op, f(itr[i]), itr, i-1 """ foldr(op, v0, itr) -Like [`reduce`](:func:`reduce`), but with guaranteed right associativity. `v0` will be used +Like [`reduce`](@ref), but with guaranteed right associativity. `v0` will be used exactly once. """ foldr(op, v0, itr) = mapfoldr(identity, op, v0, itr) @@ -176,9 +176,9 @@ Apply function `f` to each element in `itr`, and then reduce the result using th function `op`. `v0` must be a neutral element for `op` that will be returned for empty collections. It is unspecified whether `v0` is used for non-empty collections. -[`mapreduce`](:func:`mapreduce`) is functionally equivalent to calling `reduce(op, v0, +[`mapreduce`](@ref) is functionally equivalent to calling `reduce(op, v0, map(f, itr))`, but will in general execute faster since no intermediate collection needs to -be created. See documentation for [`reduce`](:func:`reduce`) and [`map`](:func:`map`). +be created. See documentation for [`reduce`](@ref) and [`map`](@ref). ```jldoctest julia> mapreduce(x->x^2, +, [1:3;]) # == 1 + 4 + 9 @@ -187,7 +187,7 @@ julia> mapreduce(x->x^2, +, [1:3;]) # == 1 + 4 + 9 The associativity of the reduction is implementation-dependent. Additionally, some implementations may reuse the return value of `f` for elements that appear multiple times in -`itr`. Use [`mapfoldl`](:func:`mapfoldl`) or [`mapfoldr`](:func:`mapfoldr`) instead for +`itr`. Use [`mapfoldl`](@ref) or [`mapfoldr`](@ref) instead for guaranteed left or right associativity and invocation of `f` for every value. """ mapreduce(f, op, v0, itr) = mapfoldl(f, op, v0, itr) @@ -264,8 +264,8 @@ used instead: `maximum(itr)`, `minimum(itr)`, `sum(itr)`, `prod(itr)`, `any(itr) The associativity of the reduction is implementation dependent. This means that you can't use non-associative operations like `-` because it is undefined whether `reduce(-,[1,2,3])` -should be evaluated as `(1-2)-3` or `1-(2-3)`. Use [`foldl`](:func:`foldl`) or -[`foldr`](:func:`foldr`) instead for guaranteed left or right associativity. +should be evaluated as `(1-2)-3` or `1-(2-3)`. Use [`foldl`](@ref) or +[`foldr`](@ref) instead for guaranteed left or right associativity. Some operations accumulate error, and parallelism will also be easier if the reduction can be executed in groups. Future versions of Julia might change the algorithm. Note that the @@ -613,10 +613,10 @@ all(f::typeof(identity), itr) = Determine whether an item is in the given collection, in the sense that it is `==` to one of the values generated by iterating over the collection. Some collections need a slightly -different definition; for example [`Set`](:obj:`Set`)s check whether the item -[`isequal`](:func:`isequal`) to one of the elements. [`Dict`](:obj:`Dict`)s look for -`(key,value)` pairs, and the key is compared using [`isequal`](:func:`isequal`). To test for -the presence of a key in a dictionary, use [`haskey`](:func:`haskey`) or `k in keys(dict)`. +different definition; for example [`Set`](@ref)s check whether the item +[`isequal`](@ref) to one of the elements. [`Dict`](@ref)s look for +`(key,value)` pairs, and the key is compared using [`isequal`](@ref). To test for +the presence of a key in a dictionary, use [`haskey`](@ref) or `k in keys(dict)`. ```jldoctest julia> a = 1:3:20 @@ -668,7 +668,7 @@ end countnz(A) Counts the number of nonzero values in array `A` (dense or sparse). Note that this is not a constant-time operation. -For sparse matrices, one should usually use [`nnz`](:func:`nnz`), which returns the number of stored values. +For sparse matrices, one should usually use [`nnz`](@ref), which returns the number of stored values. ```jldoctest julia> A = [1 2 4; 0 0 1; 1 1 0] diff --git a/base/reducedim.jl b/base/reducedim.jl index e52b5a1d990d8..86c7048edcec7 100644 --- a/base/reducedim.jl +++ b/base/reducedim.jl @@ -250,7 +250,7 @@ dimensions to reduce, and `v0` is the initial value to use in the reductions. Fo The associativity of the reduction is implementation-dependent; if you need a particular associativity, e.g. left-to-right, you should write your own loop. See documentation for -[`reduce`](:func:`reduce`). +[`reduce`](@ref). ```jldoctest julia> a = reshape(collect(1:16), (4,4)) diff --git a/base/reflection.jl b/base/reflection.jl index ac9784bcea1ba..6dda825683c6a 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -161,7 +161,7 @@ isconst(s::Symbol) = ccall(:jl_is_const, Cint, (Ptr{Void}, Any), C_NULL, s) != 0 isconst([m::Module], s::Symbol) -> Bool Determine whether a global is declared `const` in a given `Module`. The default `Module` -argument is [`current_module()`](:func:`current_module`). +argument is [`current_module()`](@ref). """ isconst(m::Module, s::Symbol) = ccall(:jl_is_const, Cint, (Any, Any), m, s) != 0 @@ -195,7 +195,7 @@ datatype_fielddesc_type(dt::DataType) = dt.layout == C_NULL ? throw(UndefRefErro """ isimmutable(v) -Return `true` iff value `v` is immutable. See [manual](:ref:`man-immutable-composite-types`) +Return `true` iff value `v` is immutable. See [Immutable Composite Types](@ref) for a discussion of immutability. Note that this function works on values, so if you give it a type, it will tell you that a value of `DataType` is mutable. """ @@ -755,7 +755,7 @@ end method_exists(f, Tuple type) -> Bool Determine whether the given generic function has a method matching the given -[`Tuple`](:obj:`Tuple`) of argument types. +`Tuple` of argument types. ```jldoctest julia> method_exists(length, Tuple{Array}) diff --git a/base/rounding.jl b/base/rounding.jl index c4c58352e8a90..fb4476004e638 100644 --- a/base/rounding.jl +++ b/base/rounding.jl @@ -27,19 +27,19 @@ export RoundingMode A type used for controlling the rounding mode of floating point operations (via -[`rounding`](:func:`rounding`)/[`setrounding`](:func:`setrounding`) functions), or as -optional arguments for rounding to the nearest integer (via the [`round`](:func:`round`) +[`rounding`](@ref)/[`setrounding`](@ref) functions), or as +optional arguments for rounding to the nearest integer (via the [`round`](@ref) function). Currently supported rounding modes are: -- [`RoundNearest`](:obj:`RoundNearest`) (default) -- [`RoundNearestTiesAway`](:obj:`RoundNearestTiesAway`) -- [`RoundNearestTiesUp`](:obj:`RoundNearestTiesUp`) -- [`RoundToZero`](:obj:`RoundToZero`) -- [`RoundFromZero`](:obj:`RoundFromZero`) (`BigFloat` only) -- [`RoundUp`](:obj:`RoundUp`) -- [`RoundDown`](:obj:`RoundDown`) +- [`RoundNearest`](@ref) (default) +- [`RoundNearestTiesAway`](@ref) +- [`RoundNearestTiesUp`](@ref) +- [`RoundToZero`](@ref) +- `RoundFromZero` (`BigFloat` only) +- [`RoundUp`](@ref) +- [`RoundDown`](@ref) """ immutable RoundingMode{T} end @@ -54,21 +54,21 @@ const RoundNearest = RoundingMode{:Nearest}() """ RoundToZero -[`round`](:func:`round`) using this rounding mode is an alias for [`trunc`](:func:`trunc`). +[`round`](@ref) using this rounding mode is an alias for [`trunc`](@ref). """ const RoundToZero = RoundingMode{:ToZero}() """ RoundUp -[`round`](:func:`round`) using this rounding mode is an alias for [`ceil`](:func:`ceil`). +[`round`](@ref) using this rounding mode is an alias for [`ceil`](@ref). """ const RoundUp = RoundingMode{:Up}() """ RoundDown -[`round`](:func:`round`) using this rounding mode is an alias for [`floor`](:func:`floor`). +[`round`](@ref) using this rounding mode is an alias for [`floor`](@ref). """ const RoundDown = RoundingMode{:Down}() @@ -78,7 +78,7 @@ const RoundFromZero = RoundingMode{:FromZero}() # mpfr only RoundNearestTiesAway Rounds to nearest integer, with ties rounded away from zero (C/C++ -[`round`](:func:`round`) behaviour). +[`round`](@ref) behaviour). """ const RoundNearestTiesAway = RoundingMode{:NearestTiesAway}() @@ -86,7 +86,7 @@ const RoundNearestTiesAway = RoundingMode{:NearestTiesAway}() RoundNearestTiesUp Rounds to nearest integer, with ties rounded toward positive infinity (Java/JavaScript -[`round`](:func:`round`) behaviour). +[`round`](@ref) behaviour). """ const RoundNearestTiesUp = RoundingMode{:NearestTiesUp}() @@ -113,13 +113,13 @@ end setrounding(T, mode) Set the rounding mode of floating point type `T`, controlling the rounding of basic -arithmetic functions ([`+`](:func:`+`), [`-`](:func:`-`), [`*`](:func:`*`), -[`/`](:func:`/`) and [`sqrt`](:func:`sqrt`)) and type conversion. Other numerical +arithmetic functions ([`+`](@ref), [`-`](@ref), [`*`](@ref), +[`/`](@ref) and [`sqrt`](@ref)) and type conversion. Other numerical functions may give incorrect or invalid values when using rounding modes other than the default `RoundNearest`. Note that this may affect other types, for instance changing the rounding mode of `Float64` -will change the rounding mode of `Float32`. See [`RoundingMode`](:obj:`RoundingMode`) for +will change the rounding mode of `Float32`. See [`RoundingMode`](@ref) for available modes. !!! warning @@ -132,10 +132,10 @@ setrounding(T::Type, mode) rounding(T) Get the current floating point rounding mode for type `T`, controlling the rounding of basic -arithmetic functions ([`+`](:func:`+`), [`-`](:func:`-`), [`*`](:func:`*`), [`/`](:func:`/`) -and [`sqrt`](:func:`sqrt`)) and type conversion. +arithmetic functions ([`+`](@ref), [`-`](@ref), [`*`](@ref), [`/`](@ref) +and [`sqrt`](@ref)) and type conversion. -See [`RoundingMode`](:obj:`RoundingMode`) for available modes. +See [`RoundingMode`](@ref) for available modes. """ :rounding @@ -156,7 +156,7 @@ equivalent to: f() setrounding(T, old) -See [`RoundingMode`](:obj:`RoundingMode`) for available rounding modes. +See [`RoundingMode`](@ref) for available rounding modes. !!! warning diff --git a/base/sharedarray.jl b/base/sharedarray.jl index 601f0f97f9f0d..5dbfb58a407b9 100644 --- a/base/sharedarray.jl +++ b/base/sharedarray.jl @@ -282,7 +282,7 @@ Returns a range describing the "default" indexes to be handled by the current process. This range should be interpreted in the sense of linear indexing, i.e., as a sub-range of `1:length(S)`. In multi-process contexts, returns an empty range in the parent process -(or any process for which [`indexpids`](:func:`indexpids`) returns 0). +(or any process for which [`indexpids`](@ref) returns 0). It's worth emphasizing that `localindexes` exists purely as a convenience, and you can partition work on the array among workers any diff --git a/base/show.jl b/base/show.jl index 56b3caa83c594..e9e5e0a851c95 100644 --- a/base/show.jl +++ b/base/show.jl @@ -5,10 +5,10 @@ print(io::IO, s::Symbol) = (write(io,s); nothing) """ IOContext -`IOContext` provides a mechanism for passing output configuration settings among [`show`](:func:`show`) methods. +`IOContext` provides a mechanism for passing output configuration settings among [`show`](@ref) methods. -In short, it is an immutable dictionary that is a subclass of [`IO`](:obj:`IO`). It supports standard -dictionary operations such as [`getindex`](:func:`getindex`), and can also be used as an I/O stream. +In short, it is an immutable dictionary that is a subclass of `IO`. It supports standard +dictionary operations such as [`getindex`](@ref), and can also be used as an I/O stream. """ immutable IOContext{IO_t <: IO} <: AbstractPipe io::IO_t @@ -43,7 +43,7 @@ IOContext(io::IO, context::IO) = IOContext(io) """ IOContext(io::IO, context::IOContext) -Create an `IOContext` that wraps an alternate [`IO`](:func:`IO`) but inherits the properties of `context`. +Create an `IOContext` that wraps an alternate `IO` but inherits the properties of `context`. """ IOContext(io::IO, context::IOContext) = IOContext(io, context.dict) diff --git a/base/socket.jl b/base/socket.jl index edb4be9cabde7..ee1a9b34a63eb 100644 --- a/base/socket.jl +++ b/base/socket.jl @@ -755,7 +755,7 @@ Listen on port on the address specified by `addr`. By default this listens on `localhost` only. To listen on all interfaces pass `IPv4(0)` or `IPv6(0)` as appropriate. `backlog` determines how many connections can be pending (not having -called [`accept`](:func:`accept`)) before the server will begin to +called [`accept`](@ref)) before the server will begin to reject them. The default value of `backlog` is 511. """ function listen(addr; backlog::Integer=BACKLOG_DEFAULT) @@ -832,8 +832,8 @@ listenany(default_port) = listenany(IPv4(UInt32(0)), default_port) """ getsockname(sock::Union{TCPServer, TCPSocket}) -> (IPAddr, UInt16) -Get the IP address and the port that the given [`TCPSocket`](:obj:`TCPSocket`) is connected to -(or bound to, in the case of [`TCPServer`](:obj:`TCPServer`)). +Get the IP address and the port that the given `TCPSocket` is connected to +(or bound to, in the case of `TCPServer`). """ function getsockname(sock::Union{TCPServer,TCPSocket}) rport = Ref{Cushort}(0) diff --git a/base/sort.jl b/base/sort.jl index 2748e4812f2be..e5cff84935a17 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -59,7 +59,7 @@ end issorted(v, by=identity, rev:Bool=false, order::Ordering=Forward) Test whether a vector is in sorted order. The `by`, `lt` and `rev` keywords modify what -order is considered to be sorted just as they do for [`sort`](:func:`sort`). +order is considered to be sorted just as they do for [`sort`](@ref). """ issorted(itr; lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward) = @@ -478,7 +478,7 @@ end """ sort(v; alg::Algorithm=defalg(v), lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward) -Variant of [`sort!`](:func:`sort!`) that returns a sorted copy of `v` leaving `v` itself unmodified. +Variant of [`sort!`](@ref) that returns a sorted copy of `v` leaving `v` itself unmodified. """ sort(v::AbstractVector; kws...) = sort!(copymutable(v); kws...) @@ -518,7 +518,7 @@ appear in ascending order. If you choose a non-stable sorting algorithm such as a different permutation that puts the array into order may be returned. The order is specified using the same keywords as `sort!`. -See also [`sortperm!`](:func:`sortperm!`). +See also [`sortperm!`](@ref). """ function sortperm(v::AbstractVector; alg::Algorithm=DEFAULT_UNSTABLE, @@ -549,7 +549,7 @@ end """ sortperm!(ix, v; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward, initialized::Bool=false) -Like [`sortperm`](:func:`sortperm`), but accepts a preallocated index vector `ix`. If `initialized` is `false` +Like [`sortperm`](@ref), but accepts a preallocated index vector `ix`. If `initialized` is `false` (the default), ix is initialized to contain the values `1:length(v)`. """ function sortperm!{I<:Integer}(x::AbstractVector{I}, v::AbstractVector; @@ -598,7 +598,7 @@ end sort(A, dim::Integer; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward, initialized::Bool=false) Sort a multidimensional array `A` along the given dimension. -See [`sort!`](:func:`sort!`) for a description of possible +See [`sort!`](@ref) for a description of possible keyword arguments. """ function sort(A::AbstractArray, dim::Integer; @@ -636,7 +636,7 @@ end sortrows(A; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward) Sort the rows of matrix `A` lexicographically. -See [`sort!`](:func:`sort!`) for a description of possible +See [`sort!`](@ref) for a description of possible keyword arguments. """ function sortrows(A::AbstractMatrix; kws...) @@ -654,7 +654,7 @@ end sortcols(A; alg::Algorithm=DEFAULT_UNSTABLE, lt=isless, by=identity, rev::Bool=false, order::Ordering=Forward) Sort the columns of matrix `A` lexicographically. -See [`sort!`](:func:`sort!`) for a description of possible +See [`sort!`](@ref) for a description of possible keyword arguments. """ function sortcols(A::AbstractMatrix; kws...) diff --git a/base/sparse/cholmod.jl b/base/sparse/cholmod.jl index c35a2653a1494..fdb43ac9113d3 100644 --- a/base/sparse/cholmod.jl +++ b/base/sparse/cholmod.jl @@ -1264,7 +1264,7 @@ factorization `F`. `A` must be a `SparseMatrixCSC`, `Symmetric{SparseMatrixCSC}` or `Hermitian{SparseMatrixCSC}`. Note that even if `A` doesn't have the type tag, it must still be symmetric or Hermitian. -See also [`cholfact`](:func:`cholfact`). +See also [`cholfact`](@ref). !!! note This method uses the CHOLMOD library from SuiteSparse, which only supports @@ -1306,8 +1306,8 @@ Compute the Cholesky factorization of a sparse positive definite matrix `A`. have the type tag, it must still be symmetric or Hermitian. A fill-reducing permutation is used. `F = cholfact(A)` is most frequently used to solve systems of equations with `F\\b`, -but also the methods [`diag`](:func:`diag`), [`det`](:func:`det`), and -[`logdet`](:func:`logdet`) are defined for `F`. +but also the methods [`diag`](@ref), [`det`](@ref), and +[`logdet`](@ref) are defined for `F`. You can also extract individual factors from `F`, using `F[:L]`. However, since pivoting is on by default, the factorization is internally represented as `A == P'*L*L'*P` with a permutation matrix `P`; @@ -1356,7 +1356,7 @@ Compute the ``LDL'`` factorization of `A`, reusing the symbolic factorization `F `Hermitian{SparseMatrixCSC}`. Note that even if `A` doesn't have the type tag, it must still be symmetric or Hermitian. -See also [`ldltfact`](:func:`ldltfact`). +See also [`ldltfact`](@ref). !!! note This method uses the CHOLMOD library from SuiteSparse, which only supports @@ -1403,8 +1403,8 @@ Compute the ``LDL'`` factorization of a sparse matrix `A`. have the type tag, it must still be symmetric or Hermitian. A fill-reducing permutation is used. `F = ldltfact(A)` is most frequently used to solve systems of equations `A*x = b` with `F\\b`. The returned -factorization object `F` also supports the methods [`diag`](:func:`diag`), -[`det`](:func:`det`), and [`logdet`](:func:`logdet`). +factorization object `F` also supports the methods [`diag`](@ref), +[`det`](@ref), and [`logdet`](@ref). You can extract individual factors from `F` using `F[:L]`. However, since pivoting is on by default, the factorization is internally represented as `A == P'*L*D*L'*P` with a permutation matrix `P`; diff --git a/base/sparse/sparsematrix.jl b/base/sparse/sparsematrix.jl index f1f6a4a2bfd10..66cf1a22e8c3d 100644 --- a/base/sparse/sparsematrix.jl +++ b/base/sparse/sparsematrix.jl @@ -52,7 +52,7 @@ Return a vector of the structural nonzero values in sparse array `A`. This includes zeros that are explicitly stored in the sparse array. The returned vector points directly to the internal nonzero storage of `A`, and any modifications to the returned vector will mutate `A` as well. See -[`rowvals`](:func:`rowvals`) and [`nzrange`](:func:`nzrange`). +[`rowvals`](@ref) and [`nzrange`](@ref). ```jldoctest julia> A = speye(3) @@ -76,7 +76,7 @@ nonzeros(S::SparseMatrixCSC) = S.nzval Return a vector of the row indices of `A`. Any modifications to the returned vector will mutate `A` as well. Providing access to how the row indices are stored internally can be useful in conjunction with iterating over structural -nonzero values. See also [`nonzeros`](:func:`nonzeros`) and [`nzrange`](:func:`nzrange`). +nonzero values. See also [`nonzeros`](@ref) and [`nzrange`](@ref). ```jldoctest julia> A = speye(3) @@ -98,8 +98,8 @@ rowvals(S::SparseMatrixCSC) = S.rowval nzrange(A::SparseMatrixCSC, col::Integer) Return the range of indices to the structural nonzero values of a sparse matrix -column. In conjunction with [`nonzeros`](:func:`nonzeros`) and -[`rowvals`](:func:`rowvals`), this allows for convenient iterating over a sparse matrix : +column. In conjunction with [`nonzeros`](@ref) and +[`rowvals`](@ref), this allows for convenient iterating over a sparse matrix : A = sparse(I,J,V) rows = rowvals(A) @@ -443,7 +443,7 @@ are set to `maximum(I)` and `maximum(J)` respectively. If the `combine` function supplied, `combine` defaults to `+` unless the elements of `V` are Booleans in which case `combine` defaults to `|`. All elements of `I` must satisfy `1 <= I[k] <= m`, and all elements of `J` must satisfy `1 <= J[k] <= n`. Numerical zeros in (`I`, `J`, `V`) are -retained as structural nonzeros; to drop numerical zeros, use [`dropzeros!`](:func:`dropzeros!`). +retained as structural nonzeros; to drop numerical zeros, use [`dropzeros!`](@ref). For additional documentation and an expert driver, see `Base.SparseArrays.sparse!`. @@ -509,8 +509,8 @@ sparse(I::AbstractVector, J::AbstractVector, V::AbstractVector, m::Integer, n::I csrrowptr::Vector{Ti}, csrcolval::Vector{Ti}, csrnzval::Vector{Tv}, [csccolptr::Vector{Ti}], [cscrowval::Vector{Ti}, cscnzval::Vector{Tv}] ) -Parent of and expert driver for [`sparse`](:func:`sparse`); -see [`sparse`](:func:`sparse`) for basic usage. This method +Parent of and expert driver for [`sparse`](@ref); +see [`sparse`](@ref) for basic usage. This method allows the user to provide preallocated storage for `sparse`'s intermediate objects and result as described below. This capability enables more efficient successive construction of `SparseMatrixCSC`s from coordinate representations, and also enables extraction of an @@ -802,7 +802,7 @@ ctranspose{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}) = ftranspose(A, conj) A::SparseMatrixCSC{Tv,Ti}, p::AbstractVector{Tp}, q::AbstractVector{Tq}, C::SparseMatrixCSC{Tv,Ti}) -See [`permute!`](:func:`Base.SparseArrays.permute!`) for basic usage. Parent of `permute[!]` +See [`permute!`](@ref) for basic usage. Parent of `permute[!]` methods operating on `SparseMatrixCSC`s that assume none of `X`, `A`, and `C` alias each other. As this method performs no argument checking, prefer the safer child methods (`permute[!]`) to direct use. @@ -817,7 +817,7 @@ avoids an unnecessary length-`nnz(A)` array-sweep and associated recomputation o pointers. See [`halfperm!`](:func:Base.SparseArrays.halfperm!) for additional algorithmic information. -See also: [`unchecked_aliasing_permute!`](:func:`Base.SparseArrays.unchecked_aliasing_permute!`) +See also: `unchecked_aliasing_permute!` """ function unchecked_noalias_permute!{Tv,Ti,Tp<:Integer,Tq<:Integer}(X::SparseMatrixCSC{Tv,Ti}, A::SparseMatrixCSC{Tv,Ti}, p::AbstractVector{Tp}, q::AbstractVector{Tq}, @@ -832,9 +832,9 @@ end A::SparseMatrixCSC{Tv,Ti}, p::AbstractVector{Tp}, q::AbstractVector{Tq}, C::SparseMatrixCSC{Tv,Ti}, workcolptr::Vector{Ti}) -See [`permute!`](:func:`Base.SparseArrays.permute!`) for basic usage. Parent of `permute!` +See [`permute!`](@ref) for basic usage. Parent of `permute!` methods operating on `SparseMatrixCSC`s where the source and destination matrices are the -same. See [`unchecked_noalias_permute!`](:func:`Base.SparseArrays.unchecked_noalias_permute`) +same. See `unchecked_noalias_permute!` for additional information; these methods are identical but for this method's requirement of the additional `workcolptr`, `length(workcolptr) >= A.n + 1`, which enables efficient handling of the source-destination aliasing. @@ -987,10 +987,10 @@ must have enough storage to accommodate all allocated entries in `A` (`length(C. and `length(C.nzval) >= nnz(A)`). For additional (algorithmic) information, and for versions of these methods that forgo -argument checking, see (unexported) parent methods [`unchecked_noalias_permute!`](:func:`Base.SparseArrays.unchecked_noalias_permute!`) -and [`unchecked_aliasing_permute!`](:func:`Base.SparseArrays.unchecked_aliasing_permute!`). +argument checking, see (unexported) parent methods `unchecked_noalias_permute!` +and `unchecked_aliasing_permute!`. -See also: [`permute`](:func:`Base.SparseArrays.permute`) +See also: [`permute`](@ref) """ function permute!{Tv,Ti,Tp<:Integer,Tq<:Integer}(X::SparseMatrixCSC{Tv,Ti}, A::SparseMatrixCSC{Tv,Ti}, p::AbstractVector{Tp}, q::AbstractVector{Tq}) @@ -1042,7 +1042,7 @@ Bilaterally permute `A`, returning `PAQ` (`A[p,q]`). Column-permutation `q`'s le match `A`'s column count (`length(q) == A.n`). Row-permutation `p`'s length must match `A`'s row count (`length(p) == A.m`). -For expert drivers and additional information, see [`permute!`](:func:`Base.SparseArrays.permute!`). +For expert drivers and additional information, see [`permute!`](@ref). """ function permute{Tv,Ti,Tp<:Integer,Tq<:Integer}(A::SparseMatrixCSC{Tv,Ti}, p::AbstractVector{Tp}, q::AbstractVector{Tq}) @@ -1131,8 +1131,8 @@ droptol!(A::SparseMatrixCSC, tol, trim::Bool = true) = Removes stored numerical zeros from `A`, optionally trimming resulting excess space from `A.rowval` and `A.nzval` when `trim` is `true`. -For an out-of-place version, see [`dropzeros`](:func:`dropzeros`). For -algorithmic information, see [`Base.SparseArrays.fkeep!`](:func:`Base.SparseArrays.fkeep!`). +For an out-of-place version, see [`dropzeros`](@ref). For +algorithmic information, see `fkeep!`. """ dropzeros!(A::SparseMatrixCSC, trim::Bool = true) = fkeep!(A, (i, j, x) -> x != 0, trim) """ @@ -1141,7 +1141,7 @@ dropzeros!(A::SparseMatrixCSC, trim::Bool = true) = fkeep!(A, (i, j, x) -> x != Generates a copy of `A` and removes stored numerical zeros from that copy, optionally trimming excess space from the result's `rowval` and `nzval` arrays when `trim` is `true`. -For an in-place version and algorithmic information, see [`dropzeros!`](:func:`dropzeros!`). +For an in-place version and algorithmic information, see [`dropzeros!`](@ref). """ dropzeros(A::SparseMatrixCSC, trim::Bool = true) = dropzeros!(copy(A), trim) @@ -1250,7 +1250,7 @@ which the probability of any element being nonzero is independently given by `p` (and hence the mean density of nonzeros is also exactly `p`). Nonzero values are sampled from the distribution specified by `rfn` and have the type `type`. The uniform distribution is used in case `rfn` is not specified. The optional `rng` -argument specifies a random number generator, see [Random Numbers](:ref:`Random Numbers `). +argument specifies a random number generator, see [Random Numbers](@ref). """ function sprand{T}(r::AbstractRNG, m::Integer, n::Integer, density::AbstractFloat, rfn::Function, ::Type{T}=eltype(rfn(r,1))) @@ -1288,7 +1288,7 @@ sprand{T}(::Type{T}, m::Integer, n::Integer, density::AbstractFloat) = sprand(GL Create a random sparse vector of length `m` or sparse matrix of size `m` by `n` with the specified (independent) probability `p` of any entry being nonzero, where nonzero values are sampled from the normal distribution. The optional `rng` -argument specifies a random number generator, see [Random Numbers](:ref:`Random Numbers `). +argument specifies a random number generator, see [Random Numbers](@ref). """ sprandn(r::AbstractRNG, m::Integer, n::Integer, density::AbstractFloat) = sprand(r,m,n,density,randn,Float64) sprandn(m::Integer, n::Integer, density::AbstractFloat) = sprandn(GLOBAL_RNG,m,n,density) @@ -1316,7 +1316,7 @@ julia> spones(A) [2, 4] = 1.0 ``` -Note the difference from [`speye`](:func:`speye`). +Note the difference from [`speye`](@ref). """ spones{T}(S::SparseMatrixCSC{T}) = SparseMatrixCSC(S.m, S.n, copy(S.colptr), copy(S.rowval), ones(T, S.colptr[end]-1)) @@ -1363,7 +1363,7 @@ julia> speye(A) [4, 4] = 1.0 ``` -Note the difference from [`spones`](:func:`spones`). +Note the difference from [`spones`](@ref). """ speye{T}(S::SparseMatrixCSC{T}) = speye(T, size(S, 1), size(S, 2)) eye(S::SparseMatrixCSC) = speye(S) diff --git a/base/sparse/sparsevector.jl b/base/sparse/sparsevector.jl index baf2e485e208f..38707df8eedaf 100644 --- a/base/sparse/sparsevector.jl +++ b/base/sparse/sparsevector.jl @@ -1846,8 +1846,8 @@ droptol!(x::SparseVector, tol, trim::Bool = true) = fkeep!(x, (i, x) -> abs(x) > Removes stored numerical zeros from `x`, optionally trimming resulting excess space from `x.nzind` and `x.nzval` when `trim` is `true`. -For an out-of-place version, see [`dropzeros`](:func:`Base.SparseArrays.dropzeros`). For -algorithmic information, see [`Base.SparseArrays.fkeep!`](:func:`Base.SparseArrays.fkeep!`). +For an out-of-place version, see [`dropzeros`](@ref). For +algorithmic information, see `fkeep!`. """ dropzeros!(x::SparseVector, trim::Bool = true) = fkeep!(x, (i, x) -> x != 0, trim) """ @@ -1856,7 +1856,7 @@ dropzeros!(x::SparseVector, trim::Bool = true) = fkeep!(x, (i, x) -> x != 0, tri Generates a copy of `x` and removes numerical zeros from that copy, optionally trimming excess space from the result's `nzind` and `nzval` arrays when `trim` is `true`. -For an in-place version and algorithmic information, see [`dropzeros!`](:func:`Base.SparseArrays.dropzeros!`). +For an in-place version and algorithmic information, see [`dropzeros!`](@ref). """ dropzeros(x::SparseVector, trim::Bool = true) = dropzeros!(copy(x), trim) diff --git a/base/sparse/umfpack.jl b/base/sparse/umfpack.jl index 673617a4fc8e7..34f6ccce8e41a 100644 --- a/base/sparse/umfpack.jl +++ b/base/sparse/umfpack.jl @@ -127,9 +127,9 @@ The relation between `F` and `A` is `F` further supports the following functions: -- [`\\`](:func:`\\`) -- [`cond`](:func:`cond`) -- [`det`](:func:`det`) +- [`\\`](@ref) +- [`cond`](@ref) +- [`det`](@ref) ** Implementation note ** diff --git a/base/special/bessel.jl b/base/special/bessel.jl index bdd8068347f41..b969ca2bf2221 100644 --- a/base/special/bessel.jl +++ b/base/special/bessel.jl @@ -228,9 +228,9 @@ end besselh(nu, [k=1,] x) Bessel function of the third kind of order `nu` (the Hankel function). `k` is either 1 or 2, -selecting [`hankelh1`](:func:`hankelh1`) or [`hankelh2`](:func:`hankelh2`), respectively. +selecting [`hankelh1`](@ref) or [`hankelh2`](@ref), respectively. `k` defaults to 1 if it is omitted. -(See also [`besselhx`](:func:`besselhx`) for an exponentially scaled variant.) +(See also [`besselhx`](@ref) for an exponentially scaled variant.) """ function besselh end @@ -251,7 +251,7 @@ Compute the scaled Hankel function ``\\exp(∓iz) H_ν^{(k)}(z)``, where The reason for this function is that ``H_ν^{(k)}(z)`` is asymptotically proportional to ``\\exp(∓iz)/\\sqrt{z}`` for large ``|z|``, and so the -[`besselh`](:func:`besselh`) function is susceptible to overflow or underflow +[`besselh`](@ref) function is susceptible to overflow or underflow when `z` has a large imaginary part. The `besselhx` function cancels this exponential factor (analytically), so it avoids these problems. """ diff --git a/base/special/gamma.jl b/base/special/gamma.jl index e51ae4ca20624..48f925885c428 100644 --- a/base/special/gamma.jl +++ b/base/special/gamma.jl @@ -34,8 +34,8 @@ lfact(x::Real) = (x<=1 ? zero(float(x)) : lgamma(x+one(x))) """ lgamma(x) -Compute the logarithm of the absolute value of [`gamma`](:func:`gamma`) for -[`Real`](:obj:`Real`) `x`, while for [`Complex`](:obj:`Complex`) `x` it computes the +Compute the logarithm of the absolute value of [`gamma`](@ref) for +`Real` `x`, while for `Complex` `x` it computes the principal branch cut of the logarithm of `gamma(x)` (defined for negative `real(x)` by analytic continuation from positive `real(x)`). """ @@ -145,7 +145,7 @@ gamma(z::Complex) = exp(lgamma(z)) """ digamma(x) -Compute the digamma function of `x` (the logarithmic derivative of [`gamma(x)`](:func:`gamma`)). +Compute the digamma function of `x` (the logarithmic derivative of [`gamma(x)`](@ref)). """ function digamma(z::Union{Float64,Complex{Float64}}) # Based on eq. (12), without looking at the accompanying source @@ -179,7 +179,7 @@ end """ trigamma(x) -Compute the trigamma function of `x` (the logarithmic second derivative of [`gamma(x)`](:func:`gamma`)). +Compute the trigamma function of `x` (the logarithmic second derivative of [`gamma(x)`](@ref)). """ function trigamma(z::Union{Float64,Complex{Float64}}) # via the derivative of the Kölbig digamma formulation @@ -447,7 +447,7 @@ end polygamma(m, x) Compute the polygamma function of order `m` of argument `x` (the `(m+1)th` derivative of the -logarithm of [`gamma(x)`](:func:`gamma`)) +logarithm of [`gamma(x)`](@ref)) """ function polygamma(m::Integer, z::Union{Float64,Complex{Float64}}) m == 0 && return digamma(z) @@ -535,7 +535,7 @@ invdigamma(x::Float32) = Float32(invdigamma(Float64(x))) """ invdigamma(x) -Compute the inverse [`digamma`](:func:`digamma`) function of `x`. +Compute the inverse [`digamma`](@ref) function of `x`. """ invdigamma(x::Real) = invdigamma(Float64(x)) @@ -554,7 +554,7 @@ end """ lbeta(x, y) -Natural logarithm of the absolute value of the [`beta`](:func:`beta`) +Natural logarithm of the absolute value of the [`beta`](@ref) function ``\\log(|\\operatorname{B}(x,y)|)``. """ lbeta(x::Number, w::Number) = lgamma(x)+lgamma(w)-lgamma(x+w) diff --git a/base/stat.jl b/base/stat.jl index 073efd3d0b954..7e102c57fc3b2 100644 --- a/base/stat.jl +++ b/base/stat.jl @@ -107,7 +107,7 @@ stat(path...) = stat(joinpath(path...)) """ lstat(file) -Like [`stat`](:func:`stat`), but for symbolic links gets the info for the link +Like [`stat`](@ref), but for symbolic links gets the info for the link itself rather than the file it refers to. This function must be called on a file path rather than a file object or a file descriptor. @@ -236,21 +236,21 @@ Gets the permissions of the owner of the file as a bitfield of | 02 | Write Permission | | 04 | Read Permission | -For allowed arguments, see [`stat`](:func:`stat`). +For allowed arguments, see [`stat`](@ref). """ uperm(st::StatStruct) = UInt8((filemode(st) >> 6) & 0x7) """ gperm(file) -Like [`uperm`](:func:`uperm`) but gets the permissions of the group owning the file. +Like [`uperm`](@ref) but gets the permissions of the group owning the file. """ gperm(st::StatStruct) = UInt8((filemode(st) >> 3) & 0x7) """ operm(file) -Like [`uperm`](:func:`uperm`) but gets the permissions for people who neither own the file nor are a member of +Like [`uperm`](@ref) but gets the permissions for people who neither own the file nor are a member of the group owning the file """ operm(st::StatStruct) = UInt8((filemode(st) ) & 0x7) diff --git a/base/stream.jl b/base/stream.jl index 390796b9aff6b..80514c305bace 100644 --- a/base/stream.jl +++ b/base/stream.jl @@ -1015,38 +1015,38 @@ end """ redirect_stdout([stream]) -> (rd, wr) -Create a pipe to which all C and Julia level [`STDOUT`](:obj:`STDOUT`) output +Create a pipe to which all C and Julia level [`STDOUT`](@ref) output will be redirected. Returns a tuple `(rd, wr)` representing the pipe ends. -Data written to [`STDOUT`](:obj:`STDOUT`) may now be read from the `rd` end of +Data written to [`STDOUT`](@ref) may now be read from the `rd` end of the pipe. The `wr` end is given for convenience in case the old -[`STDOUT`](:obj:`STDOUT`) object was cached by the user and needs to be replaced +[`STDOUT`](@ref) object was cached by the user and needs to be replaced elsewhere. !!! note - `stream` must be a `TTY`, a [`Pipe`](:obj:`Pipe`), or a [`TCPSocket`](:obj:`TCPSocket`). + `stream` must be a `TTY`, a `Pipe`, or a `TCPSocket`. """ redirect_stdout """ redirect_stderr([stream]) -> (rd, wr) -Like [`redirect_stdout`](:func:`redirect_stdout`), but for [`STDERR`](:obj:`STDERR`). +Like [`redirect_stdout`](@ref), but for [`STDERR`](@ref). !!! note - `stream` must be a `TTY`, a [`Pipe`](:obj:`Pipe`), or a [`TCPSocket`](:obj:`TCPSocket`). + `stream` must be a `TTY`, a `Pipe`, or a `TCPSocket`. """ redirect_stderr """ redirect_stdin([stream]) -> (rd, wr) -Like [`redirect_stdout`](:func:`redirect_stdout`), but for [`STDIN`](:obj:`STDIN`). +Like [`redirect_stdout`](@ref), but for [`STDIN`](@ref). Note that the order of the return tuple is still `(rd, wr)`, -i.e. data to be read from [`STDIN`](:obj:`STDIN`) may be written to `wr`. +i.e. data to be read from [`STDIN`](@ref) may be written to `wr`. !!! note - `stream` must be a `TTY`, a [`Pipe`](:obj:`Pipe`), or a [`TCPSocket`](:obj:`TCPSocket`). + `stream` must be a `TTY`, a `Pipe`, or a `TCPSocket`. """ redirect_stdin @@ -1067,33 +1067,33 @@ end """ redirect_stdout(f::Function, stream) -Run the function `f` while redirecting [`STDOUT`](:obj:`STDOUT`) to `stream`. -Upon completion, [`STDOUT`](:obj:`STDOUT`) is restored to its prior setting. +Run the function `f` while redirecting [`STDOUT`](@ref) to `stream`. +Upon completion, [`STDOUT`](@ref) is restored to its prior setting. !!! note - `stream` must be a `TTY`, a [`Pipe`](:obj:`Pipe`), or a [`TCPSocket`](:obj:`TCPSocket`). + `stream` must be a `TTY`, a `Pipe`, or a `TCPSocket`. """ redirect_stdout(f::Function, stream) """ redirect_stderr(f::Function, stream) -Run the function `f` while redirecting [`STDERR`](:obj:`STDERR`) to `stream`. -Upon completion, [`STDERR`](:obj:`STDERR`) is restored to its prior setting. +Run the function `f` while redirecting [`STDERR`](@ref) to `stream`. +Upon completion, [`STDERR`](@ref) is restored to its prior setting. !!! note - `stream` must be a `TTY`, a [`Pipe`](:obj:`Pipe`), or a [`TCPSocket`](:obj:`TCPSocket`). + `stream` must be a `TTY`, a `Pipe`, or a `TCPSocket`. """ redirect_stderr(f::Function, stream) """ redirect_stdin(f::Function, stream) -Run the function `f` while redirecting [`STDIN`](:obj:`STDIN`) to `stream`. -Upon completion, [`STDIN`](:obj:`STDIN`) is restored to its prior setting. +Run the function `f` while redirecting [`STDIN`](@ref) to `stream`. +Upon completion, [`STDIN`](@ref) is restored to its prior setting. !!! note - `stream` must be a `TTY`, a [`Pipe`](:obj:`Pipe`), or a [`TCPSocket`](:obj:`TCPSocket`). + `stream` must be a `TTY`, a `Pipe`, or a `TCPSocket`. """ redirect_stdin(f::Function, stream) diff --git a/base/strings/basic.jl b/base/strings/basic.jl index 1ef77d4878ae3..21a706bee25cd 100644 --- a/base/strings/basic.jl +++ b/base/strings/basic.jl @@ -45,7 +45,7 @@ Copy a string from the address of a C-style (NUL-terminated) string encoded as U This function is labelled "unsafe" because it will crash if `p` is not a valid memory address to data of the requested length. -See also [`unsafe_wrap(String, p, [length])`](:func:`unsafe_wrap`), which takes a pointer +See also [`unsafe_wrap(String, p, [length])`](@ref), which takes a pointer and wraps a string object around it without making a copy. """ function unsafe_string(p::Union{Ptr{UInt8},Ptr{Int8}}, len::Integer) diff --git a/base/strings/io.jl b/base/strings/io.jl index 8879a0b28c43d..0d6e35a3a1c14 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -6,9 +6,9 @@ """ print(io::IO, x) -Write to `io` (or to the default output stream [`STDOUT`](:obj:`STDOUT`) +Write to `io` (or to the default output stream [`STDOUT`](@ref) if `io` is not given) a canonical (un-decorated) text representation -of a value if there is one, otherwise call [`show`](:func:`show`). +of a value if there is one, otherwise call [`show`](@ref). The representation used by `print` includes minimal formatting and tries to avoid Julia-specific details. """ @@ -37,8 +37,8 @@ end """ println(io::IO, xs...) -Print (using [`print`](:func:`print`)) `xs` followed by a newline. -If `io` is not supplied, prints to [`STDOUT`](:obj:`STDOUT`). +Print (using [`print`](@ref)) `xs` followed by a newline. +If `io` is not supplied, prints to [`STDOUT`](@ref). """ println(io::IO, xs...) = print(io, xs..., '\n') @@ -97,7 +97,7 @@ string_with_env(env, xs...) = print_to_string(xs...; env=env) """ string(xs...) -Create a string from any values using the [`print`](:func:`print`) function. +Create a string from any values using the [`print`](@ref) function. """ string(xs...) = print_to_string(xs...) @@ -121,7 +121,7 @@ end """ repr(x) -Create a string from any value using the [`showall`](:func:`showall`) function. +Create a string from any value using the [`showall`](@ref) function. """ function repr(x) s = IOBuffer() @@ -199,7 +199,7 @@ escape_nul(s::AbstractString, i::Int) = General escaping of traditional C and Unicode escape sequences. Any characters in `esc` are also escaped (with a backslash). -See also [`unescape_string`](:func:`unescape_string`). +See also [`unescape_string`](@ref). """ function escape_string(io, s::AbstractString, esc::AbstractString) i = start(s) @@ -251,7 +251,7 @@ unescape_chars(s::AbstractString, esc::AbstractString) = unescape_string([io,] s::AbstractString) -> AbstractString General unescaping of traditional C and Unicode escape sequences. Reverse of -[`escape_string`](:func:`escape_string`). +[`escape_string`](@ref). """ function unescape_string(io, s::AbstractString) i = start(s) diff --git a/base/strings/search.jl b/base/strings/search.jl index 3158380697343..497e2993b425b 100644 --- a/base/strings/search.jl +++ b/base/strings/search.jl @@ -144,7 +144,7 @@ searchindex(s::ByteArray, t::ByteArray, i) = _searchindex(s,t,i) """ searchindex(s::AbstractString, substring, [start::Integer]) -Similar to [`search`](:func:`search`), but return only the start index at which +Similar to [`search`](@ref), but return only the start index at which the substring is found, or `0` if it is not. """ searchindex(s::AbstractString, t::AbstractString, i::Integer) = _searchindex(s,t,i) @@ -189,7 +189,7 @@ end """ rsearch(s::AbstractString, chars::Chars, [start::Integer]) -Similar to [`search`](:func:`search`), but returning the last occurrence of the given characters within the +Similar to [`search`](@ref), but returning the last occurrence of the given characters within the given string, searching in reverse from `start`. ```jldoctest @@ -304,7 +304,7 @@ rsearchindex(s::ByteArray,t::ByteArray,i) = _rsearchindex(s,t,i) """ rsearchindex(s::AbstractString, substring, [start::Integer]) -Similar to [`rsearch`](:func:`rsearch`), but return only the start index at which the substring is found, or `0` if it is not. +Similar to [`rsearch`](@ref), but return only the start index at which the substring is found, or `0` if it is not. """ rsearchindex(s::AbstractString, t::AbstractString, i::Integer) = _rsearchindex(s,t,i) rsearchindex(s::AbstractString, t::AbstractString) = (isempty(s) && isempty(t)) ? 1 : rsearchindex(s,t,endof(s)) diff --git a/base/strings/types.jl b/base/strings/types.jl index beb64916c0ea6..bc8843b0ba5f0 100644 --- a/base/strings/types.jl +++ b/base/strings/types.jl @@ -188,7 +188,7 @@ end ^(s::AbstractString, n::Integer) Repeat `n` times the string `s`. -The [`repeat`](:func:`repeat`) function is an alias to this operator. +The [`repeat`](@ref) function is an alias to this operator. ```jldoctest julia> "Test "^3 diff --git a/base/strings/util.jl b/base/strings/util.jl index 4c866f0efeb2f..cf6b630191a24 100644 --- a/base/strings/util.jl +++ b/base/strings/util.jl @@ -280,7 +280,7 @@ rsplit{T<:SubString}(str::T, splitter; limit::Integer=0, keep::Bool=true) = _rsp """ rsplit(s::AbstractString, [chars]; limit::Integer=0, keep::Bool=true) -Similar to [`split`](:func:`split`), but starting from the end of the string. +Similar to [`split`](@ref), but starting from the end of the string. ```jldoctest julia> a = "M.a.r.c.h" diff --git a/base/subarray.jl b/base/subarray.jl index 5f60fd3ab67f9..0aede224b8337 100644 --- a/base/subarray.jl +++ b/base/subarray.jl @@ -76,9 +76,9 @@ _maybe_reshape_parent{N}(A::AbstractArray, ::NTuple{N, Bool}) = reshape(A, Val{N """ view(A, inds...) -Like [`getindex`](:func:`getindex`), but returns a view into the parent array `A` with the -given indices instead of making a copy. Calling [`getindex`](:func:`getindex`) or -[`setindex!`](:func:`setindex!`) on the returned [`SubArray`](:obj:`SubArray`) computes the +Like [`getindex`](@ref), but returns a view into the parent array `A` with the +given indices instead of making a copy. Calling [`getindex`](@ref) or +[`setindex!`](@ref) on the returned `SubArray` computes the indices to the parent array on the fly without checking bounds. """ function view(A::AbstractArray, I::ViewIndex...) diff --git a/base/task.jl b/base/task.jl index fc293dfdf174b..ed2e3d6cb9689 100644 --- a/base/task.jl +++ b/base/task.jl @@ -53,7 +53,7 @@ end """ @task -Wrap an expression in a [`Task`](:class:`Task`) without executing it, and return the [`Task`](:class:`Task`). This only +Wrap an expression in a [`Task`](@ref) without executing it, and return the [`Task`](@ref). This only creates a task, and does not run it. ```jldoctest @@ -79,7 +79,7 @@ end """ current_task() -Get the currently running [`Task`](:class:`Task`). +Get the currently running [`Task`](@ref). """ current_task() = ccall(:jl_get_current_task, Ref{Task}, ()) diff --git a/base/threadcall.jl b/base/threadcall.jl index b0b998a5526d7..c6dcfaedef2ba 100644 --- a/base/threadcall.jl +++ b/base/threadcall.jl @@ -17,7 +17,7 @@ end """ @threadcall((cfunc, clib), rettype, (argtypes...), argvals...) -The `@threadcall` macro is called in the same way as [`ccall`](:func:`ccall`) but does the work +The `@threadcall` macro is called in the same way as [`ccall`](@ref) but does the work in a different thread. This is useful when you want to call a blocking C function without causing the main `julia` thread to become blocked. Concurrency is limited by size of the libuv thread pool, which defaults to 4 threads but diff --git a/base/util.jl b/base/util.jl index 32a3300fe8a13..be9d904bf0daf 100644 --- a/base/util.jl +++ b/base/util.jl @@ -79,7 +79,7 @@ gc_bytes() = ccall(:jl_gc_total_bytes, Int64, ()) """ tic() -Set a timer to be read by the next call to [`toc`](:func:`toc`) or [`toq`](:func:`toq`). The +Set a timer to be read by the next call to [`toc`](@ref) or [`toq`](@ref). The macro call `@time expr` can also be used to time evaluation. """ function tic() @@ -91,7 +91,7 @@ end """ toq() -Return, but do not print, the time elapsed since the last [`tic`](:func:`tic`). The +Return, but do not print, the time elapsed since the last [`tic`](@ref). The macro calls `@timed expr` and `@elapsed expr` also return evaluation time. """ function toq() @@ -108,7 +108,7 @@ end """ toc() -Print and return the time elapsed since the last [`tic`](:func:`tic`). The macro call +Print and return the time elapsed since the last [`tic`](@ref). The macro call `@time expr` can also be used to time evaluation. """ function toc() @@ -184,8 +184,8 @@ A macro to execute an expression, printing the time it took to execute, the numb allocations, and the total number of bytes its execution caused to be allocated, before returning the value of the expression. -See also [`@timev`](:func:`@timev`), [`@timed`](:func:`@timed`), [`@elapsed`](:func:`@elapsed`), and -[`@allocated`](:func:`@allocated`). +See also [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ref), and +[`@allocated`](@ref). """ macro time(ex) quote @@ -207,8 +207,8 @@ This is a verbose version of the `@time` macro. It first prints the same informa `@time`, then any non-zero memory allocation counters, and then returns the value of the expression. -See also [`@time`](:func:`@time`), [`@timed`](:func:`@timed`), [`@elapsed`](:func:`@elapsed`), and -[`@allocated`](:func:`@allocated`). +See also [`@time`](@ref), [`@timed`](@ref), [`@elapsed`](@ref), and +[`@allocated`](@ref). """ macro timev(ex) quote @@ -227,8 +227,8 @@ end A macro to evaluate an expression, discarding the resulting value, instead returning the number of seconds it took to execute as a floating-point number. -See also [`@time`](:func:`@time`), [`@timev`](:func:`@timev`), [`@timed`](:func:`@timed`), -and [`@allocated`](:func:`@allocated`). +See also [`@time`](@ref), [`@timev`](@ref), [`@timed`](@ref), +and [`@allocated`](@ref). """ macro elapsed(ex) quote @@ -254,8 +254,8 @@ effects of compilation, however, there still may be some allocations due to JIT This also makes the results inconsistent with the `@time` macros, which do not try to adjust for the effects of compilation. -See also [`@time`](:func:`@time`), [`@timev`](:func:`@timev`), [`@timed`](:func:`@timed`), -and [`@elapsed`](:func:`@elapsed`). +See also [`@time`](@ref), [`@timev`](@ref), [`@timed`](@ref), +and [`@elapsed`](@ref). """ macro allocated(ex) quote @@ -278,8 +278,8 @@ A macro to execute an expression, and return the value of the expression, elapse total bytes allocated, garbage collection time, and an object with various memory allocation counters. -See also [`@time`](:func:`@time`), [`@timev`](:func:`@timev`), [`@elapsed`](:func:`@elapsed`), and -[`@allocated`](:func:`@allocated`). +See also [`@time`](@ref), [`@timev`](@ref), [`@elapsed`](@ref), and +[`@allocated`](@ref). """ macro timed(ex) quote diff --git a/base/version.jl b/base/version.jl index 6bdb1822e35c5..3550f59385849 100644 --- a/base/version.jl +++ b/base/version.jl @@ -203,7 +203,7 @@ end VERSION A `VersionNumber` object describing which version of Julia is in use. For details see -[Version Number Literals](:ref:`man-version-number-literals`). +[Version Number Literals](@ref man-version-number-literals). """ const VERSION = try ver = convert(VersionNumber, VERSION_STRING) diff --git a/base/workerpool.jl b/base/workerpool.jl index da3137de0c978..5dd46b069f012 100644 --- a/base/workerpool.jl +++ b/base/workerpool.jl @@ -190,7 +190,7 @@ const _default_worker_pool = Ref{Nullable}(Nullable{WorkerPool}()) """ default_worker_pool() -`WorkerPool` containing idle `workers()` - used by `remote(f)` and [`pmap`](:func:`pmap`) (by default). +`WorkerPool` containing idle `workers()` - used by `remote(f)` and [`pmap`](@ref) (by default). """ function default_worker_pool() # On workers retrieve the default worker pool from the master when accessed @@ -209,7 +209,7 @@ end remote([::AbstractWorkerPool], f) -> Function Returns a lambda that executes function `f` on an available worker -using [`remotecall_fetch`](:func:`remotecall_fetch`). +using [`remotecall_fetch`](@ref). """ remote(f) = (args...; kwargs...)->remotecall_fetch(f, default_worker_pool(), args...; kwargs...) remote(p::AbstractWorkerPool, f) = (args...; kwargs...)->remotecall_fetch(f, p, args...; kwargs...) @@ -234,8 +234,8 @@ serialize(s::AbstractSerializer, cp::CachingPool) = throw(ErrorException("Cachin CachingPool(workers::Vector{Int}) An implementation of an `AbstractWorkerPool`. -[`remote`](:func:`remote`), [`remotecall_fetch`](:func:`remotecall_fetch`), -[`pmap`](:func:`pmap`) (and other remote calls which execute functions remotely) +[`remote`](@ref), [`remotecall_fetch`](@ref), +[`pmap`](@ref) (and other remote calls which execute functions remotely) benefit from caching the serialized/deserialized functions on the worker nodes, especially closures (which may capture large amounts of data).