Recursive Array Functions

These are functions designed for recursive arrays, like arrays of arrays, and do not require that the RecursiveArrayTools types are used.

Function List

RecursiveArrayTools.recursivecopyFunction
recursivecopy(a::Union{AbstractArray{T, N}, AbstractVectorOfArray{T, N}})

A recursive copy function. Acts like a deepcopy on arrays of arrays, but like copy on arrays of scalars.

source
RecursiveArrayTools.recursivecopy!Function
recursivecopy!(b::AbstractArray{T, N}, a::AbstractArray{T, N})

A recursive copy! function. Acts like a deepcopy! on arrays of arrays, but like copy! on arrays of scalars. Requires b and a to have matching ndims; use recursivecopyto! for the copyto!-style linear-index variant that allows mismatched shapes.

source
RecursiveArrayTools.recursivecopyto!Function
recursivecopyto!(b::AbstractArray, a::AbstractArray)

A recursive copyto! function. Acts like a deepcopy! on arrays of arrays, but like copyto! on arrays of scalars.

Unlike recursivecopy!, this does not require b and a to have matching ndims or axes; only that length(b) >= length(a). Elements are copied in linear (column-major) order, matching the semantics of Base.copyto!. Use this when flattening/reshaping between destination and source is intended, e.g. copying a Vector into a Matrix of the same total length.

source
RecursiveArrayTools.copyat_or_push!Function
copyat_or_push!{T}(a::AbstractVector{T}, i::Int, x)

If i<length(x), it's simply a recursivecopy! to the ith element. Otherwise, it will push! a deepcopy.

source