VectorType
- Type of VectorSpaceEntryType
- Type of entry for the iteration@PublicationReference(author="Wikipedia", title="Vector space", type=WebPage, year=2011, url="http://en.wikipedia.org/wiki/Vector_space") public interface VectorSpace<VectorType extends VectorSpace<VectorType,?>,EntryType extends VectorSpace.Entry> extends Ring<VectorType>, java.lang.Iterable<EntryType>
Modifier and Type | Interface and Description |
---|---|
static interface |
VectorSpace.Entry
Entry into the VectorSpace
|
Modifier and Type | Method and Description |
---|---|
double |
angle(VectorType other)
Computes the angle between two Vectors.
|
double |
cosine(VectorType other)
Computes the cosine between two Vectors
|
double |
dot(VectorType other)
The inner product of this vector with the given vector.
|
double |
dotProduct(VectorType other)
The inner product of this vector with the given vector.
|
double |
euclideanDistance(VectorType other)
Euclidean distance between
this and other ,
which is the 2-norm between the difference of the Vectors |
double |
euclideanDistanceSquared(VectorType other)
Squared Euclidean distance between
this and
other , which is the 2-norm between the difference of the
Vectors |
double |
getMaxValue()
The maximum value associated with any key in the vector.
|
double |
getMinValue()
The minimum value associated with any key in the vector.
|
boolean |
isUnitVector()
Determines if this vector is a unit vector (norm2 = 1.0).
|
boolean |
isUnitVector(double tolerance)
Determines if this vector is a unit vector within some tolerance for the
2-norm.
|
double |
norm(double power)
Returns the p-norm of the Vector with the given power.
|
double |
norm1()
1-norm of the vector (sum of absolute values in the vector)
|
double |
norm2()
2-norm of the vector (aka Euclidean distance of the vector)
|
double |
norm2Squared()
Squared 2-norm of the vector (aka squared Euclidean distance of the
vector)
|
double |
normInfinity()
Returns the infinity norm of the Vector, which is the maximum
absolute value of an element in the Vector.
|
double |
sum()
Computes the sum of the elements in the vector.
|
VectorType |
unitVector()
Returns the unit vector of this vector.
|
void |
unitVectorEquals()
Modifies this vector to be a the unit vector.
|
clone, dotTimes, dotTimesEquals, equals, equals, isZero, isZero, minus, minusEquals, negative, negativeEquals, plus, plusEquals, scale, scaledMinus, scaledMinusEquals, scaledPlus, scaledPlusEquals, scaleEquals, zero
double sum()
double getMaxValue()
double getMinValue()
double norm1()
double norm2()
double norm2Squared()
double normInfinity()
@PublicationReference(author="Wikipedia", title="Vector norm, p-norm", type=WebPage, year=2011, url="http://en.wikipedia.org/wiki/Vector_norm#p-norm") double norm(double power)
power
- Power to exponentiate each entry, must be greater than 0.0,
Double.POSITIVE_INFINITYdouble dot(VectorType other)
other
- The Vector with which to compute the dot product with this.
Must have the same dimensionality as this.double dotProduct(VectorType other)
other
- The Vector with which to compute the dot product with this.
Must have the same dimensionality as this.double angle(VectorType other)
other
- Another vector with which to compute the angle. Must be the same
dimensionality.double cosine(VectorType other)
other
- another vector with which to compute the cosine, must be the
same dimension as thisdouble euclideanDistance(VectorType other)
this
and other
,
which is the 2-norm between the difference of the Vectorsother
- Vector to which to compute the distance, must be the same
dimension as thisdouble euclideanDistanceSquared(VectorType other)
this
and
other
, which is the 2-norm between the difference of the
Vectorsother
- Vector to which to compute the squared distance, must be the
same dimension as thisVectorType unitVector()
void unitVectorEquals()
boolean isUnitVector()
boolean isUnitVector(double tolerance)
tolerance
- The tolerance around 1.0 to allow the length.