|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gregdennis.drej.Matrices
public final class Matrices
Utility methods for matrices and vectors.
Method Summary | |
---|---|
static double |
distance(GVector x1,
GVector x2)
Returns the distance between the two specified vectors: ∥x1 - x2∥ |
static double |
distanceSquared(GVector x1,
GVector x2)
Returns the squared distance between the two specified vectors: ∥x1 - x2∥² |
static GVector |
mapCols(Function fun,
GMatrix points)
Maps the given function to each column in the points matrix and returns the vector of values. |
static GVector |
mapRows(Function fun,
GMatrix points)
Maps the given function to each row in the points matrix and returns the vector of values. |
static GMatrix |
randomGaussianMatrix(int rows,
int cols)
Returns a matrix with the specified number of rows and columns where each element is randomly chosen from a Gaussian ("normal") distribution with mean 0.0 and standard deviation 1.0. |
static GVector |
randomGaussianVector(int size)
Returns a vector of the given size where each element is randomly chosen from a Gaussian ("normal") distribution with mean 0.0 and standard deviation 1.0. |
static GMatrix |
randomUniformMatrix(int rows,
int cols)
Returns a matrix with the specified number of rows and columns where each element is randomly chosen from a uniform distribution on the interval [0, 1]. |
static GVector |
randomUniformVector(int size)
Returns a vector of the given size where each element is randomly chosen from a uniform distribution on the interval [0, 1]. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double distance(GVector x1, GVector x2)
∥x1 - x2∥
MismatchedSizeException
- if vectors have different sizespublic static double distanceSquared(GVector x1, GVector x2)
∥x1 - x2∥²
MismatchedSizeException
- if vectors have different sizespublic static GVector mapCols(Function fun, GMatrix points)
public static GVector mapRows(Function fun, GMatrix points)
public static GMatrix randomUniformMatrix(int rows, int cols)
public static GMatrix randomGaussianMatrix(int rows, int cols)
public static GVector randomUniformVector(int size)
public static GVector randomGaussianVector(int size)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |