|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.sandia.cognition.util.AbstractCloneableSerializable
gov.sandia.cognition.math.AbstractRing<VectorType>
gov.sandia.cognition.math.matrix.AbstractVectorSpace<VectorType,EntryType>
VectorType
- Type of VectorSpaceEntryType
- Type of Entry in the VectorSpacepublic abstract class AbstractVectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
Partial implementation of VectorSpace
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface gov.sandia.cognition.math.matrix.VectorSpace |
---|
VectorSpace.Entry |
Constructor Summary | |
---|---|
AbstractVectorSpace()
Creates a new instance of AbstractVectorSpace |
Method Summary | |
---|---|
double |
angle(VectorType other)
Computes the angle between two Vectors. |
double |
cosine(VectorType other)
Computes the cosine between two Vectors |
boolean |
equals(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. |
Methods inherited from class gov.sandia.cognition.math.AbstractRing |
---|
clone, dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus, zero |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gov.sandia.cognition.math.matrix.VectorSpace |
---|
dotProduct, euclideanDistanceSquared |
Methods inherited from interface gov.sandia.cognition.math.Ring |
---|
clone, dotTimes, dotTimesEquals, isZero, minus, minusEquals, negative, negativeEquals, plus, plusEquals, scale, scaledMinus, scaledMinusEquals, scaledPlus, scaledPlusEquals, zero |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Constructor Detail |
---|
public AbstractVectorSpace()
Method Detail |
---|
public boolean equals(Object other)
Ring
equals
in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>
equals
in class Object
other
- RingType to compare against this
public double sum()
VectorSpace
sum
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public double norm1()
VectorSpace
norm1
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public double norm2()
VectorSpace
norm2
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public double norm2Squared()
VectorSpace
norm2Squared
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public double normInfinity()
VectorSpace
normInfinity
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public double norm(double power)
VectorSpace
norm
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_INFINITY
public double angle(VectorType other)
VectorSpace
angle
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)
VectorSpace
cosine
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 this
public double euclideanDistance(VectorType other)
VectorSpace
this
and other
,
which is the 2-norm between the difference of the Vectors
euclideanDistance
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 this
public VectorType unitVector()
VectorSpace
unitVector
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public void unitVectorEquals()
VectorSpace
unitVectorEquals
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public boolean isUnitVector()
VectorSpace
isUnitVector
in interface VectorSpace<VectorType extends VectorSpace<VectorType,? extends EntryType>,EntryType extends VectorSpace.Entry>
public boolean isUnitVector(double tolerance)
VectorSpace
isUnitVector
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)
Ring
equals
in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>
other
- RingType to compare against this
effectiveZero
- tolerance threshold for element-wise equality
public void scaleEquals(double scaleFactor)
Ring
this
by
scaleFactor
scaleEquals
in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>
scaleFactor
- amount to scale the elements of this
public boolean isZero(double effectiveZero)
Ring
isZero
in interface Ring<VectorType extends VectorSpace<VectorType,? extends EntryType>>
effectiveZero
- Tolerance threshold for element-wise equality
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |