Class AbstractNDArrayReshapeView<T,T2 extends Number>
- java.lang.Object
-
- io.github.hakkelt.ndarrays.internal.AbstractNDArray<T,T2>
-
- io.github.hakkelt.ndarrays.internal.AbstractNDArrayView<T,T2>
-
- io.github.hakkelt.ndarrays.internal.AbstractNDArrayReshapeView<T,T2>
-
- Direct Known Subclasses:
ComplexNDArrayReshapeView
,RealNDArrayReshapeView
public abstract class AbstractNDArrayReshapeView<T,T2 extends Number> extends AbstractNDArrayView<T,T2>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDArray<T>
applyOnSlices(BiFunction<NDArray<T>,int[],NDArray<?>> func, int... iterationDims)
Apply the given function to each slices of the array, and override each entry with the returned slice.NDArray<T>
mapOnSlices(BiFunction<NDArray<T>,int[],NDArray<?>> func, int... iterationDims)
Apply the given function to each slices of the array, and create a new NDArray with the calculated new values.-
Methods inherited from class io.github.hakkelt.ndarrays.internal.AbstractNDArrayView
copy, dataTypeAsString, dtype, dtype2, equals, getNamePrefix, getParent, getTopMostParent, hashCode, linearIndexToViewIndices, similar
-
Methods inherited from class io.github.hakkelt.ndarrays.internal.AbstractNDArray
accumulate, apply, applyWithCartesianIndices, applyWithLinearIndices, contains, contentToString, contentToString, fillUsingCartesianIndices, fillUsingLinearIndices, forEach, forEachWithCartesianIndices, forEachWithLinearIndices, get, get, getImag, getImag, getReal, getReal, iterator, length, maybeParallelStream, ndim, norm, norm, parallelStream, prod, reduceSlices, set, set, setImag, setImag, setReal, setReal, shape, shape, spliterator, stream, streamCartesianIndices, streamLinearIndices, sum, toArray, toArray, toArray, toString, writeToFile
-
Methods inherited from interface io.github.hakkelt.ndarrays.NDArray
accumulate, add, add, add, add, add, add, add, add, addInplace, addInplace, addInplace, addInplace, addInplace, addInplace, addInplace, addInplace, concatenate, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, divide, divide, divide, divide, divide, divide, divide, divide, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, dropDims, fill, fill, inverseMask, map, mapWithCartesianIndices, mapWithLinearIndices, mask, mask, maskWithCartesianIndices, maskWithLinearIndices, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, norm, permuteDims, prod, reshape, selectDims, set, set, slice, squeeze, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, sum
-
-
-
-
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 interfaceNDArray<T>
- Overrides:
mapOnSlices
in classAbstractNDArray<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 sliceiterationDims
- 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 interfaceNDArray<T>
- Overrides:
applyOnSlices
in classAbstractNDArray<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 arrayiterationDims
- dimensions along which iteration is performed- Returns:
- itself after the update
-
-