public class DMatrix
extends java.lang.Object
| Constructor and Description |
|---|
DMatrix(DMatrix that)
Copy constructor.
|
DMatrix(double[][] data,
int r,
int c)
Creates a new DMatrix with r rows and
c columns using the data in data.
|
DMatrix(int r,
int c)
Creates a new DMatrix with r rows and
c columns.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
CholeskyDecompose(double[][] M,
double[][] L)
Given a symmetric positive-definite matrix M, performs the Cholesky
decomposition of M and returns the result as a lower triangular matrix L,
such that M = LLT.
|
static DoubleMatrix2D |
CholeskyDecompose(DoubleMatrix2D M)
Given a symmetric positive-definite matrix M, performs the Cholesky
decomposition of M and returns the result as a lower triangular matrix L,
such that M = LLT.
|
double |
get(int row,
int column)
Returns the matrix element in the specified row and column.
|
int |
numColumns()
Returns the number of columns of the DMatrix.
|
int |
numRows()
Returns the number of rows of the DMatrix.
|
static void |
PCADecompose(double[][] M,
double[][] A,
double[] lambda)
Computes the principal components decomposition M =
UΛUt by using the singular value decomposition of matrix
M.
|
static DoubleMatrix2D |
PCADecompose(DoubleMatrix2D M,
double[] lambda)
Computes the principal components decomposition M =
UΛUt by using the singular value decomposition of matrix
M.
|
void |
set(int row,
int column,
double value)
Sets the value of the element in the specified row and column.
|
java.lang.String |
toString()
Creates a
String containing all the data of
the DMatrix. |
static java.lang.String |
toString(double[][] M)
Returns matrix M as a string.
|
DMatrix |
transpose()
Returns the transposed matrix.
|
public DMatrix(int r,
int c)
r - the number of rowsc - the number of columnspublic DMatrix(double[][] data,
int r,
int c)
data - the data of the new DMatrixr - the number of rowsc - the number of columnspublic DMatrix(DMatrix that)
that - the DMatrix to copypublic static void CholeskyDecompose(double[][] M,
double[][] L)
M - the input matrixL - the Cholesky lower triangular matrixpublic static DoubleMatrix2D CholeskyDecompose(DoubleMatrix2D M)
M - the input matrixpublic static void PCADecompose(double[][] M,
double[][] A,
double[] lambda)
M - input matrixA - matrix square root of Mlambda - the eigenvaluespublic static DoubleMatrix2D PCADecompose(DoubleMatrix2D M,
double[] lambda)
M - input matrixlambda - the eigenvaluespublic static java.lang.String toString(double[][] M)
public java.lang.String toString()
String containing all the data of
the DMatrix. The result is displayed in matrix form, with
each row on a line.toString in class java.lang.Objectpublic int numRows()
public int numColumns()
public double get(int row,
int column)
row - the row of the selected elementcolumn - the column of the selected elementjava.lang.IndexOutOfBoundsException - if the selected element would
be outside the DMatrixpublic void set(int row,
int column,
double value)
row - the row of the selected elementcolumn - the column of the selected elementvalue - the new value of the elementjava.lang.IndexOutOfBoundsException - if the selected element would
be outside the DMatrixpublic DMatrix transpose()
To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.