ai.libs.jaicore.math.linearalgebra

Class AbstractVector

  • java.lang.Object
    • ai.libs.jaicore.math.linearalgebra.AbstractVector
  • All Implemented Interfaces:
    Vector
    Direct Known Subclasses:
    DenseDoubleVector, SparseDoubleVector


    public abstract class AbstractVectorextends java.lang.Objectimplements Vector
    An abstract vector class, implementing several common methods for different vector implementations. All vector implementations should subclass this class.
    • Constructor Detail

      • AbstractVector

        public AbstractVector()
    • Method Detail

      • squareRoot

        public void squareRoot()
        Description copied from interface: Vector
        Replaces the current values of the vectors with the square roots of the elements.
        Specified by:
        squareRoot in interface Vector
      • squareRootToCopy

        public Vector squareRootToCopy()
        Description copied from interface: Vector
        Takes the square root of each element of the vector and creates a new vector with these elements.
        Specified by:
        squareRootToCopy in interface Vector
        Returns:
        The vector consisting of the square rooted entries of this vector.
      • incrementValueAt

        public void incrementValueAt(int index,                             double amount)
        Description copied from interface: Vector
        Increments the value at the given index by the given amount.
        Specified by:
        incrementValueAt in interface Vector
        Parameters:
        index - The index of the value to be incremented.
        amount - The amount to add to the value at the given index.
      • sum

        public double sum()
        Description copied from interface: Vector
        Returns the sum over the values of the dimensions of this vector.
        Specified by:
        sum in interface Vector
        Returns:
        The sum over the values of the dimensions.
      • mean

        public double mean()
        Description copied from interface: Vector
        Computes the mean of this vector.
        Specified by:
        mean in interface Vector
        Returns:
        The mean of this vector.
      • standardDeviation

        public double standardDeviation()
        Description copied from interface: Vector
        Returns the standard deviation over the values in the vector.
        Specified by:
        standardDeviation in interface Vector
        Returns:
        The standard deviation over the values in the vector.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • zeroAllDimensions

        public void zeroAllDimensions()
        Description copied from interface: Vector
        Sets all dimensions of this vector to 0.
        Specified by:
        zeroAllDimensions in interface Vector
      • euclideanNorm

        public double euclideanNorm()
        Description copied from interface: Vector
        Returns the Euclidean norm (length) of this vector.
        Specified by:
        euclideanNorm in interface Vector
        Returns:
        The Euclidean norm of this vector.
      • addVectorToCopy

        public Vector addVectorToCopy(double[] vectorAsArray)
        Description copied from interface: Vector
        Adds the given double array interpreted as a vector to a copy of this vector and returns the result of the operation.
        Specified by:
        addVectorToCopy in interface Vector
        Parameters:
        vectorAsArray - The vector to be added as an array.
        Returns:
        The result vector of this operation.
      • subtractVectorFromCopy

        public Vector subtractVectorFromCopy(double[] vectorAsArray)
        Description copied from interface: Vector
        Subtracts the given double array interpreted as a vector from a copy of this vector and returns the result of this operation.
        Specified by:
        subtractVectorFromCopy in interface Vector
        Parameters:
        vectorAsArray - The vector to be subtracted as an array.
        Returns:
        The result vector of this operation.
      • multiplyByVectorPairwiseToCopy

        public Vector multiplyByVectorPairwiseToCopy(double[] vectorAsArray)
        Description copied from interface: Vector
        Multiplies a copy of this vector with the given double array interpreted as a pairwise vector and returns the result of the operation.
        Specified by:
        multiplyByVectorPairwiseToCopy in interface Vector
        Parameters:
        vectorAsArray - The vector to be multiplied with.
        Returns:
        The result vector of this operation.
      • divideByVectorPairwiseToCopy

        public Vector divideByVectorPairwiseToCopy(double[] vectorAsArray)
        Description copied from interface: Vector
        Divides a copy of this vector by the given double array interpreted as a pairwise vector and returns the result of this operation.
        Specified by:
        divideByVectorPairwiseToCopy in interface Vector
        Parameters:
        vectorAsArray - The operand vector as a double array.
        Returns:
        The result vector of this operation.
      • addConstantToCopy

        public Vector addConstantToCopy(double constant)
        Description copied from interface: Vector
        Adds the given constant to a copy of this vector and returns the result of this operation.
        Specified by:
        addConstantToCopy in interface Vector
        Parameters:
        constant - The constant to be added.
        Returns:
        The result vector of this operation.
      • addVectorToCopy

        public Vector addVectorToCopy(Vector vector)
        Description copied from interface: Vector
        Adds the given vector to a copy of this vector and returns the result of the operation.
        Specified by:
        addVectorToCopy in interface Vector
        Parameters:
        vector - The vector to be added to this vector.
        Returns:
        The result vector of this operation.
      • subtractConstantFromCopy

        public Vector subtractConstantFromCopy(double constant)
        Description copied from interface: Vector
        Subtracts the given constant from a copy of this vector and returns the result of the operation.
        Specified by:
        subtractConstantFromCopy in interface Vector
        Parameters:
        constant - The constant to be subtracted.
        Returns:
        The result vector of this operation.
      • subtractVectorFromCopy

        public Vector subtractVectorFromCopy(Vector vector)
        Description copied from interface: Vector
        Subtracts the given vector from a copy of this vector and returns the result of this operation.
        Specified by:
        subtractVectorFromCopy in interface Vector
        Parameters:
        vector - The vector to subtract from this vector.
        Returns:
        The result vector of this operation.
      • multiplyByVectorPairwiseToCopy

        public Vector multiplyByVectorPairwiseToCopy(Vector vector)
        Description copied from interface: Vector
        Multiplies a copy of this vector with the given vector pairwisely and returns the result of this operation.
        Specified by:
        multiplyByVectorPairwiseToCopy in interface Vector
        Parameters:
        vector - The vector to be multiplied with.
        Returns:
        The result vector of this operation.
      • multiplyByConstantToCopy

        public Vector multiplyByConstantToCopy(double constant)
        Description copied from interface: Vector
        Multiplies a copy of this vector with the given constant and returns the result of this operation.
        Specified by:
        multiplyByConstantToCopy in interface Vector
        Parameters:
        constant - The constant to multiply this vector with.
        Returns:
        The result vector of this operation.
      • divideByVectorPairwiseToCopy

        public Vector divideByVectorPairwiseToCopy(Vector vector)
        Description copied from interface: Vector
        Divides a copy of this vector by the given pairwise vector and returns the result of this operation.
        Specified by:
        divideByVectorPairwiseToCopy in interface Vector
        Parameters:
        vector - The vector to be divided by.
        Returns:
        The result vector of this operation.
      • divideByConstantToCopy

        public Vector divideByConstantToCopy(double constant)
        Description copied from interface: Vector
        Divides a copy of this vector by the given constant and returns the result of this operation.
        Specified by:
        divideByConstantToCopy in interface Vector
        Parameters:
        constant - The constant to divide this vector by.
        Returns:
        The result vector of this operation.
      • average

        public java.lang.Double average()
        Description copied from interface: Vector
        Returns the average of all values contained in this vector.
        Specified by:
        average in interface Vector
        Returns:
        The average of the single values.
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object


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