public class SparseOps extends Object
Modifier and Type | Method and Description |
---|---|
static <V> SparseArrayState<V> |
assign(V oldV,
V newV,
int[][] mergeResult)
Aggregates old values, new values, and their assignments into a
SparseArrayState . |
static int[] |
getSlicedIndirections(int[] sliceOffsets,
int[] sliceCounts,
int[] slices,
int[] dimOffsets,
int[] indirectionOffsets,
int[] indirections,
int[] dims)
Gets the sliced indirections.
|
static <V> SparseArrayState<V> |
insert(V oldV,
int[] oldD,
int[] oldS,
int[] oldDo,
int[] oldI,
V newV,
int[] newI)
An insertion operation in support of
JavaArrayKernel.insertSparse(Object, int[], int[], int[], int[], Object, int[]) . |
static int[][] |
merge(int[] indices,
int[] indirections)
Merges sliced indirections by physical index.
|
static int[][] |
merge(int[] oldIndices,
int[] oldIndirections,
int[] newIndices,
int[] newIndirections,
int[] dims,
int[] strides,
int[] dimOffsets)
Merges old and new array metadata.
|
static int |
normalize(int[] values,
int start,
int end)
Normalizes a range of sorted values such that duplicates are removed.
|
static <V> SparseArrayState<V> |
slice(int[] slices,
V srcV,
int[] srcD,
int[] srcS,
int[] srcDo,
int[] srcI,
int[] srcIo,
int[] srcIi,
V dstV,
int[] dstD,
int[] dstS,
int[] dstDo,
int[] dstI,
int[] dstIo,
int[] dstIi)
A slicing operation in support of
JavaArrayKernel.sliceSparse(int[], Object, int[], int[], int[], int[], int[], int[], Object, int[], int[], int[], int[], int[], int[])
. |
public static final <V> SparseArrayState<V> insert(V oldV, int[] oldD, int[] oldS, int[] oldDo, int[] oldI, V newV, int[] newI)
JavaArrayKernel.insertSparse(Object, int[], int[], int[], int[], Object, int[])
.public static final <V> SparseArrayState<V> slice(int[] slices, V srcV, int[] srcD, int[] srcS, int[] srcDo, int[] srcI, int[] srcIo, int[] srcIi, V dstV, int[] dstD, int[] dstS, int[] dstDo, int[] dstI, int[] dstIo, int[] dstIi)
JavaArrayKernel.sliceSparse(int[], Object, int[], int[], int[], int[], int[], int[], Object, int[], int[], int[], int[], int[], int[])
.public static final <V> SparseArrayState<V> assign(V oldV, V newV, int[][] mergeResult)
SparseArrayState
.V
- the storage array type.oldV
- the old values.newV
- the new values.mergeResult
- the result of merge(int[], int[], int[], int[], int[], int[], int[])
.SparseArrayState
.public static final int[][] merge(int[] oldIndices, int[] oldIndirections, int[] newIndices, int[] newIndirections, int[] dims, int[] strides, int[] dimOffsets)
oldIndices
- the old physical indices. Invariant: Sorted in ascending order, and does not contain duplicates.oldIndirections
- the indirections on old values.newIndices
- the new physical indices. Invariant: Sorted in ascending order, and does not contain duplicates.newIndirections
- the indirections on new values.dims
- the dimensions.strides
- the strides.dimOffsets
- the dimension offsets.public static final int normalize(int[] values, int start, int end)
values
- the array of values.start
- the start index.end
- the end index.public static final int[] getSlicedIndirections(int[] sliceOffsets, int[] sliceCounts, int[] slices, int[] dimOffsets, int[] indirectionOffsets, int[] indirections, int[] dims)
sliceOffsets
- the slice offsets.sliceCounts
- the slice counts.slices
- the slices.dimOffsets
- the dimension offsets.indirectionOffsets
- the indirection offsets.indirections
- the indirections.dims
- the dimensions.public static final int[][] merge(int[] indices, int[] indirections)
indices
- the physical indices.indirections
- the sliced indirections.