Documentation of 'mikera.vectorz.impl.WrappedSubVector' Java class
WrappedSubVector
mikera.vectorz.impl

Class WrappedSubVector

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<java.lang.Double>, INDArray, IVector


    public final class WrappedSubVector
    extends ASizedVector
    View class referencing a contiguous subvector of another vector.
    See Also:
    Serialized Form
    • Method Detail

      • iterator

        public java.util.Iterator<java.lang.Double> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Double>
        Overrides:
        iterator in class AVector
      • isFullyMutable

        public boolean isFullyMutable()
        Description copied from class: AVector
        Returns true if this vector is fully mutable, i.e. can contain any unconstrained double values
        Specified by:
        isFullyMutable in interface INDArray
        Overrides:
        isFullyMutable in class AVector
      • isView

        public boolean isView()
        Description copied from class: AVector
        Returns true if this vector is of a view type that references other vectors / data.
        Specified by:
        isView in interface INDArray
        Overrides:
        isView in class AVector
      • isZero

        public boolean isZero()
        Description copied from class: AVector
        Returns true if this vector is a zero vector (all components zero)
        Specified by:
        isZero in interface INDArray
        Overrides:
        isZero in class AVector
      • isRangeZero

        public boolean isRangeZero(int start,
                                   int length)
        Description copied from class: AVector
        Returns true if a sub-vector range is completely zero. Unsafe operation - does not perform bounds checking, results are undefined if sub-vector is out of range
        Overrides:
        isRangeZero in class AVector
        Returns:
      • get

        public double get(int i)
        Description copied from interface: INDArray
        Returns the double value at the specified position in a 1D vector
        Specified by:
        get in interface INDArray
        Specified by:
        get in interface IVector
        Specified by:
        get in class AVector
      • set

        public void set(int i,
                        double value)
        Description copied from interface: INDArray
        Sets a value at a given position in a mutable 1D array
        Specified by:
        set in interface INDArray
        Specified by:
        set in interface IVector
        Specified by:
        set in class AVector
      • unsafeGet

        public double unsafeGet(int i)
        Description copied from class: AVector
        Like get, but performs no bounds checking. Results are undefined if the index is out of range
        Overrides:
        unsafeGet in class AVector
      • unsafeSet

        public void unsafeSet(int i,
                              double value)
        Description copied from class: AVector
        Like set, but performs no bounds checking. Results are undefined if the index is out of range
        Overrides:
        unsafeSet in class AVector
      • applyOp

        public void applyOp(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (in-place)
        Specified by:
        applyOp in interface INDArray
        Overrides:
        applyOp in class AVector
      • add

        public void add(AVector src,
                        int offset)
        Description copied from class: AVector
        Adds part another vector to this one, starting at the specified offset in the source vector
        Overrides:
        add in class AVector
      • addToArray

        public void addToArray(int offset,
                               double[] array,
                               int arrayOffset,
                               int length)
        Description copied from class: AVector
        Adds a subvector of this vector into a double array at the specified offset
        Overrides:
        addToArray in class AVector
      • subVector

        public AVector subVector(int offset,
                                 int length)
        Description copied from class: AVector
        Obtains a sub-vector view that refers to this vector. Changes to the sub-vector will be reflected in this vector
        Overrides:
        subVector in class AVector
      • copyTo

        public void copyTo(int offset,
                           AVector dest,
                           int destOffset,
                           int length)
        Description copied from class: AVector
        Copies a subset of this vector to a vector at the specified offset
        Overrides:
        copyTo in class AVector
      • copyTo

        public void copyTo(int offset,
                           double[] dest,
                           int destOffset,
                           int length)
        Description copied from class: AVector
        Copies a subset of this vector to a specified destination array offset
        Overrides:
        copyTo in class AVector
      • copyTo

        public void copyTo(int offset,
                           double[] dest,
                           int destOffset,
                           int length,
                           int stride)
        Description copied from class: AVector
        Copies a subset of this vector to a specified destination array offset using the given stride. Unsafe operation: performs no bounds checking
        Overrides:
        copyTo in class AVector
      • tryEfficientJoin

        public AVector tryEfficientJoin(AVector a)
        Description copied from class: AVector
        Attempts to perform an efficient join with a second vector. An efficient join is guaranteed to be better than a simple JoinedVector(left,right) If possible, returns the joined vector. If not, returns null
        Overrides:
        tryEfficientJoin in class AVector
      • addAt

        public void addAt(int i,
                          double v)
        Description copied from class: AVector
        Adds a value to a specific element of the vector This function does not perform bounds checking, i.e. is an unsafe operation
        Overrides:
        addAt in class AVector
      • dotProduct

        public double dotProduct(double[] data,
                                 int offset)
        Description copied from class: AVector
        Fast dot product with a double[] array. Performs no bounds checking. Likely to be faster than most other dot product operations
        Specified by:
        dotProduct in class AVector
      • dotProduct

        public double dotProduct(double[] data,
                                 int offset,
                                 int stride)
        Description copied from class: AVector
        Fast dot product with a double[] array and a stride. Performs no bounds checking. Likely to be faster than other dot product operations
        Overrides:
        dotProduct in class AVector
      • multiply

        public void multiply(double factor)
        Description copied from class: AVector
        Multiplies the vector by a constant factor
        Specified by:
        multiply in interface INDArray
        Overrides:
        multiply in class AVector
        Parameters:
        factor - Factor by which to multiply each component of the vector
      • elementSum

        public double elementSum()
        Description copied from class: AVector
        Returns the sum of all elements in a vector
        Specified by:
        elementSum in interface INDArray
        Overrides:
        elementSum in class AVector
      • equals

        public boolean equals(AVector v)
        Description copied from class: AbstractArray
        Returns true if this array is exactly equal to a vector.
        Overrides:
        equals in class AVector
        Returns:
      • equalsArray

        public boolean equalsArray(double[] data,
                                   int offset)
        Description copied from class: AVector
        Returns true if this vector exactly matches the elements in double[] array, starting from the specified offset
        Specified by:
        equalsArray in interface INDArray
        Overrides:
        equalsArray in class ASizedVector
        Parameters:
        data - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.