|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
S - Type of the space.public interface Vector<S extends Space>
This interface represents a generic vector in a vectorial space or a point in an affine space.
Space,
Vector| Method Summary | |
|---|---|
Vector<S> |
add(double factor,
Vector<S> v)
Add a scaled vector to the instance. |
Vector<S> |
add(Vector<S> v)
Add a vector to the instance. |
double |
distance(Vector<S> v)
Compute the distance between the instance and another vector according to the L2 norm. |
double |
distance1(Vector<S> v)
Compute the distance between the instance and another vector according to the L1 norm. |
double |
distanceInf(Vector<S> v)
Compute the distance between the instance and another vector according to the L∞ norm. |
double |
distanceSq(Vector<S> v)
Compute the square of the distance between the instance and another vector. |
double |
dotProduct(Vector<S> v)
Compute the dot-product of the instance and another vector. |
double |
getNorm()
Get the L2 norm for the vector. |
double |
getNorm1()
Get the L1 norm for the vector. |
double |
getNormInf()
Get the L∞ norm for the vector. |
double |
getNormSq()
Get the square of the norm for the vector. |
Space |
getSpace()
Get the space to which the vector belongs. |
Vector<S> |
getZero()
Get the null vector of the vectorial space or origin point of the affine space. |
boolean |
isInfinite()
Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise |
boolean |
isNaN()
Returns true if any coordinate of this vector is NaN; false otherwise |
Vector<S> |
negate()
Get the opposite of the instance. |
Vector<S> |
normalize()
Get a normalized vector aligned with the instance. |
Vector<S> |
scalarMultiply(double a)
Multiply the instance by a scalar. |
Vector<S> |
subtract(double factor,
Vector<S> v)
Subtract a scaled vector from the instance. |
Vector<S> |
subtract(Vector<S> v)
Subtract a vector from the instance. |
String |
toString(NumberFormat format)
Get a string representation of this vector. |
| Method Detail |
|---|
Space getSpace()
Vector<S> getZero()
double getNorm1()
double getNorm()
double getNormSq()
double getNormInf()
Vector<S> add(Vector<S> v)
v - vector to add
Vector<S> add(double factor,
Vector<S> v)
factor - scale factor to apply to v before adding itv - vector to add
Vector<S> subtract(Vector<S> v)
v - vector to subtract
Vector<S> subtract(double factor,
Vector<S> v)
factor - scale factor to apply to v before subtracting itv - vector to subtract
Vector<S> negate()
Vector<S> normalize()
throws MathArithmeticException
MathArithmeticException - if the norm is zeroVector<S> scalarMultiply(double a)
a - scalar
boolean isNaN()
boolean isInfinite()
double distance1(Vector<S> v)
Calling this method is equivalent to calling:
q.subtract(p).getNorm1() except that no intermediate
vector is built
v - second vector
double distance(Vector<S> v)
Calling this method is equivalent to calling:
q.subtract(p).getNorm() except that no intermediate
vector is built
v - second vector
double distanceInf(Vector<S> v)
Calling this method is equivalent to calling:
q.subtract(p).getNormInf() except that no intermediate
vector is built
v - second vector
double distanceSq(Vector<S> v)
Calling this method is equivalent to calling:
q.subtract(p).getNormSq() except that no intermediate
vector is built
v - second vector
double dotProduct(Vector<S> v)
v - second vector
String toString(NumberFormat format)
format - the custom format for components
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||