public class Geometry extends Object
General functions which are geometric in nature.
For example, computing all pairwise squared distances between all columns of a matrix.
Constructor and Description |
---|
Geometry() |
Modifier and Type | Method and Description |
---|---|
static DoubleMatrix |
center(DoubleMatrix x)
Center a vector (subtract mean from all elements (in-place).
|
static FloatMatrix |
center(FloatMatrix x)
Center a vector (subtract mean from all elements (in-place).
|
static DoubleMatrix |
centerColumns(DoubleMatrix x)
Center the columns of a matrix (in-place).
|
static FloatMatrix |
centerColumns(FloatMatrix x)
Center the columns of a matrix (in-place).
|
static DoubleMatrix |
centerRows(DoubleMatrix x)
Center the rows of a matrix (in-place).
|
static FloatMatrix |
centerRows(FloatMatrix x)
Center the rows of a matrix (in-place).
|
static DoubleMatrix |
normalize(DoubleMatrix x)
Normalize a vector (scale such that its Euclidean norm is 1) (in-place).
|
static FloatMatrix |
normalize(FloatMatrix x)
Normalize a vector (scale such that its Euclidean norm is 1) (in-place).
|
static DoubleMatrix |
normalizeColumns(DoubleMatrix x)
Normalize the columns of a matrix (in-place).
|
static FloatMatrix |
normalizeColumns(FloatMatrix x)
Normalize the columns of a matrix (in-place).
|
static DoubleMatrix |
normalizeRows(DoubleMatrix x)
Normalize the rows of a matrix (in-place).
|
static FloatMatrix |
normalizeRows(FloatMatrix x)
Normalize the rows of a matrix (in-place).
|
static DoubleMatrix |
pairwiseSquaredDistances(DoubleMatrix X,
DoubleMatrix Y)
Compute the pairwise squared distances between all columns of the two
matrices.
|
static FloatMatrix |
pairwiseSquaredDistances(FloatMatrix X,
FloatMatrix Y)
Compute the pairwise squared distances between all columns of the two
matrices.
|
public static DoubleMatrix pairwiseSquaredDistances(DoubleMatrix X, DoubleMatrix Y)
Compute the pairwise squared distances between all columns of the two matrices.
An efficient way to do this is to observe that (x-y)^2 = x^2 - 2xy - y^2 and to then properly carry out the computation with matrices.
public static DoubleMatrix center(DoubleMatrix x)
public static DoubleMatrix centerRows(DoubleMatrix x)
public static DoubleMatrix centerColumns(DoubleMatrix x)
public static DoubleMatrix normalize(DoubleMatrix x)
public static DoubleMatrix normalizeRows(DoubleMatrix x)
public static DoubleMatrix normalizeColumns(DoubleMatrix x)
public static FloatMatrix pairwiseSquaredDistances(FloatMatrix X, FloatMatrix Y)
Compute the pairwise squared distances between all columns of the two matrices.
An efficient way to do this is to observe that (x-y)^2 = x^2 - 2xy - y^2 and to then properly carry out the computation with matrices.
public static FloatMatrix center(FloatMatrix x)
public static FloatMatrix centerRows(FloatMatrix x)
public static FloatMatrix centerColumns(FloatMatrix x)
public static FloatMatrix normalize(FloatMatrix x)
public static FloatMatrix normalizeRows(FloatMatrix x)
public static FloatMatrix normalizeColumns(FloatMatrix x)
Copyright © 2015. All rights reserved.