public class SymmMatrix extends DMatrix
Modifier and Type | Class and Description |
---|---|
static class |
SymmMatrix.BunchKaufman
The LU decomposition.
|
static class |
SymmMatrix.Cholesky
The Cholesky decomposition of a symmetric, positive-definite matrix.
|
Constructor and Description |
---|
SymmMatrix(UPLO uplo,
double[][] AP)
Constructor.
|
SymmMatrix(UPLO uplo,
int n)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SymmMatrix.BunchKaufman |
bk()
Bunch-Kaufman decomposition.
|
SymmMatrix.Cholesky |
cholesky()
Cholesky decomposition for symmetric and positive definite matrix.
|
SymmMatrix |
clone() |
boolean |
equals(java.lang.Object o) |
boolean |
equals(SymmMatrix o,
double eps)
Returns if two matrices equals given an error margin.
|
double |
get(int i,
int j)
Returns A[i, j].
|
Layout |
layout()
Returns the matrix layout.
|
void |
mv(double[] work,
int inputOffset,
int outputOffset)
Matrix-vector multiplication A * x.
|
void |
mv(Transpose trans,
double alpha,
double[] x,
double beta,
double[] y)
Matrix-vector multiplication.
|
int |
ncols()
Returns the number of columns.
|
int |
nrows()
Returns the number of rows.
|
SymmMatrix |
set(int i,
int j,
double x)
Sets A[i, j] = x.
|
long |
size()
Returns the number of stored matrix elements.
|
void |
tv(double[] work,
int inputOffset,
int outputOffset)
Matrix-vector multiplication A' * x.
|
UPLO |
uplo()
Gets the format of packed matrix.
|
apply, diag, market, mv, mv, mv, trace, tv, tv, tv, update
public SymmMatrix(UPLO uplo, int n)
uplo
- the symmetric matrix stores the upper or lower triangle.n
- the dimension of matrix.public SymmMatrix(UPLO uplo, double[][] AP)
uplo
- the symmetric matrix stores the upper or lower triangle.AP
- the symmetric matrix.public SymmMatrix clone()
clone
in class java.lang.Object
public int nrows()
IMatrix
public int ncols()
IMatrix
public long size()
IMatrix
public Layout layout()
public UPLO uplo()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(SymmMatrix o, double eps)
o
- the other matrix.eps
- the error margin.public double get(int i, int j)
DMatrix
public SymmMatrix set(int i, int j, double x)
DMatrix
public void mv(Transpose trans, double alpha, double[] x, double beta, double[] y)
DMatrix
y = alpha * op(A) * x + beta * y
where op is the transpose operation.public void mv(double[] work, int inputOffset, int outputOffset)
IMatrix
public void tv(double[] work, int inputOffset, int outputOffset)
IMatrix
public SymmMatrix.BunchKaufman bk()
public SymmMatrix.Cholesky cholesky()
java.lang.ArithmeticException
- if the matrix is not positive definite.