CDMA client API  3.1.0
CDMA core library
org.gumtree.data.math.GMath Class Reference

List of all members.

Static Public Member Functions

static IArray transpose (final IArray array, final int dim1, final int dim2)
static IArray add (final IArray array1, final IArray array2) throws ShapeNotMatchException
static IArray add (final IArray array, final double value)
static IArray eltMultiply (final IArray array1, final IArray array2) throws ShapeNotMatchException
static IArray scale (final IArray array, final double value)
static IArray eltInverse (final IArray array) throws DivideByZeroException
static IArray matMultiply (final IArray array1, final IArray array2) throws ShapeNotMatchException
static double vecDot (final IArray array1, final IArray array2) throws ShapeNotMatchException
static IArray sqrt (final IArray array)
static IArray exp (final IArray array)
static IArray ln (final IArray array)
static IArray log10 (final IArray array)
static IArray sin (final IArray array)
static IArray asin (final IArray array)
static IArray cos (final IArray array)
static IArray acos (final IArray array)
static IArray tan (final IArray array)
static IArray atan (final IArray array)
static IArray power (final IArray array, final int power)
static double powerSum (final IArray array, final IArray axis, final int dimension, final int power) throws ShapeNotMatchException
static double getMaximum (final IArray array)
static double getMinimum (final IArray array)
static double sum (final IArray array)
static IArray sumForDimension (final IArray array, final int dimension, final boolean isVariance) throws ShapeNotMatchException
static double getNorm (final IArray array)
static IArray normalise (final IArray array)
static IArray integrateDimension (final IArray array, final int dimension, final boolean isVariance) throws ShapeNotMatchException
static IArray toEltDivide (final IArray array1, final IArray array2) throws ShapeNotMatchException
static IArray eltDivide (final IArray array1, final IArray array2) throws ShapeNotMatchException

Detailed Description

CDMA math library. Most of the calculation will be delegated to object level calculation.

Author:
nxi

Member Function Documentation

static IArray org.gumtree.data.math.GMath.acos ( final IArray  array) [static]

Calculate the arc cosine value of each elements in the IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.add ( final IArray  array1,
final IArray  array2 
) throws ShapeNotMatchException [static]

Add two IArray together, element-wisely. The two arrays must have the same shape.

Parameters:
array1in IArray type
array2in IArray type
Returns:
IArray with new storage
Exceptions:
ShapeNotMatchException
static IArray org.gumtree.data.math.GMath.add ( final IArray  array,
final double  value 
) [static]

Add a value to the IArray element-wisely.

Parameters:
arrayin IArray type
valuedouble value
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.asin ( final IArray  array) [static]

Calculate the arc sine value of each elements in the IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.atan ( final IArray  array) [static]

Calculate the arc trigonometric value of each elements in the IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.cos ( final IArray  array) [static]

Calculate the cosine value of each elements in the IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.eltDivide ( final IArray  array1,
final IArray  array2 
) throws ShapeNotMatchException [static]

Element-wise divide the values of one array by another. The result will be saved in a new IArray object.

Parameters:
array1IArray object
array2IArray object
Returns:
new IArray object
Exceptions:
ShapeNotMatchExceptionshape not match

Inverse every element of the array into a new storage.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
Exceptions:
DivideByZeroException
static IArray org.gumtree.data.math.GMath.eltMultiply ( final IArray  array1,
final IArray  array2 
) throws ShapeNotMatchException [static]

Multiply the two arrays element-wisely. Xij = Aij * Bij. The two arrays must have the same shape.

Parameters:
array1in IArray type
array2in IArray type
Returns:
IArray with new storage
Exceptions:
ShapeNotMatchException
static IArray org.gumtree.data.math.GMath.exp ( final IArray  array) [static]

Calculate the e raised to the power of double values in the IArray element-wisely.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static double org.gumtree.data.math.GMath.getMaximum ( final IArray  array) [static]

Find the maximum value of the array.

Parameters:
arrayin IArray type
Returns:
a double value
static double org.gumtree.data.math.GMath.getMinimum ( final IArray  array) [static]

Find the maximum value of the array.

Parameters:
arrayin IArray type
Returns:
a double value
static double org.gumtree.data.math.GMath.getNorm ( final IArray  array) [static]

Get the L2 norm of the IArray. The array must have only one dimension.

Parameters:
arrayin IArray type
Returns:
a double value
static IArray org.gumtree.data.math.GMath.integrateDimension ( final IArray  array,
final int  dimension,
final boolean  isVariance 
) throws ShapeNotMatchException [static]

Integrate on given dimension. The result array will be one dimensional reduced from the given array.

Parameters:
dimensioninteger value
arrayIArray object
isVariancetrue if the array serves as variance
Returns:
new IArray object
Exceptions:
ShapeNotMatchException
static IArray org.gumtree.data.math.GMath.ln ( final IArray  array) [static]

Calculate an element-wise natural logarithm (base e) of values of an IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.log10 ( final IArray  array) [static]

Calculate an element-wise logarithm (base 10) of values of an IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.matMultiply ( final IArray  array1,
final IArray  array2 
) throws ShapeNotMatchException [static]

Multiple two arrays in matrix multiplication rule. The two arrays must comply matrix multiply requirement.

Parameters:
array1in IArray type
array2in IArray type
Returns:
IArray with new storage
Exceptions:
ShapeNotMatchException
static IArray org.gumtree.data.math.GMath.normalise ( final IArray  array) [static]

Normalise the vector to norm = 1.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.power ( final IArray  array,
final int  power 
) [static]

Do an element-wise power calculation of the array. Yij = Xij ^ power.

Parameters:
arrayin IArray type
powerinteger value
Returns:
IArray with new storage
static double org.gumtree.data.math.GMath.powerSum ( final IArray  array,
final IArray  axis,
final int  dimension,
final int  power 
) throws ShapeNotMatchException [static]

Do a power-sum on a certain dimension. A power-sum will raise all element of the array to a certain power, then do a sum on a certain dimension, and put weight on the result.

Parameters:
arrayin IArray type
axisin IArray type
dimensioninteger value
powerinteger value
Returns:
a double value
Exceptions:
ShapeNotMatchException
static IArray org.gumtree.data.math.GMath.scale ( final IArray  array,
final double  value 
) [static]

Scale the array with a double value.

Parameters:
arrayin IArray type
valuedouble value
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.sin ( final IArray  array) [static]

Calculate the sine value of each elements in the IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.sqrt ( final IArray  array) [static]

Calculate the square root value of every element of the array.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static double org.gumtree.data.math.GMath.sum ( final IArray  array) [static]

Calculate the sum value of the array.

Parameters:
arrayin IArray type
Returns:
a double value
static IArray org.gumtree.data.math.GMath.sumForDimension ( final IArray  array,
final int  dimension,
final boolean  isVariance 
) throws ShapeNotMatchException [static]

Do sum calculation for every slice of the array on a dimension. The result will be a one dimensional IArray.

Parameters:
arrayin IArray type
dimensioninteger value
isVariancetrue if the array serves as variance
Returns:
IArray with new storage
Exceptions:
ShapeNotMatchException
static IArray org.gumtree.data.math.GMath.tan ( final IArray  array) [static]

Calculate the trigonometric value of each elements in the IArray.

Parameters:
arrayin IArray type
Returns:
IArray with new storage
static IArray org.gumtree.data.math.GMath.toEltDivide ( final IArray  array1,
final IArray  array2 
) throws ShapeNotMatchException [static]

Element-wise divide the values of one array by another. The result will be saved in a new IArray object.

Parameters:
array1IArray object
array2IArray object
Returns:
new IArray object
Exceptions:
ShapeNotMatchExceptionshape not match
static IArray org.gumtree.data.math.GMath.transpose ( final IArray  array,
final int  dim1,
final int  dim2 
) [static]

Transpose the two given dimension of the array. The array has to have more than one dimension. A'=A.

Parameters:
arrayin IArray type
dim1an integer value
dim2an integer value
Returns:
IArray with new storage
static double org.gumtree.data.math.GMath.vecDot ( final IArray  array1,
final IArray  array2 
) throws ShapeNotMatchException [static]

Calculate the vector dot production of two arrays. Both array must have the same size.

Parameters:
array1in IArray type
array2in IArray type
Returns:
a double value
Exceptions:
ShapeNotMatchException

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables