Skip to content

Commit

Permalink
remove deprecated ones/zeros doc from manual (#24863)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre authored Nov 30, 2017
1 parent 53f0529 commit 93fc492
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 58 deletions.
66 changes: 10 additions & 56 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,10 @@ fill(v, dims::Dims) = fill!(Array{typeof(v)}(uninitialized, dims), v)
fill(v, dims::Integer...) = fill!(Array{typeof(v)}(uninitialized, dims...), v)

"""
zeros([A::AbstractArray,] [T=eltype(A)::Type,] [dims=size(A)::Tuple])
zeros([T=Float64,] dims...)
Create an array of all zeros with the same layout as `A`, element type `T` and size `dims`.
The `A` argument can be skipped, which behaves like `Array{Float64,0}(uninitialized)` was passed.
For convenience `dims` may also be passed in variadic form.
Create an `Array`, with element type `T`, of all zeros with size specified by `dims`.
See also [`ones`](@ref), [`similar`](@ref).
# Examples
```jldoctest
Expand All @@ -350,72 +349,27 @@ julia> zeros(Int8, 2, 3)
2×3 Array{Int8,2}:
0 0 0
0 0 0
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> zeros(A)
2×2 Array{Int64,2}:
0 0
0 0
julia> zeros(A, Float64)
2×2 Array{Float64,2}:
0.0 0.0
0.0 0.0
julia> zeros(A, Bool, (3,))
3-element Array{Bool,1}:
false
false
false
```
See also [`ones`](@ref), [`similar`](@ref).
"""
function zeros end

"""
ones([A::AbstractArray,] [T=eltype(A)::Type,] [dims=size(A)::Tuple])
ones([T=Float64,] dims...)
Create an array of all ones with the same layout as `A`, element type `T` and size `dims`.
The `A` argument can be skipped, which behaves like `Array{Float64,0}(uninitialized)` was passed.
For convenience `dims` may also be passed in variadic form.
Create an `Array`, with element type `T`, of all ones with size specified by `dims`.
See also [`zeros`](@ref), [`similar`](@ref).
# Examples
```jldoctest
julia> ones(Complex128, 2, 3)
2×3 Array{Complex{Float64},2}:
1.0+0.0im 1.0+0.0im 1.0+0.0im
1.0+0.0im 1.0+0.0im 1.0+0.0im
julia> ones(1,2)
1×2 Array{Float64,2}:
1.0 1.0
julia> A = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
julia> ones(A)
2×2 Array{Int64,2}:
1 1
1 1
julia> ones(A, Float64)
2×2 Array{Float64,2}:
1.0 1.0
1.0 1.0
julia> ones(A, Bool, (3,))
3-element Array{Bool,1}:
true
true
true
julia> ones(Complex128, 2, 3)
2×3 Array{Complex{Float64},2}:
1.0+0.0im 1.0+0.0im 1.0+0.0im
1.0+0.0im 1.0+0.0im 1.0+0.0im
```
See also [`zeros`](@ref), [`similar`](@ref).
"""
function ones end

Expand Down
2 changes: 0 additions & 2 deletions doc/src/manual/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ omitted it will default to [`Float64`](@ref).
|:---------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`Array{T}(uninitialized, dims...)`](@ref) | an uninitialized dense [`Array`](@ref) |
| [`zeros(T, dims...)`](@ref) | an `Array` of all zeros |
| [`zeros(A)`](@ref) | an array of all zeros with the same type, element type and shape as `A` |
| [`ones(T, dims...)`](@ref) | an `Array` of all ones |
| [`ones(A)`](@ref) | an array of all ones with the same type, element type and shape as `A` |
| [`trues(dims...)`](@ref) | a [`BitArray`](@ref) with all values `true` |
| [`trues(A)`](@ref) | a `BitArray` with all values `true` and the same shape as `A` |
| [`falses(dims...)`](@ref) | a `BitArray` with all values `false` |
Expand Down

0 comments on commit 93fc492

Please sign in to comment.