Class NumpyArrayOperationWithAxisReduction<InputType,​OutputType>

  • Type Parameters:
    InputType - The element type of the input numpy array.
    OutputType - The element type of the output numpy array.

    public abstract class NumpyArrayOperationWithAxisReduction<InputType,​OutputType>
    extends Object
    Base class for all the operations that performs an aggregation and reduction on a given NumpyArray.
    • Constructor Detail

      • NumpyArrayOperationWithAxisReduction

        public NumpyArrayOperationWithAxisReduction()
    • Method Detail

      • apply

        public NumpyArray<OutputType> apply​(NumpyArray<InputType> array,
                                            int axis,
                                            boolean keepDimensions)
        Applies the operation on the numpy array.
        Parameters:
        array - Input array to perform operation on.
        axis - The axis that should be reduced on.
        keepDimensions - A flag indicating to keep the same number of dimension as the input.
        Returns:
        The numpy array that contains the result of the reduction.
      • createInstanceResultNumpyArray

        public NumpyArray<OutputType> createInstanceResultNumpyArray​(int[] shape)
        Instantiate the result numpy array.
        Parameters:
        shape - The shape of the desired array.
        Returns:
        An empty array with the desired specifications.
      • reduceAxisValues

        public abstract Object reduceAxisValues​(Object[] valuesInAxis)
        The core operation that does the aggregation.
        Parameters:
        valuesInAxis - The elements of the specified axis.
        Returns:
        The aggregated value.