Package org.jblas
Class Geometry
- java.lang.Object
-
- org.jblas.Geometry
-
public class Geometry extends java.lang.ObjectGeneral functions which are geometric in nature.
For example, computing all pairwise squared distances between all columns of a matrix.
-
-
Constructor Summary
Constructors Constructor Description Geometry()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoubleMatrixcenter(DoubleMatrix x)Center a vector (subtract mean from all elements (in-place).static FloatMatrixcenter(FloatMatrix x)Center a vector (subtract mean from all elements (in-place).static DoubleMatrixcenterColumns(DoubleMatrix x)Center the columns of a matrix (in-place).static FloatMatrixcenterColumns(FloatMatrix x)Center the columns of a matrix (in-place).static DoubleMatrixcenterRows(DoubleMatrix x)Center the rows of a matrix (in-place).static FloatMatrixcenterRows(FloatMatrix x)Center the rows of a matrix (in-place).static DoubleMatrixnormalize(DoubleMatrix x)Normalize a vector (scale such that its Euclidean norm is 1) (in-place).static FloatMatrixnormalize(FloatMatrix x)Normalize a vector (scale such that its Euclidean norm is 1) (in-place).static DoubleMatrixnormalizeColumns(DoubleMatrix x)Normalize the columns of a matrix (in-place).static FloatMatrixnormalizeColumns(FloatMatrix x)Normalize the columns of a matrix (in-place).static DoubleMatrixnormalizeRows(DoubleMatrix x)Normalize the rows of a matrix (in-place).static FloatMatrixnormalizeRows(FloatMatrix x)Normalize the rows of a matrix (in-place).static DoubleMatrixpairwiseSquaredDistances(DoubleMatrix X, DoubleMatrix Y)Compute the pairwise squared distances between all columns of the two matrices.static FloatMatrixpairwiseSquaredDistances(FloatMatrix X, FloatMatrix Y)Compute the pairwise squared distances between all columns of the two matrices.
-
-
-
Method Detail
-
pairwiseSquaredDistances
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.
-
center
public static DoubleMatrix center(DoubleMatrix x)
Center a vector (subtract mean from all elements (in-place).
-
centerRows
public static DoubleMatrix centerRows(DoubleMatrix x)
Center the rows of a matrix (in-place).
-
centerColumns
public static DoubleMatrix centerColumns(DoubleMatrix x)
Center the columns of a matrix (in-place).
-
normalize
public static DoubleMatrix normalize(DoubleMatrix x)
Normalize a vector (scale such that its Euclidean norm is 1) (in-place).
-
normalizeRows
public static DoubleMatrix normalizeRows(DoubleMatrix x)
Normalize the rows of a matrix (in-place).
-
normalizeColumns
public static DoubleMatrix normalizeColumns(DoubleMatrix x)
Normalize the columns of a matrix (in-place).
-
pairwiseSquaredDistances
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.
-
center
public static FloatMatrix center(FloatMatrix x)
Center a vector (subtract mean from all elements (in-place).
-
centerRows
public static FloatMatrix centerRows(FloatMatrix x)
Center the rows of a matrix (in-place).
-
centerColumns
public static FloatMatrix centerColumns(FloatMatrix x)
Center the columns of a matrix (in-place).
-
normalize
public static FloatMatrix normalize(FloatMatrix x)
Normalize a vector (scale such that its Euclidean norm is 1) (in-place).
-
normalizeRows
public static FloatMatrix normalizeRows(FloatMatrix x)
Normalize the rows of a matrix (in-place).
-
normalizeColumns
public static FloatMatrix normalizeColumns(FloatMatrix x)
Normalize the columns of a matrix (in-place).
-
-