Interface INumpyArrayWrapper

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Object get​(int... indices)
      Gets the value of a single element in the numpy array denoted by its indices.
      Object getRawArray()
      Gets the native array containing the numpy array data.
      int[] getShape()
      Gets the shape of the underlying Numpy array.
      boolean isFloatingPoint()
      Returns a boolean indicating that the underlying array type is a floating point one or not.
      int numberOfBits()
      The space allocated by each element of the numpy array in terms of bits.
      void set​(Object value, int... index)
      Sets the value of a single element in the numpy array denoted by its indices.
      NumpyArray transpose()
      Transposes a numpy array by reversing its dimensions.
      NumpyArray wrapInnerSubsetArray​(int... indices)
      Wraps a subset of the numpy array.
    • Method Detail

      • getShape

        int[] getShape()
        Gets the shape of the underlying Numpy array.
        Returns:
        The shape of the array as an int[].
      • get

        Object get​(int... indices)
        Gets the value of a single element in the numpy array denoted by its indices.
        Parameters:
        indices - The index of the element to be retrieved.
        Returns:
        An object-wrapped instance of the element in the Numpy array.
      • set

        void set​(Object value,
                 int... index)
        Sets the value of a single element in the numpy array denoted by its indices.
        Parameters:
        value - The new value to be assigned to the numpy element.
        index - The index of the element to be set.
      • isFloatingPoint

        boolean isFloatingPoint()
        Returns a boolean indicating that the underlying array type is a floating point one or not.
        Returns:
        A boolean value indicating floating point of the elements.
      • numberOfBits

        int numberOfBits()
        The space allocated by each element of the numpy array in terms of bits.
        Returns:
        Number of bit needed for each element.
      • transpose

        NumpyArray transpose()
        Transposes a numpy array by reversing its dimensions.
        Returns:
        The transposed numpy array.
      • wrapInnerSubsetArray

        NumpyArray wrapInnerSubsetArray​(int... indices)
        Wraps 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, :, :].
        Parameters:
        indices - The indices of the first dimensions to keep.
        Returns:
        A new INumpyArrayWrapper wrapping the inner dimensions. This array has the same reference.
      • getRawArray

        Object getRawArray()
        Gets the native array containing the numpy array data.
        Returns:
        The underlying native array.