Class AbstractNDArrayReshapeView<T,​T2 extends Number>

    • Method Detail

      • mapOnSlices

        public NDArray<T> mapOnSlices​(BiFunction<NDArray<T>,​int[],​NDArray<?>> func,
                                      int... iterationDims)
        Description copied from interface: NDArray
        Apply the given function to each slices of the array, and create a new NDArray with the calculated new values. Please note that slices might not be processed in a sequential order!
        Specified by:
        mapOnSlices in interface NDArray<T>
        Overrides:
        mapOnSlices in class AbstractNDArray<T,​T2 extends Number>
        Parameters:
        func - function that receives slice and its Cartesian coordinate along the iteration dimensions, and returns a new array with the same size as the slice
        iterationDims - dimensions along which iteration is performed
        Returns:
        the new NDArray with the calculated new values
      • applyOnSlices

        public NDArray<T> applyOnSlices​(BiFunction<NDArray<T>,​int[],​NDArray<?>> func,
                                        int... iterationDims)
        Description copied from interface: NDArray
        Apply the given function to each slices of the array, and override each entry with the returned slice. Please note that slices might not be processed in a sequential order!
        Specified by:
        applyOnSlices in interface NDArray<T>
        Overrides:
        applyOnSlices in class AbstractNDArray<T,​T2 extends Number>
        Parameters:
        func - function that receives the value of the current entry and its Cartesian coordinate, and returns a slice from which values are copied to original array
        iterationDims - dimensions along which iteration is performed
        Returns:
        itself after the update