Example usage for Java org.apache.mahout.math Vector fields, constructors, methods, implement or subclass
The text is from its open source code.
Iterable | all() |
Vector | assign(double value) Assign the value to all elements of the receiver |
Vector | assign(double[] values) Assign the values to the receiver |
Vector | assign(Vector other) Assign the other vector values to the receiver |
Vector | assign(DoubleFunction function) Apply the function to each element of the receiver |
Vector | assign(Vector other, DoubleDoubleFunction function) Apply the function to each element of the receiver and the corresponding element of the other argument |
Vector | assign(DoubleDoubleFunction f, double y) Apply the function to each element of the receiver, using the y value as the second argument of the DoubleDoubleFunction |
Vector | clone() Return a copy of the recipient |
Matrix | cross(Vector other) Return the cross product of the receiver and the other vector |
Vector | divide(double x) Return a new vector containing the values of the recipient divided by the argument |
double | dot(Vector x) Return the dot product of the recipient and the argument |
double | get(int index) Return the value at the given index |
double | getDistanceSquared(Vector v) Get the square of the distance between this vector and the other vector. |
Element | getElement(int index) Return an object of Vector.Element representing an element of this Vector. |
double | getLengthSquared() Return the sum of squares of all elements in the vector. |
int | getNumNondefaultElements() Return the number of values in the recipient which are not the default value. |
int | getNumNonZeroElements() Return the number of non zero elements in the vector. |
double | getQuick(int index) Return the value at the given index, without checking bounds |
boolean | isDense() true if this implementation should be considered dense -- that it explicitly represents every value |
boolean | isSequentialAccess() true if this implementation should be considered to be iterable in index order in an efficient way. |
Vector | like() Return an empty vector of the same underlying class as the receiver |
double | maxValue() |
int | maxValueIndex() |
Vector | minus(Vector x) Return a new vector containing the element by element difference of the recipient and the argument |
double | minValue() |
int | minValueIndex() |
Iterable | nonZeroes() |
double | norm(double power) Return the k-norm of the vector. |
Vector | normalize(double power) Return a new Vector containing the normalized (L_power norm) values of the recipient. |
Vector | plus(double x) Return a new vector containing the sum of each value of the recipient and the argument |
Vector | plus(Vector x) Return a new vector containing the element by element sum of the recipient and the argument |
void | set(int index, double value) Set the value at the given index |
void | setQuick(int index, double value) Set the value at the given index, without checking bounds |
int | size() Return the cardinality of the recipient (the maximum number of values) |
Vector | times(double x) Return a new vector containing the product of each value of the recipient and the argument |
Vector | times(Vector x) Return a new vector containing the element-wise product of the recipient and the argument |
Vector | viewPart(int offset, int length) Return a new vector containing the subset of the recipient |
double | zSum() Return the sum of all the elements of the receiver |