 ai.libs.jaicore.math.linearalgebra

## Interface Vector

• ### Method Summary

All Methods
Modifier and TypeMethod and Description
`void``addConstant(double constant)`
Adds the given constant to this vector.
`Vector``addConstantToCopy(double constant)`
Adds the given constant to a copy of this vector and returns the result of this operation.
`void``addVector(double[] vectorAsArray)`
Adds the given double array interpreted as a vector to this vector.
`void``addVector(Vector vector)`
Adds the given vector to this vector.
`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.
`Vector``addVectorToCopy(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.Double``average()`
Returns the average of all values contained in this vector.
`void``divideByConstant(double constant)`
Divides this vector by the given constant.
`Vector``divideByConstantToCopy(double constant)`
Divides a copy of this vector by the given constant and returns the result of this operation.
`void``divideByVectorPairwise(double[] vectorAsArray)`
Divides this vector by the given double array interpreted as a pairwise vector and stores the result in this vector.
`void``divideByVectorPairwise(Vector vector)`
Divides this vector by the given pairwise vector and stores the result in this vector.
`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.
`Vector``divideByVectorPairwiseToCopy(Vector vector)`
Divides a copy of this vector by the given pairwise vector and returns the result of this operation.
`double``dotProduct(double[] vectorAsArray)`
Computes the dot product of the given vector and this vector.
`double``dotProduct(Vector vector)`
Computes the dot product of the given vector and this vector.
`Vector``duplicate()`
Creates a deep copy of this vector.
`double``euclideanNorm()`
Returns the Euclidean norm (length) of this vector.
`void``fillRandomly()`
Fills this vector with random values from the unit interval.
`double``getValue(int index)`
Returns the value at the given index of this vector.
`void``incrementValueAt(int index, double amount)`
Increments the value at the given index by the given amount.
`boolean``isSparse()`
Checks if this vector is sparse.
`int``length()`
Returns the number of dimensions of this vector.
`double``mean()`
Computes the mean of this vector.
`static Vector``merge(Vector v1, Vector v2)`
`void``multiplyByConstant(double constant)`
Multiplies this vector with the given constant.
`Vector``multiplyByConstantToCopy(double constant)`
Multiplies a copy of this vector with the given constant and returns the result of this operation.
`void``multiplyByVectorPairwise(double[] vectorAsArray)`
Multiplies this vector with the given double array interpreted as a pairwise vector and stores the result in this vector.
`void``multiplyByVectorPairwise(Vector vector)`
Multiplies this vector with the given vector pairwisely and stores the result in this vector.
`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.
`Vector``multiplyByVectorPairwiseToCopy(Vector vector)`
Multiplies a copy of this vector with the given vector pairwisely and returns the result of this operation.
`void``normalize()`
Normalizes this vector to the unit interval.
`void``setValue(int index, double value)`
Sets the value at the given index of this vector to the given value.
`void``squareRoot()`
Replaces the current values of the vectors with the square roots of the elements.
`Vector``squareRootToCopy()`
Takes the square root of each element of the vector and creates a new vector with these elements.
`double``standardDeviation()`
Returns the standard deviation over the values in the vector.
`void``subtractConstant(double constant)`
Subtracts the given constant from this vector.
`Vector``subtractConstantFromCopy(double constant)`
Subtracts the given constant from a copy of this vector and returns the result of the operation.
`void``subtractVector(double[] vectorAsArray)`
Subtracts the given double array interpreted as a vector from this vector.
`void``subtractVector(Vector vector)`
Subtracts the given vector from this vector.
`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.
`Vector``subtractVectorFromCopy(Vector vector)`
Subtracts the given vector from a copy of this vector and returns the result of this operation.
`double``sum()`
Returns the sum over the values of the dimensions of this vector.
`DenseDoubleVector``toDenseVector()`
Returns this vector as `DenseDoubleVector`.
`SparseDoubleVector``toSparseVector()`
Returns this vector as `SparseDoubleVector`.
`void``zeroAllDimensions()`
Sets all dimensions of this vector to `0`.
• ### Method Detail

`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.

`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.

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

`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.

`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.

`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.
• #### toDenseVector

`DenseDoubleVector toDenseVector()`
Returns this vector as `DenseDoubleVector`.
Returns:
The current vector as a dense vector.
• #### toSparseVector

`SparseDoubleVector toSparseVector()`
Returns this vector as `SparseDoubleVector`.
Returns:
The current vector as a sparse vector.
• #### 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.
• #### merge

`static Vector merge(Vector v1,                    Vector v2)`

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