public interface SubArrayCopy
The SubArrayCopy.copy
method requires the nD size of the flattened source and target arrays, the nD
starting position and nD size of the source region to copy, and the nD
starting position in the target to copy to.
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(Object src,
int[] srcSize,
int[] srcPos,
Object dest,
int[] destSize,
int[] destPos,
int[] size)
Copy a nD region from
src to dest, where src and
dest are flattened nD array of dimensions srcSize and
destSize, respectively. |
static <T> void |
copyNDRangeRecursive(int d,
T src,
int[] srcStrides,
int srcPos,
T dest,
int[] destStrides,
int destPos,
int[] size)
Recursively copy a
(d+1) dimensional region from src to
dest, where src and dest are flattened nD array
with strides srcStrides and destStrides, respectively. |
static int[] |
createAllocationSteps(int[] dimensions) |
static void |
createAllocationSteps(int[] dimensions,
int[] steps)
Create allocation step array from the dimensions of an N-dimensional
array.
|
static int |
positionToIndex(int[] position,
int[] dimensions) |
static void copy(Object src, int[] srcSize, int[] srcPos, Object dest, int[] destSize, int[] destPos, int[] size)
src to dest, where src and
dest are flattened nD array of dimensions srcSize and
destSize, respectively.src - flattened nD source arraysrcSize - dimensions of srcsrcPos - starting position, in src, of the range to copydest - flattened nD destination arraydestSize - dimensions of destdestPos - starting position, in dest, of the range to copysize - size of the range to copystatic int positionToIndex(int[] position,
int[] dimensions)
static void createAllocationSteps(int[] dimensions,
int[] steps)
dimensions - steps - static int[] createAllocationSteps(int[] dimensions)
static <T> void copyNDRangeRecursive(int d,
T src,
int[] srcStrides,
int srcPos,
T dest,
int[] destStrides,
int destPos,
int[] size)
(d+1) dimensional region from src to
dest, where src and dest are flattened nD array
with strides srcStrides and destStrides, respectively.
For d=0, a 1D line of length size[0] is copied
(equivalent to System.arraycopy). For d=1, a 2D plane of
size size[0] * size[1] is copied, by recursively copying 1D
lines, starting srcStrides[1] (respectively destStrides[1]) apart. For d=2, a 3D box is copied by
recursively copying 2D planes, etc.
d - current dimensionsrc - flattened nD source arraysrcStrides - nD strides of srcsrcPos - flattened index (in src) to start copying fromdest - flattened nD destination arraydestStrides - nD strides of destdestPos - flattened index (in dest) to start copying tosize - nD size of the range to copyCopyright © 2017–2026 Saalfeld Lab. All rights reserved.