|
111 | 111 |
|
112 | 112 | ### Convenience functions ###
|
113 | 113 |
|
114 |
| -Base.zeros(T::Type, inds::UnitRange...) = fill!(OffsetArray{T}(inds), zero(T)) |
115 |
| -Base.zeros(inds::UnitRange...) = zeros(Float64, inds...) |
116 |
| -Base.ones(T::Type, inds::UnitRange...) = fill!(OffsetArray{T}(inds), one(T)) |
117 |
| -Base.ones(inds::UnitRange...) = ones(Float64, inds...) |
118 | 114 | Base.fill(x, inds::Tuple{UnitRange,Vararg{UnitRange}}) = fill!(OffsetArray{typeof(x)}(inds), x)
|
119 | 115 | @inline Base.fill(x, ind1::UnitRange, inds::UnitRange...) = fill(x, (ind1, inds...))
|
120 | 116 |
|
|
161 | 157 | @inline unsafe_getindex(a::OffsetArray, I...) = unsafe_getindex(a, Base.IteratorsMD.flatten(I)...)
|
162 | 158 | @inline unsafe_setindex!(a::OffsetArray, val, I...) = unsafe_setindex!(a, val, Base.IteratorsMD.flatten(I)...)
|
163 | 159 |
|
| 160 | +# Deprecations |
| 161 | +import Base: zeros, ones |
| 162 | +@deprecate zeros(T::Type, inds::UnitRange...) fill!(OffsetArray{T}(inds), zero(T)) |
| 163 | +@deprecate ones(T::Type, inds::UnitRange...) fill!(OffsetArray{T}(inds), one(T)) |
| 164 | +@deprecate zeros(inds::UnitRange...) fill!(OffsetArray{Float64}(inds), 0) |
| 165 | +@deprecate ones(inds::UnitRange...) fill!(OffsetArray{Float64}(inds), 1) |
| 166 | + |
164 | 167 | end # module
|
0 commit comments