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

Class RepeatedElementVector

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


    public final class RepeatedElementVector
    extends ASizedVector
    An immutable vector that has the same value for elements.
    See Also:
    Serialized Form
    • Method Detail

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

        public boolean isMutable()
        Description copied from class: AVector
        Returns true if this vector is mutable.
        Specified by:
        isMutable in interface INDArray
        Overrides:
        isMutable 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
      • 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
      • 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
      • 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:
      • 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
      • multiplyCopy

        public AVector multiplyCopy(double d)
        Description copied from interface: INDArray
        Returns a copy of the array with all elements multiplied by a single constant value
        Specified by:
        multiplyCopy in interface INDArray
        Overrides:
        multiplyCopy in class AVector
        Parameters:
        d - A scalar factor
        Returns:
        A new array, with all element values scaled by the given factor
      • innerProduct

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

        public AVector select(int... order)
        Description copied from class: AVector
        Selects a subset of indices from a vector
        Overrides:
        select in class AVector
        Returns:
      • absCopy

        public AVector absCopy()
        Description copied from interface: INDArray
        Returns a copy of the array with the abs operator applied to each element
        Specified by:
        absCopy in interface INDArray
        Overrides:
        absCopy in class AVector
        Returns:
        A new array containing the absolute element values
      • addCopy

        public AVector addCopy(AVector v)
        Description copied from interface: IVector
        Adds a vector element-wise to this vector, returning a new vector.
        Specified by:
        addCopy in interface IVector
        Overrides:
        addCopy in class AVector
        Returns:
      • addCopy

        public AVector addCopy(double v)
        Description copied from interface: INDArray
        Creates a new array equal to this array with a constant value added to every element
        Specified by:
        addCopy in interface INDArray
        Overrides:
        addCopy in class AVector
        Returns:
      • addToArray

        public void addToArray(double[] data,
                               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
      • nonZeroCount

        public long nonZeroCount()
        Description copied from interface: INDArray
        Returns the number of non-zero elements in the array.
        Specified by:
        nonZeroCount in interface INDArray
        Overrides:
        nonZeroCount 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
      • 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
      • 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
      • 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
      • getElements

        public void getElements(double[] dest,
                                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
      • 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:
      • elementsEqual

        public boolean elementsEqual(double value)
        Description copied from interface: INDArray
        Returns true if all elements are equal to a specific value
        Specified by:
        elementsEqual in interface INDArray
        Overrides:
        elementsEqual 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
      • elementPowSum

        public double elementPowSum(double p)
        Returns the sum of all the elements raised to a specified power
        Specified by:
        elementPowSum in interface INDArray
        Overrides:
        elementPowSum in class AVector
        Returns:
      • elementAbsPowSum

        public double elementAbsPowSum(double p)
        Returns the sum of the absolute values of all the elements raised to a specified power
        Specified by:
        elementAbsPowSum in interface INDArray
        Overrides:
        elementAbsPowSum in class AVector
        Returns:

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.