public final class MatrixUtils extends Object
FastByIDMaps of FastByIDFloatMaps, or of float[].| Modifier and Type | Method and Description |
|---|---|
static void |
addTo(long row,
long column,
float value,
FastByIDMap<FastByIDFloatMap> RbyRow,
FastByIDMap<FastByIDFloatMap> RbyColumn)
Efficiently increments an entry in two parallel, sparse matrices.
|
static FastByIDMap<float[]> |
getPseudoInverse(FastByIDMap<float[]> M)
Pseudo-inverts a tall skinny matrix M.
|
static org.apache.commons.math3.linear.RealMatrix |
getTransposeTimesSelfInverse(FastByIDMap<float[]> M) |
static org.apache.commons.math3.linear.RealMatrix |
invert(org.apache.commons.math3.linear.RealMatrix M) |
static String |
matrixToString(FastByIDMap<FastByIDFloatMap> M) |
static FastByIDMap<float[]> |
multiply(org.apache.commons.math3.linear.RealMatrix M,
FastByIDMap<float[]> S) |
static double[] |
multiply(org.apache.commons.math3.linear.RealMatrix matrix,
float[] V) |
static org.apache.commons.math3.linear.RealMatrix |
multiplyXYT(FastByIDMap<float[]> X,
FastByIDMap<float[]> Y) |
static void |
remove(long row,
long column,
FastByIDMap<FastByIDFloatMap> RbyRow,
FastByIDMap<FastByIDFloatMap> RbyColumn)
Efficiently removes an entry in two parallel, sparse matrices.
|
static org.apache.commons.math3.linear.RealMatrix |
transposeTimesSelf(FastByIDMap<float[]> M) |
public static void addTo(long row,
long column,
float value,
FastByIDMap<FastByIDFloatMap> RbyRow,
FastByIDMap<FastByIDFloatMap> RbyColumn)
row - row to incrementcolumn - column to incrementvalue - increment valueRbyRow - matrix R to update, keyed by rowRbyColumn - matrix R to update, keyed by columnpublic static void remove(long row,
long column,
FastByIDMap<FastByIDFloatMap> RbyRow,
FastByIDMap<FastByIDFloatMap> RbyColumn)
row - row to removecolumn - column to removeRbyRow - matrix R to update, keyed by rowRbyColumn - matrix R to update, keyed by columnpublic static FastByIDMap<float[]> getPseudoInverse(FastByIDMap<float[]> M)
Pseudo-inverts a tall skinny matrix M. The result can be used as a left-inverse of M or right-inverse of MT:
((MT * M)^-1 * MT) * M = I
MT * (M * (MT * M)^-1) = I
M - tall skinny matrixpublic static org.apache.commons.math3.linear.RealMatrix getTransposeTimesSelfInverse(FastByIDMap<float[]> M)
public static org.apache.commons.math3.linear.RealMatrix invert(org.apache.commons.math3.linear.RealMatrix M)
public static FastByIDMap<float[]> multiply(org.apache.commons.math3.linear.RealMatrix M, FastByIDMap<float[]> S)
M - small RealMatrixS - wide, short matrixpublic static org.apache.commons.math3.linear.RealMatrix multiplyXYT(FastByIDMap<float[]> X, FastByIDMap<float[]> Y)
public static double[] multiply(org.apache.commons.math3.linear.RealMatrix matrix,
float[] V)
public static org.apache.commons.math3.linear.RealMatrix transposeTimesSelf(FastByIDMap<float[]> M)
M - tall, skinny matrixpublic static String matrixToString(FastByIDMap<FastByIDFloatMap> M)
M - matrix to printCopyright © 2012. All Rights Reserved.