Class HyperslabIndex


public class HyperslabIndex extends StrideIndex
A hyperslab is a rectangular pattern defined by four arrays.

The start defines the origin of the hyperslab in the original coordinates. The stride is the number of elements to increment between selected elements. A stride of '1' is every element, a stride of '2' is every second element, etc. The default stride is 1. The count is the number of elements in the hyperslab selection. When the stride is 1, the selection is a hyper rectangle with a corner at start and size count[0] by count[1] by ... When stride is greater than one, the hyperslab bounded by start and the corners defined by stride[n] * count[n]. The block is a count on the number of repetitions of the hyperslab. The default block size is '1', which is one hyperslab. A block of 2 would be two hyperslabs in that dimension, with the second starting at start[n]+ (count[n] * stride[n]) + 1.

See Also:
  • Field Details

    • selectionOffsets

      protected long[] selectionOffsets
    • selectionStrides

      protected long[] selectionStrides
    • selectionCounts

      protected long[] selectionCounts
    • selectionBlocks

      protected long[] selectionBlocks
  • Constructor Details

    • HyperslabIndex

      public HyperslabIndex(long[] sizes, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks)
      Calls HyperslabIndex(sizes, defaultStrides(sizes), selectionOffsets, selectionStrides, selectionCounts, selectionBlocks).
    • HyperslabIndex

      public HyperslabIndex(long[] sizes, long[] strides, long[] selectionOffsets, long[] selectionStrides, long[] selectionCounts, long[] selectionBlocks)
      Constructor to set the Index.sizes, StrideIndex.strides, selectionOffsets, selectionStrides, selectionCounts, and selectionBlocks. Also updates the Index.sizes for the resulting selection.
  • Method Details

    • index

      public long index(long i)
      Description copied from class: StrideIndex
      Returns i * strides[0].
      Overrides:
      index in class StrideIndex
    • index

      public long index(long i, long j)
      Description copied from class: StrideIndex
      Returns i * strides[0] + j * strides[1].
      Overrides:
      index in class StrideIndex
    • index

      public long index(long i, long j, long k)
      Description copied from class: StrideIndex
      Returns i * strides[0] + j * strides[1] + k * strides[2].
      Overrides:
      index in class StrideIndex
    • index

      public long index(long... indices)
      Description copied from class: StrideIndex
      Computes the linear index as the dot product of indices and strides.
      Overrides:
      index in class StrideIndex
      Parameters:
      indices - of each dimension
      Returns:
      index to access array or buffer