@@ -59,17 +59,17 @@ eachstoredindex(a::ReplacedUnstoredSparseArray) = eachstoredindex(parent(a))
5959using Random: Random, AbstractRNG, default_rng
6060
6161@doc """
62- spzeros ([T::Type], dims) -> A::SparseArrayDOK{T}
62+ sparsezeros ([T::Type], dims) -> A::SparseArrayDOK{T}
6363
6464Create an empty size `dims` sparse array.
6565The optional `T` argument specifies the element type, which defaults to `Float64`.
66- """ spzeros
66+ """ sparsezeros
6767
68- spzeros (dims:: Dims ) = spzeros (Float64, dims)
69- spzeros (:: Type{T} , dims:: Dims ) where {T} = SparseArrayDOK {T} (undef, dims)
68+ sparsezeros (dims:: Dims ) = sparsezeros (Float64, dims)
69+ sparsezeros (:: Type{T} , dims:: Dims ) where {T} = SparseArrayDOK {T} (undef, dims)
7070
7171@doc """
72- sprand ([rng], [T::Type], dims; density::Real=0.5, randfun::Function=rand) -> A::SparseArrayDOK{T}
72+ sparserand ([rng], [T::Type], dims; density::Real=0.5, randfun::Function=rand) -> A::SparseArrayDOK{T}
7373
7474Create a random size `dims` sparse array in which the probability of any element being stored is independently given by `density`.
7575The optional `rng` argument specifies a random number generator, see also `Random`.
@@ -78,35 +78,35 @@ The optional `randfun` argument can be used to control the type of random elemen
7878the signature `randfun(rng, T, N)` to generate `N` entries of type `T`.
7979
8080
81- See also [`sprand !`](@ref).
82- """ sprand
81+ See also [`sparserand !`](@ref).
82+ """ sparserand
8383
84- function sprand (:: Type{T} , dims:: Dims ; kwargs... ) where {T}
85- return sprand (default_rng (), T, dims; kwargs... )
84+ function sparserand (:: Type{T} , dims:: Dims ; kwargs... ) where {T}
85+ return sparserand (default_rng (), T, dims; kwargs... )
8686end
87- sprand (dims:: Dims ; kwargs... ) = sprand (default_rng (), Float64, dims; kwargs... )
88- function sprand (rng:: AbstractRNG , dims:: Dims ; kwargs... )
89- return sprand (rng, Float64, dims; kwargs... )
87+ sparserand (dims:: Dims ; kwargs... ) = sparserand (default_rng (), Float64, dims; kwargs... )
88+ function sparserand (rng:: AbstractRNG , dims:: Dims ; kwargs... )
89+ return sparserand (rng, Float64, dims; kwargs... )
9090end
91- function sprand (rng:: AbstractRNG , :: Type{T} , dims:: Dims ; kwargs... ) where {T}
91+ function sparserand (rng:: AbstractRNG , :: Type{T} , dims:: Dims ; kwargs... ) where {T}
9292 A = SparseArrayDOK {T} (undef, dims)
93- sprand ! (rng, A; kwargs... )
93+ sparserand ! (rng, A; kwargs... )
9494 return A
9595end
9696
9797@doc """
98- sprand !([rng], A::AbstractArray; density::Real=0.5, randfun::Function=rand) -> A
98+ sparserand !([rng], A::AbstractArray; density::Real=0.5, randfun::Function=rand) -> A
9999
100100Overwrite part of an array with random entries, where the probability of overwriting is independently given by `density`.
101101The optional `rng` argument specifies a random number generator, see also `Random`.
102102The optional `randfun` argument can be used to control the type of random elements, and should support
103103the signature `randfun(rng, T, N)` to generate `N` entries of type `T`.
104104
105- See also [`sprand `](@ref).
106- """ sprand !
105+ See also [`sparserand `](@ref).
106+ """ sparserand !
107107
108- sprand ! (A:: AbstractArray ; kwargs... ) = sprand ! (default_rng (), A; kwargs... )
109- function sprand ! (
108+ sparserand ! (A:: AbstractArray ; kwargs... ) = sparserand ! (default_rng (), A; kwargs... )
109+ function sparserand ! (
110110 rng:: AbstractRNG , A:: AbstractArray ; density:: Real = 0.5 , randfun:: Function = Random. rand
111111)
112112 ArrayLayouts. zero! (A)
0 commit comments