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

A class for element-based operations. More...

#include <ElementOps.hpp>

Public Types

enum  element_type { REAL, COMPLEX, INTEGER }
 An enumeration of element types. More...
 
typedef jdouble raOp_t (const jdouble *, jint)
 Defines a real accumulator operation.
 
typedef jcomplex caOp_t (const jcomplex *, jint)
 Defines a complex accumulator operation.
 
typedef void ruOp_t (jdouble, jdouble *, jint)
 Defines a real unary operation.
 
typedef void cuOp_t (jcomplex, jcomplex *, jint)
 Defines a complex unary operation.
 
typedef void iuOp_t (jint, jint *, jint)
 Defines an integer unary operation.
 
typedef void ctorOp_t (const jcomplex *, jdouble *, jint)
 Defines a complex-to-real operation.
 
typedef void rtocOp_t (const jdouble *, jcomplex *, jint)
 Defines a real-to-complex operation.
 
typedef void itorOp_t (const jint *, jdouble *, jint)
 Defines an integer-to-real operation.
 

Public Member Functions

template<class T >
accumulatorOpProxy (JNIEnv *env, T(*op)(const T *, jint), jarray srcV, jboolean complex)
 
template<class T >
void unaryOpProxy (JNIEnv *env, void(*op)(T, T *, jint), jarray srcV, T argument, jboolean complex)
 
template<class T >
void binaryOpProxy (JNIEnv *env, jint type, jarray lhsV, jarray rhsV, jarray dstV, ElementOps::element_type elementType)
 
template<class S , class T >
void convertProxy (JNIEnv *env, void(*op)(const S *, T *, jint), jarray srcV, jboolean isSrcComplex, jarray dstV, jboolean isDstComplex)
 
template<class T >
void eAdd (const T *a, const T *b, T *r, jint len)
 
template<class T >
void eSub (const T *a, const T *b, T *r, jint len)
 
template<class T >
void eMul (const T *a, const T *b, T *r, jint len)
 
template<class T >
void eDiv (const T *a, const T *b, T *r, jint len)
 
template<class T >
void eMax (const T *a, const T *b, T *r, jint len)
 
template<class T >
void eMin (const T *a, const T *b, T *r, jint len)
 
template<class T >
void uSqr (T a, T *v, jint len)
 
template<class T >
void uInv (T a, T *v, jint len)
 
template<class T >
void uAdd (T a, T *v, jint len)
 
template<class T >
void uMul (T a, T *v, jint len)
 
template<class T >
void uFill (T a, T *v, jint len)
 
template<class T >
void uShuffle (T a, T *v, jint len)
 

Static Public Member Functions

static jdouble raOp (JNIEnv *env, jobject thisObj, jint type, jdoubleArray srcV)
 Performs a real accumulator operation. More...
 
static jdoubleArray caOp (JNIEnv *env, jobject thisObj, jint type, jdoubleArray srcV)
 Performs a complex accumulator operation. More...
 
static void ruOp (JNIEnv *env, jobject thisObj, jint type, jdouble a, jdoubleArray srcV)
 Applies a real unary operation. More...
 
static void cuOp (JNIEnv *env, jobject thisObj, jint type, jdouble aRe, jdouble aIm, jdoubleArray srcV)
 Applies a complex unary operation. More...
 
static void iuOp (JNIEnv *env, jobject thisObj, jint type, jint a, jintArray srcV)
 Applies an integer unary operation. More...
 
static void eOp (JNIEnv *env, jobject thisObj, jint type, jobject lhsV, jobject rhsV, jobject dstV, jboolean complex)
 Applies a binary operation. More...
 
static void convert (JNIEnv *env, jobject thisObj, jint type, jobject srcV, jboolean isSrcComplex, jobject dstV, jboolean isDstComplex)
 Performs a conversion operation. More...
 
template<class T >
static void uAdd (T, T *, jint)
 Templatized unary addition.
 
template<class T >
static void uMul (T, T *, jint)
 Templatized unary multiplication.
 
template<class T >
static void uSqr (T, T *, jint)
 Templatized unary square.
 
template<class T >
static void uInv (T, T *, jint)
 Templatized unary inverse.
 
template<class T >
static void uFill (T, T *, jint)
 Templatized unary fill.
 
template<class T >
static void uShuffle (T, T *, jint)
 Templatized unary shuffle.
 
template<class T >
static void eAdd (const T *, const T *, T *, jint)
 Templatized binary addition.
 
template<class T >
static void eSub (const T *, const T *, T *, jint)
 Templatized binary subtraction.
 
template<class T >
static void eMul (const T *, const T *, T *, jint)
 Templatized binary multiplication.
 
template<class T >
static void eDiv (const T *, const T *, T *, jint)
 Templatized binary division.
 
template<class T >
static void eMax (const T *, const T *, T *, jint)
 Templatized binary maximum.
 
template<class T >
static void eMin (const T *, const T *, T *, jint)
 Templatized binary minimum.
 

Static Public Attributes

static raOp_t raSum
 Real accumulator sum.
 
static raOp_t raProd
 Real accumulator product.
 
static raOp_t raMax
 Real accumulator maximum.
 
static raOp_t raMin
 Real accumulator minimum.
 
static raOp_t raVar
 Real accumulator variance.
 
static raOp_t raEnt
 Real accumulator entropy.
 
static caOp_t caSum
 Complex accumulator sum.
 
static caOp_t caProd
 Complex accumulator product.
 
static ruOp_t ruAbs
 Real unary absolute value.
 
static ruOp_t ruPow
 Real unary power.
 
static ruOp_t ruExp
 Real unary exponentiation.
 
static ruOp_t ruRnd
 Real unary randomization.
 
static ruOp_t ruLog
 Real unary natural logarithm.
 
static ruOp_t ruSqrt
 Real unary square root.
 
static ruOp_t ruCos
 Real unary cosine.
 
static ruOp_t ruSin
 Real unary sine.
 
static ruOp_t ruAtan
 Real unary arctangent.
 
static cuOp_t cuExp
 Complex unary exponentiation.
 
static cuOp_t cuRnd
 Complex unary randomization.
 
static cuOp_t cuConj
 Complex unary conjugation.
 
static cuOp_t cuCos
 Complex unary cosine.
 
static cuOp_t cuSin
 Complex unary sine.
 
static ctorOp_t ctorAbs
 Complex to real conversion by complex magnitudes.
 
static ctorOp_t ctorRe
 Complex to real conversion by real part.
 
static ctorOp_t ctorIm
 Complex to real conversion by imaginary part.
 
static rtocOp_t rtocRe
 Real to complex conversion by real part.
 
static rtocOp_t rtocIm
 Real to complex conversion by imaginary part.
 
static itorOp_t itor
 Integer to real conversion by up-casting.
 

Detailed Description

A class for element-based operations.

Member Enumeration Documentation

An enumeration of element types.

Enumerator
REAL 

Indicates real values.

COMPLEX 

Indicates complex values.

INTEGER 

Indicates integral values.

Member Function Documentation

jdoubleArray ElementOps::caOp ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jdoubleArray  srcV 
)
static

Performs a complex accumulator operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
srcVthe array.
Returns
the accumulated result.
void ElementOps::convert ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jobject  srcV,
jboolean  isSrcComplex,
jobject  dstV,
jboolean  isDstComplex 
)
static

Performs a conversion operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
srcVthe source values.
isSrcComplexwhether the source is complex-valued.
dstVthe destination values.
isDstComplexwhether the destination is complex-valued.
void ElementOps::cuOp ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jdouble  aRe,
jdouble  aIm,
jdoubleArray  srcV 
)
static

Applies a complex unary operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
aRethe real part of the argument, if any.
aImthe imaginary part of the argument, if any.
srcVthe array.
void ElementOps::eOp ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jobject  lhsV,
jobject  rhsV,
jobject  dstV,
jboolean  complex 
)
static

Applies a binary operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
lhsVthe left hand side values.
rhsVthe right hand side values.
dstVthe destination values.
complexwhether the operation is complex-valued.
void ElementOps::iuOp ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jint  a,
jintArray  srcV 
)
static

Applies an integer unary operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
athe argument, if any.
srcVthe array.
jdouble ElementOps::raOp ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jdoubleArray  srcV 
)
static

Performs a real accumulator operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
srcVthe array.
Returns
the accumulated result.
void ElementOps::ruOp ( JNIEnv *  env,
jobject  thisObj,
jint  type,
jdouble  a,
jdoubleArray  srcV 
)
static

Applies a real unary operation.

Parameters
envthe JNI environment.
thisObjthis object.
typethe operation type.
athe argument, if any.
srcVthe array.