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

Class AStridedVector

    • Method Detail

      • getArray

        public final double[] getArray()
        Gets the underlying double[] data array for this vector
        Specified by:
        getArray in interface IStridedArray
        Returns:
      • getArrayOffset

        public abstract int getArrayOffset()
        Gets the offset into the underlying double[] data array for the first element of this vector
        Specified by:
        getArrayOffset in interface IStridedArray
        Returns:
      • getStride

        public abstract int getStride()
        Gets the stride of this strided vector.
        Returns:
      • 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:
      • 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(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
        Overrides:
        dotProduct in class AVector
        Returns:
      • 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
      • elementMax

        public double elementMax()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMax in interface INDArray
        Overrides:
        elementMax in class AVector
      • elementMin

        public double elementMin()
        Description copied from interface: INDArray
        Returns the maximum element value in this array. Throws an error if there are no elements.
        Specified by:
        elementMin in interface INDArray
        Overrides:
        elementMin in class AVector
      • broadcast

        public INDArray broadcast(int... shape)
        Description copied from interface: INDArray
        Returns a view of this array broadcasted up to a larger shape
        Specified by:
        broadcast in interface INDArray
        Overrides:
        broadcast in class AVector
      • selectView

        public AVector selectView(int... inds)
        Description copied from class: AVector
        Selects a subset of indices from a vector, returning a view
        Overrides:
        selectView in class AArrayVector
        Returns:
        a view of the selected indices
      • clone

        public Vector clone()
        Description copied from class: AVector
        Clones the vector, creating a new mutable copy of all data. The clone is: - not guaranteed to be of the same type. - guaranteed to be fully mutable - guaranteed not to contain a reference (i.e. is a full deep copy)
        Specified by:
        clone in interface INDArray
        Specified by:
        clone in interface IVector
        Overrides:
        clone in class AVector
      • set

        public abstract void set(AVector v)
        Description copied from class: AVector
        Sets the vector to equal the value of another vector
        Overrides:
        set in class AVector
      • setElements

        public abstract void setElements(double[] values,
                                         int offset)
        Description copied from interface: INDArray
        Sets all elements in an array using the given double values
        Specified by:
        setElements in interface INDArray
        Overrides:
        setElements in class AVector
        Parameters:
        values - Element values in a double[] array. There must be at least as many element values as elements in this array.
        offset - Position in the values array from which to start taking values.
      • setElements

        public abstract void setElements(int pos,
                                         double[] values,
                                         int offset,
                                         int length)
        Description copied from interface: INDArray
        Sets elements in an array using the given double values. The source array must contain at least the specified length in terms of number of elements
        Specified by:
        setElements in interface INDArray
        Overrides:
        setElements in class AVector
        Parameters:
        pos - Offset into this array, expressed in terms of number of elements in row major order
        values - Element values in a double[] array. There must be at least as many element values as elements in this array.
        offset - Position in the values array from which to start taking values.
        length - Number of elements to set.
      • add

        public void add(int offset,
                        AVector a,
                        int aOffset,
                        int length)
        Description copied from class: AVector
        Adds a segment of another vector into this one, at the specified offset
        Overrides:
        add in class AVector
      • addAt

        public abstract 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
      • addToArray

        public void addToArray(int offset,
                               double[] destData,
                               int destOffset,
                               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
      • addMultipleToArray

        public void addMultipleToArray(double factor,
                                       int offset,
                                       double[] destData,
                                       int destOffset,
                                       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
      • addToArray

        public void addToArray(double[] dest,
                               int destOffset,
                               int destStride)
        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
      • applyOp

        public abstract 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
      • applyOpCopy

        public final Vector applyOpCopy(Op op)
        Description copied from interface: INDArray
        Applies a unary operator to all elements of the array (creating a new array)
        Specified by:
        applyOpCopy in interface INDArray
        Overrides:
        applyOpCopy in class AVector
      • reduce

        public double reduce(Op2 op,
                             double init)
        Description copied from interface: INDArray
        Reduces over all elements of the array in row-major order. Applies the operator to the initial/previous result at each step. Returns the final result.
        Specified by:
        reduce in interface INDArray
        Overrides:
        reduce in class AVector
      • reduce

        public double reduce(Op2 op)
        Description copied from interface: INDArray
        Reduces over all elements of the array in row-major order. Applies the operator to the previous result at each step. Returns the final result.
        Specified by:
        reduce in interface INDArray
        Overrides:
        reduce 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
      • hasUncountable

        public boolean hasUncountable()
        Description copied from class: AbstractArray
        Returns true if any element is this array is NaN or infinite
        Specified by:
        hasUncountable in interface INDArray
        Overrides:
        hasUncountable in class AVector
        Returns:
        True if any element is this array is NaN or infinite, false otherwise
      • asDoubleArray

        public double[] asDoubleArray()
        Description copied from interface: INDArray
        Returns the underlying double array representing the densely packed elements of this array. Modifications to this double array will change the original array. Returns null if there is no such array.
        Specified by:
        asDoubleArray in interface INDArray
        Overrides:
        asDoubleArray in class AVector
      • isPackedArray

        public boolean isPackedArray()
        Description copied from interface: IStridedArray
        Checks if this array is fully packed in row major order.
        Specified by:
        isPackedArray in interface IStridedArray
        Returns:
      • getStrides

        public int[] getStrides()
        Description copied from interface: IStridedArray
        Gets the strides for each dimension of this strided array. The returned array should not be modified
        Specified by:
        getStrides in interface IStridedArray
        Returns:
      • 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
      • getStride

        public int getStride(int dimension)
        Description copied from interface: IStridedArray
        Gets the stide for a specific dimension in this strided array.
        Specified by:
        getStride in interface IStridedArray
        Returns:
      • getElements

        public void getElements(double[] dest,
                                int destOffset)
        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
      • getElements

        public void getElements(double[] dest,
                                int destOffset,
                                int[] indices)
        Description copied from class: AVector
        Gets the elements in this vector from the specified indices, storing at the specified offset in the destination array
        Overrides:
        getElements 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[] vs,
                                   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:
        vs - Array of double element values to check for equality
        offset - Offset into the data array
        Returns:
      • visitNonZero

        public double visitNonZero(IndexedElementVisitor elementVisitor)
        Description copied from class: AVector
        Visits all non-zero elements of this vector. Visitor may return a non-zero value to terminate early, which will return the given value. Returns 0.0 otherwise.
        Overrides:
        visitNonZero in class ASizedVector
      • validate

        public void validate()
        Description copied from interface: INDArray
        Validates the internal data structure of the INDArray. Throws an exception on failure. Failure indicates a serious bug and/or data corruption.
        Specified by:
        validate in interface INDArray
        Overrides:
        validate in class AVector

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.