|
CDMA client API
3.1.0
CDMA core library
|
The IArrayUtils interface defines commons need of operations to be perform on a IArray. More...
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) |
The IArrayUtils interface defines commons need of operations to be perform on a IArray.
The IArrayUtils aims to provide array's manipulation methods. Essentially shape, memory copy or section reduction operations of the array.
| void org.gumtree.data.utils.IArrayUtils.checkShape | ( | final IArray | newArray | ) | throws ShapeNotMatchException |
Check if the shape matches with another IArray object.
| newArray | another IArray object |
| ShapeNotMatchException | shape not match |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.concatenate | ( | final IArray | array | ) | throws ShapeNotMatchException |
Concatenate with another array. The array need to be equal of less in rank.
| array | IArray object |
| ShapeNotMatchException | mismatching shape |
| void org.gumtree.data.utils.IArrayUtils.copyTo | ( | final IArray | newArray | ) | throws ShapeNotMatchException |
Copy the contents of this array to another array. The two arrays must have the same size.
| newArray | an existing array |
| ShapeNotMatchException | wrong 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.
Copy this array to a n-Dimensional Java primitive array of type getElementType() and rank getRank(). Makes a copy of the data.
| IArrayUtils org.gumtree.data.utils.IArrayUtils.eltAnd | ( | IArray | booleanMap | ) | throws ShapeNotMatchException |
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.
| booleanMap | boolean IArray |
| ShapeNotMatchException |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.enclosedIntegrateDimension | ( | int | dimension, |
| boolean | isVariance | ||
| ) | throws ShapeNotMatchException |
Integrate on given dimension. The result array will be one dimensional reduced from the given array.
| dimension | integer value |
| isVariance | true if the array serves as variance |
| 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.
| dim | dimension to flip |
| Object org.gumtree.data.utils.IArrayUtils.get1DJavaArray | ( | final Class<?> | wantType | ) |
| wantType | a Class instance |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.integrateDimension | ( | int | dimension, |
| boolean | isVariance | ||
| ) | throws ShapeNotMatchException |
Integrate on given dimension. The result array will be one dimensional reduced from the given array.
| dimension | integer value |
| isVariance | true if the array serves as variance |
| ShapeNotMatchException |
| boolean org.gumtree.data.utils.IArrayUtils.isConformable | ( | IArray | array | ) |
Check if the two arrays are conformable. They must have exactly the same shape (excluding dimensions of length 1)
| array | in IArray type |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.permute | ( | int[] | dims | ) |
Create a new IArray using same backing store as this Array, by permuting the indices.
| dims | the old index dims[k] becomes the new kth index. |
Create a new IArray using same backing store as this Array, by eliminating any dimensions with length one.
Create a new IArray using same backing store as this Array, by eliminating the specified dimension.
| dim | dimension to eliminate: must be of length one, else IllegalArgumentException |
Reduce the array to at least certain rank. The dimension with only 1 bin will be reduced.
| rank | in int type |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.reshape | ( | int[] | shape | ) | throws ShapeNotMatchException |
Create a new Array, with the given shape, that references the same backing store as this IArray.
| shape | the new shape |
| 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.
| origin | int array specifying the starting index. Must be same rank as original IArray. |
| shape | int 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. |
| InvalidRangeException | invalid 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.
| origin | int array specifying the starting index. Must be same rank as original IArray. |
| shape | int 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. |
| stride | int array specifying the strides in each dimension. If null, assume all ones. |
| InvalidRangeException | invalid 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.
| origin | int array specifying the starting index. Must be same rank as original IArray. |
| shape | int array specifying the extents in each dimension. This becomes the shape of the returned IArray. Must be same rank as original IArray. |
| stride | long array specifying the strides in each dimension. If null, assume all ones. |
| InvalidRangeException | invalid range |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.sectionNoReduce | ( | List< IRange > | ranges | ) | 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.
| ranges | list 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. |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.slice | ( | int | dim, |
| int | value | ||
| ) |
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.
| dim | which dimension to fix |
| value | at what index value |
| IArrayUtils org.gumtree.data.utils.IArrayUtils.transpose | ( | int | dim1, |
| int | dim2 | ||
| ) |
Create a new IArray using same backing store as this Array, by transposing two of the indices.
| dim1 | transpose these two indices |
| dim2 | transpose these two indices |