shared
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends
Static Public Member Functions | List of all members
MappingOps Class Reference

A class for mapping and slicing operations. More...

#include <MappingOps.hpp>

Static Public Member Functions

static void assignMappingIndices (jint *indices, const jint *dims, const jint *strides, jint nDims)
 Creates an array of physical indices. More...
 
static void assignSlicingIndices (jint *indices, const jint *dims, const jint *strides, jint nDims, jint **sliceIndices)
 Creates an array of physical slicing indices. More...
 
static void checkDimensions (const jint *dims, const jint *strides, jint nDims, jint len)
 Checks an array's dimensions and strides. More...
 
static void assign (JNIEnv *env, ArrayPinHandler::jarray_type type, jarray srcV, jint *srcIndices, jarray dstV, jint *dstIndices, jint nIndices)
 Assigns source values to destination values based on arrays of physical indices. More...
 
static void map (JNIEnv *env, jobject thisObj, jintArray bounds, jobject srcV, jintArray srcD, jintArray srcS, jobject dstV, jintArray dstD, jintArray dstS)
 Performs a mapping operation. More...
 
static MappingResultmap (const jint *boundsArr, const jint *srcDArr, const jint *srcSArr, jint srcLen, const jint *dstDArr, const jint *dstSArr, jint dstLen, jint nDims)
 Computes source and destination mapping indices. More...
 
static void slice (JNIEnv *env, jobject thisObj, jintArray slices, jobject srcV, jintArray srcD, jintArray srcS, jobject dstV, jintArray dstD, jintArray dstS)
 Performs a slicing operation. More...
 
static MappingResultslice (const jint *slicesArr, jint nSlices, const jint *srcDArr, const jint *srcSArr, jint srcLen, const jint *dstDArr, const jint *dstSArr, jint dstLen, jint nDims)
 Computes source and destination slicing indices. More...
 

Detailed Description

A class for mapping and slicing operations.

Member Function Documentation

void MappingOps::assign ( JNIEnv *  env,
ArrayPinHandler::jarray_type  type,
jarray  srcV,
jint *  srcIndices,
jarray  dstV,
jint *  dstIndices,
jint  nIndices 
)
static

Assigns source values to destination values based on arrays of physical indices.

Parameters
envthe JNI environment.
typethe array type.
srcVthe source array.
srcIndicesthe source indices.
dstVthe destination array.
dstIndicesthe destination indices.
nIndicesthe number of indices.
void MappingOps::assignMappingIndices ( jint *  indices,
const jint *  dims,
const jint *  strides,
jint  nDims 
)
static

Creates an array of physical indices.

Parameters
indicesthe result array.
dimsthe mapping dimensions.
stridesthe strides.
nDimsthe number of dimensions.
void MappingOps::assignSlicingIndices ( jint *  indices,
const jint *  dims,
const jint *  strides,
jint  nDims,
jint **  sliceIndices 
)
static

Creates an array of physical slicing indices.

Parameters
indicesthe result array.
dimsthe slicing dimensions.
stridesthe strides.
nDimsthe number of dimensions.
sliceIndicesthe indices to slice on arranged by dimension.
void MappingOps::checkDimensions ( const jint *  dims,
const jint *  strides,
jint  nDims,
jint  len 
)
static

Checks an array's dimensions and strides.

Parameters
lenthe array length.
dimsthe dimensions.
stridesthe strides.
nDimsthe number of dimensions.
void MappingOps::map ( JNIEnv *  env,
jobject  thisObj,
jintArray  bounds,
jobject  srcV,
jintArray  srcD,
jintArray  srcS,
jobject  dstV,
jintArray  dstD,
jintArray  dstS 
)
static

Performs a mapping operation.

Parameters
envthe JNI environment.
thisObjthis object.
boundsthe mapping bounds.
srcVthe source values.
srcDthe source dimensions.
srcSthe source strides.
dstVthe destination values.
dstDthe destination dimensions.
dstSthe destination strides.
MappingResult * MappingOps::map ( const jint *  boundsArr,
const jint *  srcDArr,
const jint *  srcSArr,
jint  srcLen,
const jint *  dstDArr,
const jint *  dstSArr,
jint  dstLen,
jint  nDims 
)
static

Computes source and destination mapping indices.

Parameters
boundsArrthe mapping bounds.
srcDArrthe source dimensions.
srcSArrthe source strides.
srcLenthe number of source values.
dstDArrthe destination dimensions.
dstSArrthe destination strides.
dstLenthe number of destination values.
nDimsthe number of dimensions.
Returns
the MappingResult.
void MappingOps::slice ( JNIEnv *  env,
jobject  thisObj,
jintArray  slices,
jobject  srcV,
jintArray  srcD,
jintArray  srcS,
jobject  dstV,
jintArray  dstD,
jintArray  dstS 
)
static

Performs a slicing operation.

Parameters
envthe JNI environment.
thisObjthis object.
slicesthe slicing specification.
srcVthe source values.
srcDthe source dimensions.
srcSthe source strides.
dstVthe destination values.
dstDthe destination dimensions.
dstSthe destination strides.
MappingResult * MappingOps::slice ( const jint *  slicesArr,
jint  nSlices,
const jint *  srcDArr,
const jint *  srcSArr,
jint  srcLen,
const jint *  dstDArr,
const jint *  dstSArr,
jint  dstLen,
jint  nDims 
)
static

Computes source and destination slicing indices.

Parameters
slicesArrthe slicing specification.
nSlicesthe number of slices.
srcDArrthe source dimensions.
srcSArrthe source strides.
srcLenthe number of source values.
dstDArrthe destination dimensions.
dstSArrthe destination strides.
dstLenthe number of destination values.
nDimsthe number of dimensions.
Returns
the MappingResult.