A class for sparse array operations. More...
#include <SparseOps.hpp>
Static Public Member Functions | |
static jobject | createSparseArrayState (JNIEnv *env, ArrayPinHandler::jarray_type type, MergeResult *res, jarray oldV, jarray newV) |
Creates a sparse array by assigning old and new array values into it. More... | |
static MergeResult * | merge (jint *oldIndices, jint *oldIndirections, jint oldLen, jint *newIndices, jint *newIndirections, jint newLen, jint *dims, jint *strides, jint *dimOffsets, jint nDims) |
Merges old and new array metadata. More... | |
static jint | normalize (jint *values, jint start, jint end) |
Normalizes a range of sorted values such that duplicates are removed. More... | |
static void | getSlicedIndirections (jint *sliceOffsets, jint *sliceCounts, jint *slices, jint *dimOffsets, jint *indirectionOffsets, jint *indirections, jint nIndirections, jint *dims, jint nDims, jint *result, jint &len) |
Gets the sliced indirections. More... | |
static void | merge (jint *indices, jint *indirections, jint len, jint *resIndices, jint *resIndirections, jint &resLen) |
Merges sliced indirections by physical index. More... | |
static jobject | slice (JNIEnv *env, jobject thisObj, jintArray slices, jobject srcV, jintArray srcD, jintArray srcS, jintArray srcDo, jintArray srcI, jintArray srcIo, jintArray srcIi, jobject dstV, jintArray dstD, jintArray dstS, jintArray dstDo, jintArray dstI, jintArray dstIo, jintArray dstIi) |
Slices one sparse array into another. More... | |
static jobject | insert (JNIEnv *env, jobject thisObj, jobject oldV, jintArray oldD, jintArray oldS, jintArray oldDo, jintArray oldI, jobject newV, jintArray newI) |
Inserts elements into a sparse array. More... | |
A class for sparse array operations.
|
static |
Creates a sparse array by assigning old and new array values into it.
env | the JNI environment. |
type | the common array type. |
res | the MergeResult. |
oldV | the old array. |
newV | the new array. |
|
static |
Gets the sliced indirections.
sliceOffsets | the slice offsets. |
sliceCounts | the slice counts. |
slices | the slices. |
dimOffsets | the dimension offsets. |
indirectionOffsets | the indirection offsets. |
indirections | the indirections. |
nIndirections | the number of indirections. |
dims | the dimensions. |
nDims | the number of dimensions. |
result | the result array. |
len | the result length. |
|
static |
Inserts elements into a sparse array.
env | the JNI environment. |
thisObj | this object. |
oldV | the old values. |
oldD | the old dimensions. |
oldS | the old strides. |
oldDo | the old dimension offsets. |
oldI | the old physical indices. Invariant: Sorted in ascending order, and does not contain duplicates. |
newV | the new values. |
newI | the new physical indices, which need not be sorted in ascending order. |
|
static |
Merges old and new array metadata.
oldIndices | the old physical indices. Invariant: Sorted in ascending order, and does not contain duplicates. |
oldIndirections | the indirections on old values. |
oldLen | the old array length. |
newIndices | the new physical indices. Invariant: Sorted in ascending order, and does not contain duplicates. |
newIndirections | the indirections on new values. |
newLen | the new array length. |
dims | the dimensions. |
strides | the strides. |
dimOffsets | the dimension offsets. |
nDims | the number of dimensions. |
|
static |
Merges sliced indirections by physical index.
indices | the physical indices. |
indirections | the sliced indirections. |
len | the number of elements. |
resIndices | the resulting physical indices. |
resIndirections | the resulting sliced indirections. |
resLen | the resulting number of elements. |
|
static |
Normalizes a range of sorted values such that duplicates are removed.
values | the array of values. |
start | the start index. |
end | the end index. |
|
static |
Slices one sparse array into another.
env | the JNI environment. |
thisObj | this object. |
slices | the slicing specification. |
srcV | the source values. |
srcD | the source dimensions. |
srcS | the source strides. |
srcDo | the source dimension offsets. |
srcI | the source physical indices. Invariant: Sorted in ascending order, and does not contain duplicates. |
srcIo | the source indirection offsets. |
srcIi | the source indirections. |
dstV | the destination values. |
dstD | the destination dimensions. |
dstS | the destination strides. |
dstDo | the destination dimension offsets. |
dstI | the destination physical indices. Invariant: Sorted in ascending order, and does not contain duplicates. |
dstIo | the destination indirection offsets. |
dstIi | the destination indirections. |