Class Dim5FloatNumpyWrapper
- java.lang.Object
-
- ai.sklearn4j.core.libraries.numpy.wrappers.Dim5FloatNumpyWrapper
-
- All Implemented Interfaces:
INumpyArrayWrapper
public class Dim5FloatNumpyWrapper extends Object implements INumpyArrayWrapper
A wrapper over a 5 dimensions float array for NumpyArray class.
-
-
Constructor Summary
Constructors Constructor Description Dim5FloatNumpyWrapper(float[][][][][] array)Instantiate a new wrapper for 5 array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(int... indices)Gets the value of a single element in the numpy array denoted by its indices.float[][][][][]getArray()Gets the underlying native array object.ObjectgetRawArray()Gets the native array containing the numpy array data.int[]getShape()Gets the shape of the underlying Numpy array.booleanisFloatingPoint()Returns a boolean indicating that the underlying array type is a floating point one or not.intnumberOfBits()The space allocated by each element of the numpy array in terms of bits.voidset(Object value, int... indices)Sets the value of a single element in the numpy array denoted by its indices.NumpyArraytranspose()Transposes a numpy array by reversing its dimensions.NumpyArraywrapInnerSubsetArray(int... indices)Wraps a subset of the numpy array.
-
-
-
Method Detail
-
getShape
public int[] getShape()
Description copied from interface:INumpyArrayWrapperGets the shape of the underlying Numpy array.- Specified by:
getShapein interfaceINumpyArrayWrapper- Returns:
- The shape of the array as an int[].
-
get
public Object get(int... indices)
Description copied from interface:INumpyArrayWrapperGets the value of a single element in the numpy array denoted by its indices.- Specified by:
getin interfaceINumpyArrayWrapper- Parameters:
indices- The index of the element to be retrieved.- Returns:
- An object-wrapped instance of the element in the Numpy array.
-
set
public void set(Object value, int... indices)
Description copied from interface:INumpyArrayWrapperSets the value of a single element in the numpy array denoted by its indices.- Specified by:
setin interfaceINumpyArrayWrapper- Parameters:
value- The new value to be assigned to the numpy element.indices- The index of the element to be set.
-
getArray
public float[][][][][] getArray()
Gets the underlying native array object.- Returns:
- The underlying native array object.
-
isFloatingPoint
public boolean isFloatingPoint()
Description copied from interface:INumpyArrayWrapperReturns a boolean indicating that the underlying array type is a floating point one or not.- Specified by:
isFloatingPointin interfaceINumpyArrayWrapper- Returns:
- A boolean value indicating floating point of the elements.
-
numberOfBits
public int numberOfBits()
Description copied from interface:INumpyArrayWrapperThe space allocated by each element of the numpy array in terms of bits.- Specified by:
numberOfBitsin interfaceINumpyArrayWrapper- Returns:
- Number of bit needed for each element.
-
getRawArray
public Object getRawArray()
Description copied from interface:INumpyArrayWrapperGets the native array containing the numpy array data.- Specified by:
getRawArrayin interfaceINumpyArrayWrapper- Returns:
- The underlying native array.
-
wrapInnerSubsetArray
public NumpyArray wrapInnerSubsetArray(int... indices)
Description copied from interface:INumpyArrayWrapperWraps a subset of the numpy array. This methods works only when slicing the most inner dimensions of the array. For example, if the shape is [2, 6, 4, 8], wrapInnerSubsetArray(1, 3) is equivalent to numpy array[1, 3, :, :].- Specified by:
wrapInnerSubsetArrayin interfaceINumpyArrayWrapper- Parameters:
indices- The indices of the first dimensions to keep.- Returns:
- A new INumpyArrayWrapper wrapping the inner dimensions. This array has the same reference.
-
transpose
public NumpyArray transpose()
Description copied from interface:INumpyArrayWrapperTransposes a numpy array by reversing its dimensions.- Specified by:
transposein interfaceINumpyArrayWrapper- Returns:
- The transposed numpy array.
-
-