public abstract class AbstractVector extends java.lang.Object implements 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, waitaddConstant, addVector, addVector, asArray, divideByConstant, divideByVectorPairwise, divideByVectorPairwise, dotProduct, dotProduct, duplicate, fillRandomly, getValue, isSparse, length, merge, multiplyByConstant, multiplyByVectorPairwise, multiplyByVectorPairwise, normalize, setValue, subtractConstant, subtractVector, subtractVector, toDenseVector, toSparseVectorpublic void squareRoot()
VectorsquareRoot in interface Vectorpublic Vector squareRootToCopy()
VectorsquareRootToCopy in interface Vectorpublic void incrementValueAt(int index,
double amount)
VectorincrementValueAt in interface Vectorindex - The index of the value to be incremented.amount - The amount to add to the value at the given index.public double sum()
Vectorpublic double mean()
Vectorpublic double standardDeviation()
VectorstandardDeviation in interface Vectorpublic java.lang.String toString()
toString in class java.lang.Objectpublic void zeroAllDimensions()
Vector0.zeroAllDimensions in interface Vectorpublic double euclideanNorm()
VectoreuclideanNorm in interface Vectorpublic Vector addVectorToCopy(double[] vectorAsArray)
VectoraddVectorToCopy in interface VectorvectorAsArray - The vector to be added as an array.public Vector subtractVectorFromCopy(double[] vectorAsArray)
VectorsubtractVectorFromCopy in interface VectorvectorAsArray - The vector to be subtracted as an array.public Vector multiplyByVectorPairwiseToCopy(double[] vectorAsArray)
VectormultiplyByVectorPairwiseToCopy in interface VectorvectorAsArray - The vector to be multiplied with.public Vector divideByVectorPairwiseToCopy(double[] vectorAsArray)
VectordivideByVectorPairwiseToCopy in interface VectorvectorAsArray - The operand vector as a double array.public Vector addConstantToCopy(double constant)
VectoraddConstantToCopy in interface Vectorconstant - The constant to be added.public Vector addVectorToCopy(Vector vector)
VectoraddVectorToCopy in interface Vectorvector - The vector to be added to this vector.public Vector subtractConstantFromCopy(double constant)
VectorsubtractConstantFromCopy in interface Vectorconstant - The constant to be subtracted.public Vector subtractVectorFromCopy(Vector vector)
VectorsubtractVectorFromCopy in interface Vectorvector - The vector to subtract from this vector.public Vector multiplyByVectorPairwiseToCopy(Vector vector)
VectormultiplyByVectorPairwiseToCopy in interface Vectorvector - The vector to be multiplied with.public Vector multiplyByConstantToCopy(double constant)
VectormultiplyByConstantToCopy in interface Vectorconstant - The constant to multiply this vector with.public Vector divideByVectorPairwiseToCopy(Vector vector)
VectordivideByVectorPairwiseToCopy in interface Vectorvector - The vector to be divided by.public Vector divideByConstantToCopy(double constant)
VectordivideByConstantToCopy in interface Vectorconstant - The constant to divide this vector by.public java.lang.Double average()
Vectorpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object