The rep_dim() function
replicates array dimensions until the specified dimension sizes are reached,
and returns the array.
The various broadcasting functions recycle array dimensions virtually,
meaning little to no additional memory is needed.
The rep_dim() function,
however,
physically replicates the dimensions of an array
(and thus actually occupies additional memory space).
Usage
rep_dim(x, tdim)
Value
Returns the replicated array.
Arguments
x
an atomic or recursive array or matrix.
tdim
an integer vector, giving the target dimension to reach.