References

ResizingTools.AbstractRDArrayType
AbstractRDArray{T,N} <: DenseArray{T,N}

N-dimensional resizable dense array with elements of type T with some pre-defined array methods.

source
ResizingTools.AbstractRNArrayType
AbstractRNArray{T,N} <: AbstractArray{T,N}

N-dimensional resizable (no-dense) array with elements of type T with some pre-defined array methods.

source
ResizingTools.SizeType
Size{N} <: AbstractSize{N}

Size type for resizable arrays, which is a mutable wrapper of Dims{N} to represent the dimension of an resizable array. Mutate dth dimension to n by sz[d] = n mutate the whole dimensions to nsz by set!(sz, nsz).

source
Base.resize!Method
resize!(A::AbstractArray{T,N}, d::Integer, I)

Resize the dth dimension to I, where I can be an integer or a colon or an iterator.

source
Base.resize!Method
resize!(A::AbstractArray{T,N}, sz)

Resize A to sz. sz can be a tuple of integer or Colon or iterator.

source
Base.sizehint!Method
Base.sizehint!(A::AbstractArray, nl::Integer)

Suggest that array A reserve capacity for at least nl elements. This can improve performance.

source
Base.sizehint!Method
sizehint!(A::AbstractArray{T,N}, sz::NTuple{N}) where {T,N}

Suggest that array A reserve size for at least sz. This can improve performance.

source
ResizingTools.after_resize!Function
after_resize!(A::AbstractArray{T,N}, sz::NTuple{N,Any})
after_resize!(A::AbstractArray{T,N}, d::Integer, n::Any)

Do something after resize A with given arguments (do nothing by default). This methods is called by resize! with the same arguments.

source
ResizingTools.copyto_parent!Method
copyto_parent!(dst::AbstractArray, src::AbstractArray, dinds...)

Copy the elements of src to parent of dst at the dst indices dinds. This method is called by resize_buffer! to copy elements of the parent. The default method is copyto!(view(dst, dinds...), src). The default method assumes that setindex!(parent(dst), v, i...) is the same as setindex!(dst, v, i...) . Override this method if they are different.

source
ResizingTools.getsizeFunction
getsize(A::AbstractArray, [dim])

Returns the dimensions of A unlike size which may not return a Dims{N}.

Warning

You should never call this function directly. Use size instead.

source
ResizingTools.has_resize_bufferMethod
has_resize_buffer(A::AbstractArray)

Determines if an array has resize_buffer* methods, if not resize!(A, args...) would resize its parent.

source
ResizingTools.isresizableMethod
isresizable(A::AbstractArray)

Determines if an array is resizable, if not resize!(A, args...) would throw an error.

source
ResizingTools.pre_resize!Function
pre_resize!(A::AbstractArray{T,N}, sz::NTuple{N,Any})
pre_resize!(A::AbstractArray{T,N}, d::Integer, n::Any)

Do something before resize A with given arguments (do nothing by default). This method is called by resize! with the same arguments.

source
ResizingTools.resize_parent!Method
resize_parent!(A::AbstractArray, nl::Integer)

Resize the parent of A. This method will (and should only) be called by resize_buffer! or resize_buffer_dim!, the default implementation is resize!(parent(A), nl), but for arrays with preserved space, this methods can be override to keep size of parent.

source
ResizingTools.set!Method
set!(sz::Size{N}, nsz::NTuple{N,Integer})

Set sz to nsz.

Example

julia> sz = Size(1, 2, 3)
Size{3}((1, 2, 3))

julia> set!(sz, (3, 2, 1))
Size{3}((3, 2, 1))
source
ResizingTools.size_typeMethod
size_type(A::AbstractArray)

Get the size type of A, determine the methods of setsize!. The default size_type is NoneSize, which means setsize! will "do nothing".

source
ResizingTools.to_dimsMethod
to_dims(inds::Tuple) -> Dims

Convert the given indices to Dims.

Note

The given indices should be a return value of to_indices. If inds[i] is an Integer, this function would converted it to Int; If inds[i] is an AbstractVector, this function would return its length.

source
ResizingTools.to_parentindsMethod
to_parentinds(A::AbstractArray, i::Integer, I) -> (i′, I′)

Convert the index(s) I at dth dimension of A to index(s) I′ at d′th dimension of parent(A).

source