public final class DoubleDiagonalMatrix extends DoubleTridiagonalMatrix
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DIAGONAL
Storage format identifier.
|
diag, ldiag, TRIDIAGONAL, udiagLU, LUpivotARRAY_2D, matrixCLASS_SPECIFIC, numCols, numRows, storageFormat| Modifier | Constructor and Description |
|---|---|
|
DoubleDiagonalMatrix(double[] array)
Constructs a matrix by wrapping an array containing the diagonal elements.
|
|
DoubleDiagonalMatrix(double[][] array)
Constructs a matrix from an array.
|
|
DoubleDiagonalMatrix(int size)
Constructs an empty matrix.
|
protected |
DoubleDiagonalMatrix(int size,
int storeID)
Constructs a matrix.
|
| Modifier and Type | Method and Description |
|---|---|
DoubleDiagonalMatrix |
add(DoubleDiagonalMatrix m)
Returns the addition of this matrix and another.
|
DoubleMatrix |
add(DoubleMatrix m)
Returns the addition of this matrix and another.
|
DoubleSquareMatrix |
add(DoubleSquareMatrix m)
Returns the addition of this matrix and another.
|
DoubleTridiagonalMatrix |
add(DoubleTridiagonalMatrix m)
Returns the addition of this matrix and another.
|
DoubleSquareMatrix[] |
choleskyDecompose()
Returns the Cholesky decomposition of this matrix.
|
double |
det()
Returns the determinant.
|
boolean |
equals(java.lang.Object m)
Compares two double diagonal matrices for equality.
|
double |
frobeniusNorm()
Returns the Frobenius (l2) norm.
|
double |
getElement(int i,
int j)
Returns an element of the matrix.
|
static DoubleDiagonalMatrix |
identity(int size)
Creates an identity matrix.
|
double |
infNorm()
Returns the l
-norm. |
DoubleSquareMatrix |
inverse()
Returns the inverse of this matrix.
|
boolean |
isSymmetric()
Returns true if this matrix is symmetric.
|
boolean |
isUnitary()
Returns true if this matrix is unitary.
|
DoubleSquareMatrix[] |
luDecompose(int[] pivot)
Returns the LU decomposition of this matrix.
|
DoubleMatrix |
mapElements(Mapping f)
Applies a function on all the matrix elements.
|
DoubleDiagonalMatrix |
multiply(DoubleDiagonalMatrix m)
Returns the multiplication of this matrix and another.
|
DoubleMatrix |
multiply(DoubleMatrix m)
Returns the multiplication of this matrix and another.
|
DoubleSquareMatrix |
multiply(DoubleSquareMatrix m)
Returns the multiplication of this matrix and another.
|
DoubleSquareMatrix |
multiply(DoubleTridiagonalMatrix m)
Returns the multiplication of this matrix and another.
|
DoubleVector |
multiply(DoubleVector v)
Returns the multiplication of a vector by this matrix.
|
double |
operatorNorm()
Returns the operator norm.
|
DoubleMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar.
|
double |
scalarProduct(DoubleDiagonalMatrix m)
Returns the scalar product of this matrix and another.
|
double |
scalarProduct(DoubleMatrix m)
Returns the scalar product of this matrix and another.
|
double |
scalarProduct(DoubleSquareMatrix m)
Returns the scalar product of this matrix and another.
|
double |
scalarProduct(DoubleTridiagonalMatrix m)
Returns the scalar product of this matrix and another.
|
void |
setElement(int i,
int j,
double x)
Sets the value of an element of the matrix.
|
DoubleSquareMatrix[] |
singularValueDecompose()
Returns the singular value decomposition of this matrix.
|
DoubleDiagonalMatrix |
subtract(DoubleDiagonalMatrix m)
Returns the subtraction of this matrix by another.
|
DoubleMatrix |
subtract(DoubleMatrix m)
Returns the subtraction of this matrix and another.
|
DoubleSquareMatrix |
subtract(DoubleSquareMatrix m)
Returns the subtraction of this matrix and another.
|
DoubleTridiagonalMatrix |
subtract(DoubleTridiagonalMatrix m)
Returns the subtraction of this matrix and another.
|
ComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix.
|
IntegerMatrix |
toIntegerMatrix()
Converts this matrix to an integer matrix.
|
double |
trace()
Returns the trace.
|
Matrix |
transpose()
Returns the transpose of this matrix.
|
toStringpolarDecomposeadd, directSum, finalize, hashCode, multiply, negate, scalarDivide, scalarDivide, scalarMultiply, subtract, tensorProductcolumns, getInvalidElementMsg, rowsprotected static final int DIAGONAL
protected DoubleDiagonalMatrix(int size,
int storeID)
public DoubleDiagonalMatrix(int size)
size - the number of rows/columnspublic DoubleDiagonalMatrix(double[][] array)
array - an assigned valueMatrixDimensionException - If the array is not square.public DoubleDiagonalMatrix(double[] array)
array - an assigned valuepublic static DoubleDiagonalMatrix identity(int size)
size - the number of rows/columnspublic boolean equals(java.lang.Object m)
equals in class DoubleTridiagonalMatrixm - a double diagonal matrixpublic IntegerMatrix toIntegerMatrix()
toIntegerMatrix in class DoubleTridiagonalMatrixpublic ComplexMatrix toComplexMatrix()
toComplexMatrix in class DoubleTridiagonalMatrixpublic double getElement(int i,
int j)
getElement in class DoubleTridiagonalMatrixi - row index of the elementj - column index of the elementMatrixDimensionException - If attempting to access an invalid element.public void setElement(int i,
int j,
double x)
setElement in class DoubleTridiagonalMatrixi - row index of the elementj - column index of the elementx - a numberMatrixDimensionException - If attempting to access an invalid element.public boolean isSymmetric()
isSymmetric in class DoubleTridiagonalMatrixpublic boolean isUnitary()
isUnitary in class DoubleSquareMatrixpublic double det()
det in class DoubleSquareMatrixpublic double trace()
trace in class DoubleTridiagonalMatrixpublic double infNorm()
-norm.infNorm in class DoubleTridiagonalMatrixpublic double frobeniusNorm()
frobeniusNorm in class DoubleTridiagonalMatrixpublic double operatorNorm()
operatorNorm in class DoubleTridiagonalMatrixpublic DoubleMatrix add(DoubleMatrix m)
add in class DoubleTridiagonalMatrixm - a double matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix add(DoubleSquareMatrix m)
add in class DoubleTridiagonalMatrixm - a double square matrixMatrixDimensionException - If the matrices are different sizes.public DoubleTridiagonalMatrix add(DoubleTridiagonalMatrix m)
add in class DoubleTridiagonalMatrixm - a double tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleDiagonalMatrix add(DoubleDiagonalMatrix m)
m - a double diagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleMatrix subtract(DoubleMatrix m)
subtract in class DoubleTridiagonalMatrixm - a double matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
subtract in class DoubleTridiagonalMatrixm - a double square matrixMatrixDimensionException - If the matrices are different sizes.public DoubleTridiagonalMatrix subtract(DoubleTridiagonalMatrix m)
subtract in class DoubleTridiagonalMatrixm - a double tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleDiagonalMatrix subtract(DoubleDiagonalMatrix m)
m - a double diagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleMatrix scalarMultiply(double x)
scalarMultiply in class DoubleTridiagonalMatrixx - a double.public double scalarProduct(DoubleMatrix m)
scalarProduct in class DoubleTridiagonalMatrixm - a double matrix.MatrixDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleSquareMatrix m)
scalarProduct in class DoubleTridiagonalMatrixm - a double square matrix.MatrixDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleTridiagonalMatrix m)
scalarProduct in class DoubleTridiagonalMatrixm - a double tridiagonal matrix.MatrixDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleDiagonalMatrix m)
m - a double diagonal matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleVector multiply(DoubleVector v)
multiply in class DoubleTridiagonalMatrixv - a double vector.DimensionException - If the matrix and vector are incompatible.public DoubleMatrix multiply(DoubleMatrix m)
multiply in class DoubleTridiagonalMatrixm - a double matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix multiply(DoubleSquareMatrix m)
multiply in class DoubleTridiagonalMatrixm - a double square matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix multiply(DoubleTridiagonalMatrix m)
multiply in class DoubleTridiagonalMatrixm - a double tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleDiagonalMatrix multiply(DoubleDiagonalMatrix m)
m - a double diagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix inverse()
inverse in class DoubleSquareMatrixpublic Matrix transpose()
transpose in class DoubleTridiagonalMatrixpublic DoubleSquareMatrix[] luDecompose(int[] pivot)
luDecompose in class DoubleTridiagonalMatrixpivot - an empty array of length rows()+1
to hold the pivot information (null if not interested).
The last array element will contain the parity.public DoubleSquareMatrix[] choleskyDecompose()
choleskyDecompose in class DoubleTridiagonalMatrixpublic DoubleSquareMatrix[] singularValueDecompose()
singularValueDecompose in class DoubleTridiagonalMatrixpublic DoubleMatrix mapElements(Mapping f)
mapElements in class DoubleTridiagonalMatrixf - a user-defined function