Class RealNDArraySliceView<T extends Number>

  • All Implemented Interfaces:
    RealNDArray<T>, NDArray<T>, Iterable<T>

    public class RealNDArraySliceView<T extends Number>
    extends AbstractNDArraySliceView<T,​T>
    implements RealNDArray<T>
    A view for an NDArray holding real values that slices the parent NDArray. When slice(...) is called for a real NDArray, an instance of this class is returned.
    • Constructor Detail

    • 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!

        Specified by:
        copyFrom in interface NDArray<T extends Number>
        Parameters:
        array - NDArray from which values are copied to this NDArray
        Returns:
        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.

        Specified by:
        set in interface NDArray<T extends Number>
        Overrides:
        set in class AbstractNDArray<T extends Number,​T extends Number>
        Parameters:
        value - value to be assigned
        linearIndex - linear coordinates
      • 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].

        Specified by:
        set in interface NDArray<T extends Number>
        Overrides:
        set in class AbstractNDArray<T extends Number,​T extends Number>
        Parameters:
        value - value to be assigned
        indices - cartesian coordinates