VectorType - Type of VectorSpaceEntryType - Type of Entry in the VectorSpacepublic abstract class AbstractVectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry> extends AbstractRing<VectorType> implements VectorSpace<VectorType,EntryType>
VectorSpace.Entry| Constructor and Description |
|---|
AbstractVectorSpace()
Creates a new instance of AbstractVectorSpace
|
| 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.
|
boolean |
equals(java.lang.Object other)
Determines if two RingType objects are equal
|
boolean |
equals(VectorType other,
double effectiveZero)
Determines if two RingType objects are effectively equal
|
double |
euclideanDistance(VectorType other)
Euclidean distance between
this and other,
which is the 2-norm between the difference of the Vectors |
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.
|
boolean |
isZero(double effectiveZero)
Determines if this ring is equal to zero using the element-wise effective
zero value.
|
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.
|
void |
scaleEquals(double scaleFactor)
Inline element-wise scaling of
this by
scaleFactor |
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, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus, zerofinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdotProduct, euclideanDistanceSquared, getMaxValue, getMinValueclone, dotTimes, dotTimesEquals, isZero, minus, minusEquals, negative, negativeEquals, plus, plusEquals, scale, scaledMinus, scaledMinusEquals, scaledPlus, scaledPlusEquals, zeropublic AbstractVectorSpace()
public boolean equals(java.lang.Object other)
Ringequals in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>equals in class java.lang.Objectother - RingType to compare against thispublic double sum()
VectorSpacesum in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public double norm1()
VectorSpacenorm1 in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public double norm2()
VectorSpacenorm2 in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public double norm2Squared()
VectorSpacenorm2Squared in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public double normInfinity()
VectorSpacenormInfinity in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public double norm(double power)
VectorSpacenorm in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>power - Power to exponentiate each entry, must be greater than 0.0,
Double.POSITIVE_INFINITYpublic double dot(VectorType other)
VectorSpacedot in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>other - The Vector with which to compute the dot product with this.
Must have the same dimensionality as this.public double angle(VectorType other)
VectorSpaceangle in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>other - Another vector with which to compute the angle. Must be the same
dimensionality.public double cosine(VectorType other)
VectorSpacecosine in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>other - another vector with which to compute the cosine, must be the
same dimension as thispublic double euclideanDistance(VectorType other)
VectorSpacethis and other,
which is the 2-norm between the difference of the VectorseuclideanDistance in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>other - Vector to which to compute the distance, must be the same
dimension as thispublic VectorType unitVector()
VectorSpaceunitVector in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public void unitVectorEquals()
VectorSpaceunitVectorEquals in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public boolean isUnitVector()
VectorSpaceisUnitVector in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>public boolean isUnitVector(double tolerance)
VectorSpaceisUnitVector in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>tolerance - The tolerance around 1.0 to allow the length.public boolean equals(VectorType other, double effectiveZero)
Ringequals in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>other - RingType to compare against thiseffectiveZero - tolerance threshold for element-wise equalitypublic void scaleEquals(double scaleFactor)
Ringthis by
scaleFactorscaleEquals in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>scaleFactor - amount to scale the elements of thispublic boolean isZero(double effectiveZero)
RingisZero in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>effectiveZero - Tolerance threshold for element-wise equality