ai.libs.jaicore.math.linearalgebra

Interface Vector

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and TypeMethod and Description
      voidaddConstant(double constant)
      Adds the given constant to this vector.
      VectoraddConstantToCopy(double constant)
      Adds the given constant to a copy of this vector and returns the result of this operation.
      voidaddVector(double[] vectorAsArray)
      Adds the given double array interpreted as a vector to this vector.
      voidaddVector(Vector vector)
      Adds the given vector to this vector.
      VectoraddVectorToCopy(double[] vectorAsArray)
      Adds the given double array interpreted as a vector to a copy of this vector and returns the result of the operation.
      VectoraddVectorToCopy(Vector vector)
      Adds the given vector to a copy of this vector and returns the result of the operation.
      double[]asArray()
      Returns this vector as a double array.
      java.lang.Doubleaverage()
      Returns the average of all values contained in this vector.
      voiddivideByConstant(double constant)
      Divides this vector by the given constant.
      VectordivideByConstantToCopy(double constant)
      Divides a copy of this vector by the given constant and returns the result of this operation.
      voiddivideByVectorPairwise(double[] vectorAsArray)
      Divides this vector by the given double array interpreted as a pairwise vector and stores the result in this vector.
      voiddivideByVectorPairwise(Vector vector)
      Divides this vector by the given pairwise vector and stores the result in this vector.
      VectordivideByVectorPairwiseToCopy(double[] vectorAsArray)
      Divides a copy of this vector by the given double array interpreted as a pairwise vector and returns the result of this operation.
      VectordivideByVectorPairwiseToCopy(Vector vector)
      Divides a copy of this vector by the given pairwise vector and returns the result of this operation.
      doubledotProduct(double[] vectorAsArray)
      Computes the dot product of the given vector and this vector.
      doubledotProduct(Vector vector)
      Computes the dot product of the given vector and this vector.
      Vectorduplicate()
      Creates a deep copy of this vector.
      doubleeuclideanNorm()
      Returns the Euclidean norm (length) of this vector.
      voidfillRandomly()
      Fills this vector with random values from the unit interval.
      doublegetValue(int index)
      Returns the value at the given index of this vector.
      voidincrementValueAt(int index, double amount)
      Increments the value at the given index by the given amount.
      booleanisSparse()
      Checks if this vector is sparse.
      intlength()
      Returns the number of dimensions of this vector.
      doublemean()
      Computes the mean of this vector.
      static Vectormerge(Vector v1, Vector v2) 
      voidmultiplyByConstant(double constant)
      Multiplies this vector with the given constant.
      VectormultiplyByConstantToCopy(double constant)
      Multiplies a copy of this vector with the given constant and returns the result of this operation.
      voidmultiplyByVectorPairwise(double[] vectorAsArray)
      Multiplies this vector with the given double array interpreted as a pairwise vector and stores the result in this vector.
      voidmultiplyByVectorPairwise(Vector vector)
      Multiplies this vector with the given vector pairwisely and stores the result in this vector.
      VectormultiplyByVectorPairwiseToCopy(double[] vectorAsArray)
      Multiplies a copy of this vector with the given double array interpreted as a pairwise vector and returns the result of the operation.
      VectormultiplyByVectorPairwiseToCopy(Vector vector)
      Multiplies a copy of this vector with the given vector pairwisely and returns the result of this operation.
      voidnormalize()
      Normalizes this vector to the unit interval.
      voidsetValue(int index, double value)
      Sets the value at the given index of this vector to the given value.
      voidsquareRoot()
      Replaces the current values of the vectors with the square roots of the elements.
      VectorsquareRootToCopy()
      Takes the square root of each element of the vector and creates a new vector with these elements.
      doublestandardDeviation()
      Returns the standard deviation over the values in the vector.
      voidsubtractConstant(double constant)
      Subtracts the given constant from this vector.
      VectorsubtractConstantFromCopy(double constant)
      Subtracts the given constant from a copy of this vector and returns the result of the operation.
      voidsubtractVector(double[] vectorAsArray)
      Subtracts the given double array interpreted as a vector from this vector.
      voidsubtractVector(Vector vector)
      Subtracts the given vector from this vector.
      VectorsubtractVectorFromCopy(double[] vectorAsArray)
      Subtracts the given double array interpreted as a vector from a copy of this vector and returns the result of this operation.
      VectorsubtractVectorFromCopy(Vector vector)
      Subtracts the given vector from a copy of this vector and returns the result of this operation.
      doublesum()
      Returns the sum over the values of the dimensions of this vector.
      DenseDoubleVectortoDenseVector()
      Returns this vector as DenseDoubleVector.
      SparseDoubleVectortoSparseVector()
      Returns this vector as SparseDoubleVector.
      voidzeroAllDimensions()
      Sets all dimensions of this vector to 0.
    • Method Detail

      • addVector

        void addVector(double[] vectorAsArray)
        Adds the given double array interpreted as a vector to this vector.
        Parameters:
        vectorAsArray - The vector to be added as array.
      • addVectorToCopy

        Vector addVectorToCopy(double[] vectorAsArray)
        Adds the given double array interpreted as a vector to a copy of this vector and returns the result of the operation.
        Parameters:
        vectorAsArray - The vector to be added as an array.
        Returns:
        The result vector of this operation.
      • subtractVector

        void subtractVector(double[] vectorAsArray)
        Subtracts the given double array interpreted as a vector from this vector.
        Parameters:
        vectorAsArray - The vector to be subtracted as an array.
      • subtractVectorFromCopy

        Vector subtractVectorFromCopy(double[] vectorAsArray)
        Subtracts the given double array interpreted as a vector from a copy of this vector and returns the result of this operation.
        Parameters:
        vectorAsArray - The vector to be subtracted as an array.
        Returns:
        The result vector of this operation.
      • multiplyByVectorPairwise

        void multiplyByVectorPairwise(double[] vectorAsArray)
        Multiplies this vector with the given double array interpreted as a pairwise vector and stores the result in this vector.
        Parameters:
        vectorAsArray - The vector to be multiplied with.
      • multiplyByVectorPairwiseToCopy

        Vector multiplyByVectorPairwiseToCopy(double[] vectorAsArray)
        Multiplies a copy of this vector with the given double array interpreted as a pairwise vector and returns the result of the operation.
        Parameters:
        vectorAsArray - The vector to be multiplied with.
        Returns:
        The result vector of this operation.
      • divideByVectorPairwise

        void divideByVectorPairwise(double[] vectorAsArray)
        Divides this vector by the given double array interpreted as a pairwise vector and stores the result in this vector.
        Parameters:
        vectorAsArray - The vector to be divided by.
      • divideByVectorPairwiseToCopy

        Vector divideByVectorPairwiseToCopy(double[] vectorAsArray)
        Divides a copy of this vector by the given double array interpreted as a pairwise vector and returns the result of this operation.
        Parameters:
        vectorAsArray - The operand vector as a double array.
        Returns:
        The result vector of this operation.
      • dotProduct

        double dotProduct(double[] vectorAsArray)
        Computes the dot product of the given vector and this vector.
        Parameters:
        vectorAsArray - The vector to compute dot product with.
        Returns:
        The dot product of the given and this vector.
      • length

        int length()
        Returns the number of dimensions of this vector.
        Returns:
        The number of dimensions of this vector.
      • getValue

        double getValue(int index)
        Returns the value at the given index of this vector.
        Parameters:
        index - The index of the value to look for.
        Returns:
        The value at the given index.
      • setValue

        void setValue(int index,              double value)
        Sets the value at the given index of this vector to the given value.
        Parameters:
        index - The index to set the value at.
        value - The value to be set at the specified index.
      • addConstant

        void addConstant(double constant)
        Adds the given constant to this vector.
        Parameters:
        constant - The constant to be added.
      • addConstantToCopy

        Vector addConstantToCopy(double constant)
        Adds the given constant to a copy of this vector and returns the result of this operation.
        Parameters:
        constant - The constant to be added.
        Returns:
        The result vector of this operation.
      • addVector

        void addVector(Vector vector)
        Adds the given vector to this vector. The result is stored in this vector.
        Parameters:
        vector - The vector to be added to this vector.
      • addVectorToCopy

        Vector addVectorToCopy(Vector vector)
        Adds the given vector to a copy of this vector and returns the result of the operation.
        Parameters:
        vector - The vector to be added to this vector.
        Returns:
        The result vector of this operation.
      • subtractConstant

        void subtractConstant(double constant)
        Subtracts the given constant from this vector.
        Parameters:
        constant - The constant to be subtracted.
      • subtractConstantFromCopy

        Vector subtractConstantFromCopy(double constant)
        Subtracts the given constant from a copy of this vector and returns the result of the operation.
        Parameters:
        constant - The constant to be subtracted.
        Returns:
        The result vector of this operation.
      • subtractVector

        void subtractVector(Vector vector)
        Subtracts the given vector from this vector. The result is stored in this vector.
        Parameters:
        vector - The vector to subtract from this vector.
      • subtractVectorFromCopy

        Vector subtractVectorFromCopy(Vector vector)
        Subtracts the given vector from a copy of this vector and returns the result of this operation.
        Parameters:
        vector - The vector to subtract from this vector.
        Returns:
        The result vector of this operation.
      • multiplyByVectorPairwise

        void multiplyByVectorPairwise(Vector vector)
        Multiplies this vector with the given vector pairwisely and stores the result in this vector.
        Parameters:
        vector - The vector to be multiplied with.
      • multiplyByVectorPairwiseToCopy

        Vector multiplyByVectorPairwiseToCopy(Vector vector)
        Multiplies a copy of this vector with the given vector pairwisely and returns the result of this operation.
        Parameters:
        vector - The vector to be multiplied with.
        Returns:
        The result vector of this operation.
      • multiplyByConstant

        void multiplyByConstant(double constant)
        Multiplies this vector with the given constant.
        Parameters:
        constant - The constant to multiply this vector with.
      • multiplyByConstantToCopy

        Vector multiplyByConstantToCopy(double constant)
        Multiplies a copy of this vector with the given constant and returns the result of this operation.
        Parameters:
        constant - The constant to multiply this vector with.
        Returns:
        The result vector of this operation.
      • divideByVectorPairwise

        void divideByVectorPairwise(Vector vector)
        Divides this vector by the given pairwise vector and stores the result in this vector.
        Parameters:
        vector - The vector to be divided by.
      • divideByVectorPairwiseToCopy

        Vector divideByVectorPairwiseToCopy(Vector vector)
        Divides a copy of this vector by the given pairwise vector and returns the result of this operation.
        Parameters:
        vector - The vector to be divided by.
        Returns:
        The result vector of this operation.
      • divideByConstant

        void divideByConstant(double constant)
        Divides this vector by the given constant.
        Parameters:
        constant - The constant to divide this vector by.
      • divideByConstantToCopy

        Vector divideByConstantToCopy(double constant)
        Divides a copy of this vector by the given constant and returns the result of this operation.
        Parameters:
        constant - The constant to divide this vector by.
        Returns:
        The result vector of this operation.
      • dotProduct

        double dotProduct(Vector vector)
        Computes the dot product of the given vector and this vector.
        Parameters:
        vector - The vector to compute dot product with.
        Returns:
        The dot product of the given and this vector.
      • squareRoot

        void squareRoot()
        Replaces the current values of the vectors with the square roots of the elements.
      • squareRootToCopy

        Vector squareRootToCopy()
        Takes the square root of each element of the vector and creates a new vector with these elements.
        Returns:
        The vector consisting of the square rooted entries of this vector.
      • isSparse

        boolean isSparse()
        Checks if this vector is sparse.
        Returns:
        true, if this vector is sparse, false if not.
      • asArray

        double[] asArray()
        Returns this vector as a double array.
        Returns:
        The current vector as a double array.
      • duplicate

        Vector duplicate()
        Creates a deep copy of this vector.
        Returns:
        A deep copy of this vector.
      • normalize

        void normalize()
        Normalizes this vector to the unit interval.
      • incrementValueAt

        void incrementValueAt(int index,                      double amount)
        Increments the value at the given index by the given amount.
        Parameters:
        index - The index of the value to be incremented.
        amount - The amount to add to the value at the given index.
      • sum

        double sum()
        Returns the sum over the values of the dimensions of this vector.
        Returns:
        The sum over the values of the dimensions.
      • mean

        double mean()
        Computes the mean of this vector.
        Returns:
        The mean of this vector.
      • standardDeviation

        double standardDeviation()
        Returns the standard deviation over the values in the vector.
        Returns:
        The standard deviation over the values in the vector.
      • zeroAllDimensions

        void zeroAllDimensions()
        Sets all dimensions of this vector to 0.
      • fillRandomly

        void fillRandomly()
        Fills this vector with random values from the unit interval.
      • euclideanNorm

        double euclideanNorm()
        Returns the Euclidean norm (length) of this vector.
        Returns:
        The Euclidean norm of this vector.
      • average

        java.lang.Double average()
        Returns the average of all values contained in this vector.
        Returns:
        The average of the single values.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14