|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.util.Vector
public class Vector
Mathematical operators for manipulating vectors (double arrays).
| Method Summary | |
|---|---|
static double[] |
add(double[] u,
double[] v)
Returns the sum of the two specified vectors, u + v. |
static double[] |
divide(double[] u,
double a)
Returns the scalar division of the specified vector, u / a. |
static double |
dot(double[] u,
double[] v)
Returns the dot (inner) product of the two specified vectors. |
static boolean |
isZero(double[] u)
Returns true if the specified vector contains all zeros;
false otherwise. |
static double |
magnitude(double[] u)
Returns the magnitude (Euclidean norm) of the specified vector. |
static double[] |
mean(double[][] vs)
Returns the mean vector of the specified vectors. |
static double[] |
multiply(double a,
double[] u)
Returns the scalar multiple of the specified vector, a * u. |
static double[] |
negate(double[] u)
Returns the negation of the specified vector, -u. |
static double[] |
normalize(double[] u)
Returns the specified vector normalized to have a magnitude of 1. |
static double[][] |
orthogonalize(double[][] vs)
Returns the orthogonal basis for the specified vectors using the Gram-Schmidt process. |
static double[] |
orthogonalize(double[] u,
Iterable<double[]> vs)
Returns the vector u orthogonal to the already orthogonalized
vectors vs. |
static double[] |
project(double[] u,
double[] v)
Returns the projection of u onto v. |
static double[] |
subtract(double[] u,
double[] v)
Returns the difference between the two specified vectors, u - v. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static double[] subtract(double[] u,
double[] v)
u - v.
The two vectors must be of the same length.
u - the first vectorv - the second vector
u - v
IllegalArgumentException - if the two vectors are not the same length
public static double[] add(double[] u,
double[] v)
u + v. The two
vectors must be of the same length.
u - the first vectorv - the second vector
u + v
IllegalArgumentException - if the two vectors are not the same length
public static double[] multiply(double a,
double[] u)
a * u.
a - the scalar valueu - the vector
a * upublic static double[] negate(double[] u)
-u. This is
equivalent to calling multiply(-1, u).
u - the vector
-u
public static double[] divide(double[] u,
double a)
u / a.
u - the vectora - the scalar value (the denominator)
u / a
public static double dot(double[] u,
double[] v)
u - the first vectorv - the second vector
IllegalArgumentException - if the two vectors are not the same lengthpublic static double magnitude(double[] u)
u - the vector
public static double[] normalize(double[] u)
u - the vector
IllegalArgumentException - if the specified vector contains all zeros
public static double[] project(double[] u,
double[] v)
u onto v. The two vectors must
be the same length.
u - the vector being projectedv - the vector onto which u is being projected
u onto v
IllegalArgumentException - if the two vectors are not the same
lengthpublic static double[][] orthogonalize(double[][] vs)
vs - the vectors to be orthogonalized
public static double[] orthogonalize(double[] u,
Iterable<double[]> vs)
u orthogonal to the already orthogonalized
vectors vs. This method is provided to allow incremental
construction of the orthogonal basis:
List<double[]> basis = new ArrayList<double[]>();
for (double[] v : vectors) {
double[] e = orthogonalize(v, basis);
basis.add(e);
}
u - the vectorvs - the already orthogonalized vectors
u orthogonal to the already orthogonalized
vectors vspublic static double[] mean(double[][] vs)
vs - the vectors
IllegalArgumentException - if the specified vectors is emptypublic static boolean isZero(double[] u)
true if the specified vector contains all zeros;
false otherwise.
u - the vector
true if the specified vector contains all zeros;
false otherwise
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||