|
SSJ V. 2.6.2. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.util.DMatrix
public class DMatrix
This class implements a few methods for matrix calculations with double numbers.
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
static void |
copy(double[][] M,
double[][] R)
Copies the matrix M into R. |
static double[][] |
exp(double[][] A)
Similar to exp(A). |
static DoubleMatrix2D |
exp(DoubleMatrix2D A)
Returns eA, the exponential of the square matrix A. |
static DoubleMatrix2D |
expBidiagonal(DoubleMatrix2D A)
Returns eA, the exponential of the bidiagonal square matrix A. |
static DoubleMatrix1D |
expBidiagonal(DoubleMatrix2D A,
DoubleMatrix1D b)
Computes c = eAb, where eA is the exponential of the bidiagonal square matrix A. |
static DoubleMatrix2D |
expmiBidiagonal(DoubleMatrix2D A)
Computes eA - I, where eA is the exponential of the bidiagonal square matrix A. |
static DoubleMatrix1D |
expmiBidiagonal(DoubleMatrix2D A,
DoubleMatrix1D b)
Computes c = (eA - I)b, where eA is the exponential of the bidiagonal square matrix A. |
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. |
static double[] |
solveLU(double[][] A,
double[] b)
Solves the matrix equation Ax = b using LU decomposition. |
static void |
solveTriangular(DoubleMatrix2D U,
DoubleMatrix2D B,
DoubleMatrix2D X)
Solve the triangular matrix equation UX = B for X. |
String |
toString()
Creates a String containing all the data of
the DMatrix. |
static String |
toString(double[][] M)
Returns matrix M as a string. |
DMatrix |
transpose()
Returns the transposed matrix. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DMatrix(int r,
int c)
r - the number of rowsc - the number of columns
public 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 copy| Method Detail |
|---|
public static void CholeskyDecompose(double[][] M,
double[][] L)
M - the input matrixL - the Cholesky lower triangular matrixpublic static DoubleMatrix2D CholeskyDecompose(DoubleMatrix2D M)
M - the input matrix
public static void PCADecompose(double[][] M,
double[][] A,
double[] lambda)
M - input matrixA - matrix square root of Mlambda - the eigenvalues
public static DoubleMatrix2D PCADecompose(DoubleMatrix2D M,
double[] lambda)
M - input matrixlambda - the eigenvalues
public static double[] solveLU(double[][] A,
double[] b)
A - square matrixb - right side vector
public static void solveTriangular(DoubleMatrix2D U,
DoubleMatrix2D B,
DoubleMatrix2D X)
U - input matrixB - right-hand side matrixX - output matrixpublic static double[][] exp(double[][] A)
exp(A).
A - input matrix
public static DoubleMatrix2D exp(DoubleMatrix2D A)
A - input matrix
public static DoubleMatrix2D expBidiagonal(DoubleMatrix2D A)
exp(A) because of the special form of A.
A - bidiagonal matrix
public static DoubleMatrix1D expBidiagonal(DoubleMatrix2D A,
DoubleMatrix1D b)
A - bidiagonal matrix
public static DoubleMatrix2D expmiBidiagonal(DoubleMatrix2D A)
A - bidiagonal matrix
public static DoubleMatrix1D expmiBidiagonal(DoubleMatrix2D A,
DoubleMatrix1D b)
A - bidiagonal matrixb - vector
public static void copy(double[][] M,
double[][] R)
M - original matrixR - output matrixpublic static String toString(double[][] M)
public 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 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 element
IndexOutOfBoundsException - if the selected element would
be outside the DMatrix
public 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 element
IndexOutOfBoundsException - if the selected element would
be outside the DMatrixpublic DMatrix transpose()
|
SSJ V. 2.6.2. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||