public abstract class AbstractVectorextends java.lang.Objectimplements Vector
Constructor and Description |
---|
AbstractVector() |
Modifier and Type | Method and Description |
---|---|
Vector | addConstantToCopy(double constant) Adds the given constant to a copy of this vector and returns the result of this operation. |
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. |
java.lang.Double | average() Returns the average of all values contained in this vector. |
Vector | divideByConstantToCopy(double constant) Divides a copy of this vector by the given constant and returns the result of this operation. |
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. |
boolean | equals(java.lang.Object obj) |
double | euclideanNorm() Returns the Euclidean norm (length) of this vector. |
int | hashCode() |
void | incrementValueAt(int index, double amount) Increments the value at the given index by the given amount. |
double | mean() Computes the mean of this vector. |
Vector | multiplyByConstantToCopy(double constant) Multiplies a copy of this vector with the given constant and returns the result of this operation. |
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 | 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. |
Vector | subtractConstantFromCopy(double constant) Subtracts the given constant from a copy of this vector and returns the result of the operation. |
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. |
java.lang.String | toString() |
void | zeroAllDimensions() Sets all dimensions of this vector to 0 . |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addConstant, addVector, addVector, asArray, divideByConstant, divideByVectorPairwise, divideByVectorPairwise, dotProduct, dotProduct, duplicate, fillRandomly, getValue, isSparse, length, merge, multiplyByConstant, multiplyByVectorPairwise, multiplyByVectorPairwise, normalize, setValue, subtractConstant, subtractVector, subtractVector, toDenseVector, toSparseVector
public void squareRoot()
Vector
squareRoot
in interface Vector
public Vector squareRootToCopy()
Vector
squareRootToCopy
in interface Vector
public void incrementValueAt(int index, double amount)
Vector
incrementValueAt
in interface Vector
index
- The index of the value to be incremented.amount
- The amount to add to the value at the given index.public double sum()
Vector
public double mean()
Vector
public double standardDeviation()
Vector
standardDeviation
in interface Vector
public java.lang.String toString()
toString
in class java.lang.Object
public void zeroAllDimensions()
Vector
0
.zeroAllDimensions
in interface Vector
public double euclideanNorm()
Vector
euclideanNorm
in interface Vector
public Vector addVectorToCopy(double[] vectorAsArray)
Vector
addVectorToCopy
in interface Vector
vectorAsArray
- The vector to be added as an array.public Vector subtractVectorFromCopy(double[] vectorAsArray)
Vector
subtractVectorFromCopy
in interface Vector
vectorAsArray
- The vector to be subtracted as an array.public Vector multiplyByVectorPairwiseToCopy(double[] vectorAsArray)
Vector
multiplyByVectorPairwiseToCopy
in interface Vector
vectorAsArray
- The vector to be multiplied with.public Vector divideByVectorPairwiseToCopy(double[] vectorAsArray)
Vector
divideByVectorPairwiseToCopy
in interface Vector
vectorAsArray
- The operand vector as a double array.public Vector addConstantToCopy(double constant)
Vector
addConstantToCopy
in interface Vector
constant
- The constant to be added.public Vector addVectorToCopy(Vector vector)
Vector
addVectorToCopy
in interface Vector
vector
- The vector to be added to this vector.public Vector subtractConstantFromCopy(double constant)
Vector
subtractConstantFromCopy
in interface Vector
constant
- The constant to be subtracted.public Vector subtractVectorFromCopy(Vector vector)
Vector
subtractVectorFromCopy
in interface Vector
vector
- The vector to subtract from this vector.public Vector multiplyByVectorPairwiseToCopy(Vector vector)
Vector
multiplyByVectorPairwiseToCopy
in interface Vector
vector
- The vector to be multiplied with.public Vector multiplyByConstantToCopy(double constant)
Vector
multiplyByConstantToCopy
in interface Vector
constant
- The constant to multiply this vector with.public Vector divideByVectorPairwiseToCopy(Vector vector)
Vector
divideByVectorPairwiseToCopy
in interface Vector
vector
- The vector to be divided by.public Vector divideByConstantToCopy(double constant)
Vector
divideByConstantToCopy
in interface Vector
constant
- The constant to divide this vector by.public java.lang.Double average()
Vector
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object