public interface Vector extends Normalizable
| Modifier and Type | Method and Description |
|---|---|
void |
add(float coeff,
float vectorCoeff,
Vector vector)
Add a
vector multiplied by vectorCoeff to this
vector multiplied by |
void |
add(float coeff,
Vector vector)
Add a
vector multiplied by coeff to this vector |
void |
add(Vector vector)
Add a
vector to this vector |
Vector |
copyVector()
Returns a copy of this vector.
|
float |
euclideanDistance(Vector vector)
Returns the euclidean distance between this vector and
vector |
Map<Object,Number> |
getActiveFeatures()
Returns a map containing all the non-zero features
|
float |
getFeatureValue(Object featureIdentifier)
Returns the value of the feature identified with
featureIdentifier |
Vector |
getZeroVector()
Returns a vector whose values are all 0.
|
float |
innerProduct(Vector vector)
Returns the dot product between this vector and
vector |
void |
pointWiseProduct(Vector vector)
Compute the point-wise product of this vector with the one in
vector. |
void |
setFeatureValue(Object featureIdentifier,
float value)
Assigns
value to the feature identified by |
getSquaredNorm, normalize, scalegetTextFromData, isCompatible, setDataFromTextfloat innerProduct(Vector vector)
vectorvector - float euclideanDistance(Vector vector) throws VectorOperationException
vectorvector - VectorOperationExceptionExceptionvoid pointWiseProduct(Vector vector)
vector.vector - the vector used for the point-wise productvoid add(Vector vector)
vector to this vectorvector - the vector to be addedvoid add(float coeff,
Vector vector)
vector multiplied by coeff to this vectorcoeff - the vector coefficientvector - the vector to be addedvoid add(float coeff,
float vectorCoeff,
Vector vector)
vector multiplied by vectorCoeff to this
vector multiplied bycoeff - the coefficient of this vectorvectorCoeff - the vector coefficientvector - the vector to be addedVector getZeroVector()
Vector copyVector()
Map<Object,Number> getActiveFeatures()
void setFeatureValue(Object featureIdentifier, float value)
value to the feature identified by featureIdentifier
NOTE: this method could be not the most efficient to set a feature value. Actual implementations
of the Vector class may provide faster methods using their specific type to identify features (instead of
a generic Object)
featureIdentifier - the identifier of the featurevalue - the value of the featurefloat getFeatureValue(Object featureIdentifier)
featureIdentifier
NOTE: this method could be not the most efficient to get a feature value. Actual implementations of the Vector class may provide faster methods using their specific type to identify features (instead of a generic Object)
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.