ArkoudaAryUtilCompat

Usage

use ArkoudaAryUtilCompat;

or

import ArkoudaAryUtilCompat;
proc domOnAxis(D: domain(?), idx: D.rank*int, axes: int ...?NA): domain  where NA < D.rank

Get a domain that selects out the idx’th set of indices along the specified axes

Arguments
  • D – the domain to slice

  • idx – the index to select along the specified axes (must have the same rank as D)

  • axes – the axes to slice along (must be a subset of the axes of D)

For example, if D represents a stack of 1000 10x10 matrices (ex: {1..10, 1..10, 1..1000}) Then, domOnAxis(D, (1, 1, 25), 0, 1) will return D sliced with {1..10, 1..10, 25..25} (i.e., the 25th matrix)

proc domOnAxis(D: domain(?), idx: D.rank*int, axes: [?aD] int): domain throws
proc domOffAxis(D: domain(?), axes: int ...?NA): domain(?)  where NA < D.rank

Get a domain over the set of indices orthogonal to the specified axes

Arguments
  • D – the domain to slice

  • axes – the axes to slice along (must be a subset of the axes of D)

For example, if D represents a stack of 1000 10x10 matrices (ex: {1..10, 1..10, 1..1000}) Then, domOffAxis(D, 0, 1) will return D sliced with {0..0, 0..0, 1..1000} (i.e., a set of indices for the 1000 matrices)

proc domOffAxis(D: domain(?), axes: [?aD] int): domain throws
proc subDomChunk(dom: domain(?), chunkIdx: int, nChunks: int): domain

Naively create a domain over a chunk of the input domain

Chunks are created by splitting the largest dimension of the input domain into ‘nChunks’ roughly equal-sized chunks, and then taking the ‘chunkIdx’-th chunk

(if ‘nChunks’ is greater than the size of the largest dimension, the first ‘nChunks-1’ chunks will be empty, and the last chunk will contain the entire domain)