S
- Type of the space.public interface Vector<S extends Space> extends Point<S>
Modifier and Type | Method and Description |
---|---|
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 |
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.
|
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
|
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.
|
Vector<S> getZero()
double getNorm1()
double getNorm()
double getNormSq()
double getNormInf()
Vector<S> add(Vector<S> v)
v
- vector to addVector<S> add(double factor, Vector<S> v)
factor
- scale factor to apply to v before adding itv
- vector to addVector<S> subtract(Vector<S> v)
v
- vector to subtractVector<S> subtract(double factor, Vector<S> v)
factor
- scale factor to apply to v before subtracting itv
- vector to subtractVector<S> negate()
Vector<S> normalize() throws MathRuntimeException
MathRuntimeException
- if the norm is zeroVector<S> scalarMultiply(double a)
a
- scalarboolean 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 vectordouble distanceInf(Vector<S> v)
Calling this method is equivalent to calling:
q.subtract(p).getNormInf()
except that no intermediate
vector is built
v
- second vectordouble distanceSq(Vector<S> v)
Calling this method is equivalent to calling:
q.subtract(p).getNormSq()
except that no intermediate
vector is built
v
- second vectordouble dotProduct(Vector<S> v)
v
- second vectorString toString(NumberFormat format)
format
- the custom format for componentsCopyright © 2016-2021 CS GROUP. All rights reserved.