Skip to content

Commit

Permalink
Some more compat annotations (#30297)
Browse files Browse the repository at this point in the history
* Compat annotation for unique!(f, A), #30141.
Compat annotation for rank(A; rtol=..., atol=...), #29926.

* Update stdlib/LinearAlgebra/src/generic.jl
  • Loading branch information
fredrikekre authored and ararslan committed Dec 7, 2018
1 parent b55b85c commit 4fc446f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions base/set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ end
Selects one value from `A` for each unique value produced by `f` applied to
elements of `A` , then return the modified A.
!!! compat "Julia 1.1"
This method is available as of Julia 1.1.
# Examples
```jldoctest
julia> unique!(x -> x^2, [1, -1, 3, -3, 4])
Expand Down
7 changes: 6 additions & 1 deletion stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ end

"""
rank(A::AbstractMatrix; atol::Real=0, rtol::Real=atol>0 ? 0 : n*ϵ)
rank(A::AbstractMatrix, rtol::Real) = rank(A; rtol=rtol) # to be deprecated in Julia 2.0
rank(A::AbstractMatrix, rtol::Real)
Compute the rank of a matrix by counting how many singular
values of `A` have magnitude greater than `max(atol, rtol*σ₁)` where `σ₁` is
Expand All @@ -722,6 +722,11 @@ tolerances, respectively. The default relative tolerance is `n*ϵ`, where `n`
is the size of the smallest dimension of `A`, and `ϵ` is the [`eps`](@ref) of
the element type of `A`.
!!! compat "Julia 1.1"
The `atol` and `rtol` keyword arguments requires at least Julia 1.1.
In Julia 1.0 `rtol` is available as a positional argument, but this
will be deprecated in Julia 2.0.
# Examples
```jldoctest
julia> rank(Matrix(I, 3, 3))
Expand Down

0 comments on commit 4fc446f

Please sign in to comment.