Documentation of 'mikera.vectorz.Vector1' Java class
Vector1
mikera.vectorz

Class Vector1

    • Field Detail

      • x

        public double x
    • Constructor Detail

      • Vector1

        public Vector1()
      • Vector1

        public Vector1(double x)
      • Vector1

        public Vector1(double... values)
    • Method Detail

      • of

        public static Vector1 of(double x)
      • of

        public static Vector1 of(double... values)
      • dotProduct

        public double dotProduct(AVector a)
        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
      • length

        public int length()
        Description copied from interface: IVector
        Returns the length of a vector, in terms of the number of elements. For Euclidean length, use magnitude() instead
        Specified by:
        length in interface IVector
        Specified by:
        length 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • fill

        public void fill(double v)
        Description copied from class: AVector
        Fills the entire vector with a given value
        Specified by:
        fill in interface INDArray
        Overrides:
        fill in class AVector
      • getElements

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

        public void add(AVector v)
        Description copied from class: AVector
        Adds another vector to this one
        Overrides:
        add in class AVector
      • addAt

        public void addAt(int i,
                          double value)
        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
      • setValues

        public void setValues(double x)
      • negate

        public void negate()
        Description copied from class: AVector
        Negates all emlements of this vector in place.
        Specified by:
        negate in interface INDArray
        Overrides:
        negate 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
      • 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
      • clone

        public Vector1 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
        Specified by:
        clone in class APrimitiveVector
      • toDoubleArray

        public double[] toDoubleArray()
        Description copied from interface: INDArray
        Copies the elements of this array to a new double[] array.
        Specified by:
        toDoubleArray in interface INDArray
        Overrides:
        toDoubleArray 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:
      • equals

        public boolean equals(Vector1 v)
      • 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 AVector
        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.