Class RealNDArrayMaskView<T 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.AbstractNDArrayMaskView<T,T>
-
- io.github.hakkelt.ndarrays.internal.RealNDArrayMaskView<T>
-
- All Implemented Interfaces:
RealNDArray<T>
,NDArray<T>
,Iterable<T>
public class RealNDArrayMaskView<T extends Number> extends AbstractNDArrayMaskView<T,T> implements RealNDArray<T>
A view for an NDArray holding real values that selects values based on a specified mask. When mask(...) is called for a real NDArray, an instance of this class is returned.
-
-
Constructor Summary
Constructors Constructor Description RealNDArrayMaskView(NDArray<T> parent, NDArray<?> mask, boolean isInverse)
RealNDArrayMaskView(NDArray<T> parent, BiPredicate<T,?> func, boolean withLinearIndices)
RealNDArrayMaskView(NDArray<T> parent, Predicate<T> func)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDArray<T>
copyFrom(NDArray<?> array)
Updates this NDArray with the elements of the NDArray given as parameter.void
set(Number value, int linearIndex)
Sets the value of an element specified by linear indexing.void
set(Number value, int... indices)
Sets the value of an element specified by cartesian indexing.-
Methods inherited from class io.github.hakkelt.ndarrays.internal.AbstractNDArrayMaskView
applyOnSlices, equals, hashCode, mapOnSlices
-
Methods inherited from class io.github.hakkelt.ndarrays.internal.AbstractNDArrayView
copy, dataTypeAsString, dtype, dtype2, getNamePrefix, getParent, getTopMostParent, 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, 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, addInplace, addInplace, addInplace, addInplace, addInplace, addInplace, addInplace, apply, applyOnSlices, applyWithCartesianIndices, applyWithLinearIndices, contains, contentToString, contentToString, copy, dataTypeAsString, divide, divide, divide, divide, divide, divide, divide, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, divideInplace, dtype, equals, fillUsingCartesianIndices, fillUsingLinearIndices, forEach, forEachWithCartesianIndices, forEachWithLinearIndices, get, get, getNamePrefix, hashCode, iterator, length, mapOnSlices, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, multiplyInplace, ndim, norm, norm, norm, parallelStream, prod, reduceSlices, shape, shape, similar, spliterator, stream, streamCartesianIndices, streamLinearIndices, subtract, subtract, subtract, subtract, subtract, subtract, subtract, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, subtractInplace, sum, toArray, toArray, toArray, toString, writeToFile
-
Methods inherited from interface io.github.hakkelt.ndarrays.internal.RealNDArray
accumulate, add, addInplace, concatenate, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, divide, divideInplace, dropDims, fill, fill, inverseMask, map, mapWithCartesianIndices, mapWithLinearIndices, mask, mask, maskWithCartesianIndices, maskWithLinearIndices, multiply, multiplyInplace, permuteDims, prod, reshape, selectDims, slice, squeeze, subtract, subtractInplace, sum
-
-
-
-
Method Detail
-
copyFrom
public NDArray<T> copyFrom(NDArray<?> array)
Description copied from interface:NDArray
Updates this NDArray with the elements of the NDArray given as parameter.Note: the parameter NDArray must have the same shape and this NDArray!
-
set
public void set(Number value, int linearIndex)
Description copied from interface:NDArray
Sets the value of an element specified by linear indexing.Linear indexing: It selects the ith element using the column-major iteration order that linearly spans the entire array. in its particular dimension.
Negative indexing is supported, e.g. -1 refers to the last element, -2 refers to the item before the last one, etc.
-
set
public void set(Number value, int... indices)
Description copied from interface:NDArray
Sets the value of an element specified by cartesian indexing.Cartesian indexing: The ordinary way to index into an N-dimensional array is to use exactly N indices; each index selects the position(s) in its particular dimension.
Negative indexing is supported, e.g. assuming a 3×4 NDArray, index [2,-1] equals to [2,3], and [-1,-3] is an equivalent of [2,1].
-
-