CDMA engine API  3.1.0
CDMA core library
org.gumtree.data.utils.IArrayUtils Interface Reference

The IArrayUtils interface defines commons need of operations to be perform on a IArray. More...

List of all members.

Public Member Functions

IArray getArray ()
void copyTo (final IArray newArray) throws ShapeNotMatchException
Object copyTo1DJavaArray ()
Object get1DJavaArray (final Class<?> wantType)
Object copyToNDJavaArray ()
void checkShape (final IArray newArray) throws ShapeNotMatchException
IArrayUtils concatenate (final IArray array) throws ShapeNotMatchException
IArrayUtils reduce ()
IArrayUtils reduce (int dim)
IArrayUtils reduceTo (int rank)
IArrayUtils reshape (int[] shape) throws ShapeNotMatchException
IArrayUtils section (final int[] origin, final int[] shape) throws InvalidRangeException
IArrayUtils section (int[] origin, int[] shape, long[] stride) throws InvalidRangeException
IArrayUtils sectionNoReduce (int[] origin, int[] shape, long[] stride) throws InvalidRangeException
IArrayUtils sectionNoReduce (List< IRange > ranges) throws InvalidRangeException
IArrayUtils slice (int dim, int value)
IArrayUtils transpose (int dim1, int dim2)
boolean isConformable (IArray array)
IArrayUtils eltAnd (IArray booleanMap) throws ShapeNotMatchException
IArrayUtils integrateDimension (int dimension, boolean isVariance) throws ShapeNotMatchException
IArrayUtils enclosedIntegrateDimension (int dimension, boolean isVariance) throws ShapeNotMatchException
IArrayUtils flip (int dim)
IArrayUtils permute (int[] dims)

Detailed Description

The IArrayUtils interface defines commons need of operations to be perform on a IArray.

Note:
When developing a data consider using the default implementation. You should redefine this interface implementation, if you need to gain efficiency. Indeed all methods in default implementation use CDMA calls and do not directly access the storage.

engineAPI The IArrayUtils aims to provide array's manipulation methods. Essentially shape, memory copy or section reduction operations of the array.


Member Function Documentation

Check if the shape matches with another IArray object.

Parameters:
newArrayanother IArray object
Exceptions:
ShapeNotMatchExceptionshape not match

Concatenate with another array. The array need to be equal of less in rank.

Parameters:
arrayIArray object
Returns:
new IArray
Exceptions:
ShapeNotMatchExceptionmismatching shape

Copy the contents of this array to another array. The two arrays must have the same size.

Parameters:
newArrayan existing array
Exceptions:
ShapeNotMatchExceptionwrong shape

Copy this array to a 1D Java primitive array of type getElementType(), with the physical order of the result the same as logical order.

Returns:
a Java 1D array of type getElementType().

Copy this array to a n-Dimensional Java primitive array of type getElementType() and rank getRank(). Makes a copy of the data.

Returns:
a Java ND array of type getElementType().

Element-wise apply a boolean map to the array. The values of the IArray will get updated. The map's rank must be smaller or equal to the rank of the array. If the rank of the map is smaller, apply the map to subset of the array in the lowest dimensions iteratively. For each element, if the AND map value is true, return itself, otherwise return NaN.

Parameters:
booleanMapboolean IArray
Returns:
IArray itself
Exceptions:
ShapeNotMatchException

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

Parameters:
dimensioninteger value
isVariancetrue if the array serves as variance
Returns:
new IArray object
Exceptions:
ShapeNotMatchException

Create a new IArray using same backing store as this Array, by flipping the index so that it runs from shape[index]-1 to 0.

Parameters:
dimdimension to flip
Returns:
the new IArray
Object org.gumtree.data.utils.IArrayUtils.get1DJavaArray ( final Class<?>  wantType)
Parameters:
wantTypea Class instance
Returns:
generic Object instance

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

Parameters:
dimensioninteger value
isVariancetrue if the array serves as variance
Returns:
new IArray object
Exceptions:
ShapeNotMatchException

Check if the two arrays are conformable. They must have exactly the same shape (excluding dimensions of length 1)

Parameters:
arrayin IArray type
Returns:
IArray with new storage

Create a new IArray using same backing store as this Array, by permuting the indices.

Parameters:
dimsthe old index dims[k] becomes the new kth index.
Returns:
the new IArray

Create a new IArray using same backing store as this Array, by eliminating any dimensions with length one.

Returns:
the new IArray

Create a new IArray using same backing store as this Array, by eliminating the specified dimension.

Parameters:
dimdimension to eliminate: must be of length one, else IllegalArgumentException
Returns:
the new IArray

Reduce the array to at least certain rank. The dimension with only 1 bin will be reduced.

Parameters:
rankin int type
Returns:
CDMA IArray with the same storage

Create a new Array, with the given shape, that references the same backing store as this IArray.

Parameters:
shapethe new shape
Returns:
the new IArray
IArrayUtils org.gumtree.data.utils.IArrayUtils.section ( final int[]  origin,
final int[]  shape 
) throws InvalidRangeException

Create a new IArray as a subsection of this Array, with rank reduction. No data is moved, so the new IArray references the same backing store as the original.

Parameters:
originint array specifying the starting index. Must be same rank as original IArray.
shapeint array specifying the extents in each dimension. This becomes the shape of the returned IArray. Must be same rank as original IArray. If shape[dim] == 1, then the rank of the resulting IArray is reduced at that dimension.
Returns:
IArray object
Exceptions:
InvalidRangeExceptioninvalid range
IArrayUtils org.gumtree.data.utils.IArrayUtils.section ( int[]  origin,
int[]  shape,
long[]  stride 
) throws InvalidRangeException

Create a new IArray as a subsection of this Array, with rank reduction. No data is moved, so the new IArray references the same backing store as the original.

Parameters:
originint array specifying the starting index. Must be same rank as original IArray.
shapeint array specifying the extents in each dimension. This becomes the shape of the returned IArray. Must be same rank as original IArray. If shape[dim] == 1, then the rank of the resulting IArray is reduced at that dimension.
strideint array specifying the strides in each dimension. If null, assume all ones.
Returns:
the new IArray
Exceptions:
InvalidRangeExceptioninvalid range
IArrayUtils org.gumtree.data.utils.IArrayUtils.sectionNoReduce ( int[]  origin,
int[]  shape,
long[]  stride 
) throws InvalidRangeException

Create a new ArrayUtils as a subsection of this Array, without rank reduction. No data is moved, so the new IArray references the same backing store as the original.

Parameters:
originint array specifying the starting index. Must be same rank as original IArray.
shapeint array specifying the extents in each dimension. This becomes the shape of the returned IArray. Must be same rank as original IArray.
stridelong array specifying the strides in each dimension. If null, assume all ones.
Returns:
the new IArray
Exceptions:
InvalidRangeExceptioninvalid range

Create a new ArrayUtils as a subsection of this Array, without rank reduction. No data is moved, so the new IArray references the same backing store as the original.

Parameters:
rangeslist of Ranges that specify the array subset. Must be same rank as original IArray. A particular Range: 1) may be a subset, or 2) may be null, meaning use entire Range.
Returns:
the new IArray

Create a new IArray using same backing store as this Array, by fixing the specified dimension at the specified index value. This reduces rank by 1.

Parameters:
dimwhich dimension to fix
valueat what index value
Returns:
a new IArray

Create a new IArray using same backing store as this Array, by transposing two of the indices.

Parameters:
dim1transpose these two indices
dim2transpose these two indices
Returns:
the new IArray

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