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

Class ASparseIndexedVector

    • Constructor Detail

      • ASparseIndexedVector

        public ASparseIndexedVector(int length)
    • Method Detail

      • includesIndex

        public boolean includesIndex(int i)
        Description copied from class: ASparseVector
        Returns true iff the sparse vector contains the index i
        Specified by:
        includesIndex in class ASparseVector
        Returns:
      • 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 ASparseVector
      • 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:
      • 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
      • 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
      • innerProduct

        public AVector innerProduct(AMatrix a)
        Description copied from class: AVector
        Computes the inner product of this vector with a matrix
        Overrides:
        innerProduct in class ASparseVector
        Returns:
        a vector representing the inner product
      • dotProduct

        public final double dotProduct(AVector v)
        Description copied from class: AVector
        Returns the dot product of this vector with another vector The vectors must have the same length: if not the result is undefined
        Specified by:
        dotProduct in class ASparseVector
        Returns:
      • dotProduct

        public final double dotProduct(ASparseVector v)
        Multiply this sparse indexed vector with another sparse vector.
        Parameters:
        v -
        Returns:
      • nonZeroIndices

        public int[] nonZeroIndices()
        Description copied from class: AVector
        Return an int array specifying the positions in this vector which are non-zero
        Overrides:
        nonZeroIndices in class AVector
        Returns:
      • 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
      • addToArray

        public void addToArray(double[] dest,
                               int offset)
        Description copied from class: AVector
        Adds this vector to a double[] array, starting at the specified offset.
        Specified by:
        addToArray in interface INDArray
        Overrides:
        addToArray in class AVector
      • addToArray

        public void addToArray(double[] dest,
                               int offset,
                               int stride)
        Description copied from class: AVector
        Adds this vector to a double[] array, using the specified offset and stride into the destination array
        Overrides:
        addToArray in class AVector
      • addMultipleToArray

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

        public void addProductToArray(double factor,
                                      int offset,
                                      AVector other,
                                      int otherOffset,
                                      double[] array,
                                      int arrayOffset,
                                      int length)
        Overrides:
        addProductToArray in class AVector
      • addProductToArray

        public void addProductToArray(double factor,
                                      int offset,
                                      ADenseArrayVector other,
                                      int otherOffset,
                                      double[] array,
                                      int arrayOffset,
                                      int length)
        Description copied from class: AVector
        Adds the scaled elementwise product of this vector and another vector to the destimation array
        Overrides:
        addProductToArray in class AVector
      • equalsArray

        public boolean equalsArray(double[] ds,
                                   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:
        ds - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • 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 ASparseVector
        Returns:
      • cloneIncludingIndices

        public final SparseIndexedVector cloneIncludingIndices(int[] ixs)
        Create a clone of this sparse indexed vector including the new indexes specified Intended to allow fast subsequent modification
      • getElements

        public final void getElements(double[] array,
                                      int offset)
        Description copied from interface: INDArray
        Copies all elements of this array a double array at the specified offset
        Specified by:
        getElements in interface INDArray
        Overrides:
        getElements in class AVector
      • copyTo

        public final void copyTo(AVector v,
                                 int offset)
        Description copied from class: AVector
        Copies a the contents of a vector to a vector at the specified offset
        Overrides:
        copyTo in class AVector

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.