public final class IntegerDiagonalMatrix extends IntegerTridiagonalMatrix
| 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 |
|---|---|
|
IntegerDiagonalMatrix(int size)
Constructs an empty matrix.
|
|
IntegerDiagonalMatrix(int[] array)
Constructs a matrix by wrapping an array containing the diagonal elements.
|
|
IntegerDiagonalMatrix(int[][] array)
Constructs a matrix from an array.
|
protected |
IntegerDiagonalMatrix(int size,
int storeID)
Constructs a matrix.
|
| Modifier and Type | Method and Description |
|---|---|
IntegerDiagonalMatrix |
add(IntegerDiagonalMatrix m)
Returns the addition of this matrix and another.
|
IntegerMatrix |
add(IntegerMatrix m)
Returns the addition of this matrix and another.
|
IntegerSquareMatrix |
add(IntegerSquareMatrix m)
Returns the addition of this matrix and another.
|
IntegerTridiagonalMatrix |
add(IntegerTridiagonalMatrix m)
Returns the addition of this matrix and another.
|
DoubleSquareMatrix[] |
choleskyDecompose()
Returns the Cholesky decomposition of this matrix.
|
int |
det()
Returns the determinant.
|
boolean |
equals(java.lang.Object m)
Compares two integer diagonal matrices for equality.
|
double |
frobeniusNorm()
Returns the Frobenius (l2) norm.
|
int |
getElement(int i,
int j)
Returns an element of the matrix.
|
static IntegerDiagonalMatrix |
identity(int size)
Creates an identity matrix.
|
int |
infNorm()
Returns the l
-norm. |
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.
|
IntegerDiagonalMatrix |
multiply(IntegerDiagonalMatrix m)
Returns the multiplication of this matrix and another.
|
IntegerMatrix |
multiply(IntegerMatrix m)
Returns the multiplication of this matrix and another.
|
IntegerSquareMatrix |
multiply(IntegerSquareMatrix m)
Returns the multiplication of this matrix and another.
|
IntegerSquareMatrix |
multiply(IntegerTridiagonalMatrix m)
Returns the multiplication of this matrix and another.
|
IntegerVector |
multiply(IntegerVector v)
Returns the multiplication of a vector by this matrix.
|
IntegerMatrix |
scalarMultiply(int x)
Returns the multiplication of this matrix by a scalar.
|
void |
setElement(int i,
int j,
int x)
Sets the value of an element of the matrix.
|
IntegerDiagonalMatrix |
subtract(IntegerDiagonalMatrix m)
Returns the subtraction of this matrix by another.
|
IntegerMatrix |
subtract(IntegerMatrix m)
Returns the subtraction of this matrix and another.
|
IntegerSquareMatrix |
subtract(IntegerSquareMatrix m)
Returns the subtraction of this matrix and another.
|
IntegerTridiagonalMatrix |
subtract(IntegerTridiagonalMatrix m)
Returns the subtraction of this matrix and another.
|
ComplexMatrix |
toComplexMatrix()
Converts this matrix to a complex matrix.
|
DoubleMatrix |
toDoubleMatrix()
Converts this matrix to a double matrix.
|
int |
trace()
Returns the trace.
|
Matrix |
transpose()
Returns the transpose of this matrix.
|
toStringcholeskyDecompositionadd, finalize, hashCode, multiply, negate, scalarDivide, scalarMultiply, subtractcolumns, getInvalidElementMsg, rowsprotected static final int DIAGONAL
protected IntegerDiagonalMatrix(int size,
int storeID)
public IntegerDiagonalMatrix(int size)
size - the number of rows/columnspublic IntegerDiagonalMatrix(int[][] array)
array - an assigned valueMatrixDimensionException - If the array is not square.public IntegerDiagonalMatrix(int[] array)
array - an assigned valuepublic static IntegerDiagonalMatrix identity(int size)
size - the number of rows/columnspublic boolean equals(java.lang.Object m)
equals in class IntegerTridiagonalMatrixm - a integer diagonal matrixpublic DoubleMatrix toDoubleMatrix()
toDoubleMatrix in class IntegerTridiagonalMatrixpublic ComplexMatrix toComplexMatrix()
toComplexMatrix in class IntegerTridiagonalMatrixpublic int getElement(int i,
int j)
getElement in class IntegerTridiagonalMatrixi - row index of the elementj - column index of the elementMatrixDimensionException - If attempting to access an invalid element.public void setElement(int i,
int j,
int x)
setElement in class IntegerTridiagonalMatrixi - row index of the elementj - column index of the elementx - an integerMatrixDimensionException - If attempting to access an invalid element.public boolean isSymmetric()
isSymmetric in class IntegerTridiagonalMatrixpublic boolean isUnitary()
isUnitary in class IntegerSquareMatrixpublic int det()
det in class IntegerSquareMatrixpublic int trace()
trace in class IntegerTridiagonalMatrixpublic int infNorm()
-norm.infNorm in class IntegerTridiagonalMatrixpublic double frobeniusNorm()
frobeniusNorm in class IntegerTridiagonalMatrixpublic IntegerMatrix add(IntegerMatrix m)
add in class IntegerTridiagonalMatrixm - an integer matrixMatrixDimensionException - If the matrices are different sizes.public IntegerSquareMatrix add(IntegerSquareMatrix m)
add in class IntegerTridiagonalMatrixm - an integer square matrixMatrixDimensionException - If the matrices are different sizes.public IntegerTridiagonalMatrix add(IntegerTridiagonalMatrix m)
add in class IntegerTridiagonalMatrixm - an integer tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public IntegerDiagonalMatrix add(IntegerDiagonalMatrix m)
m - an integer diagonal matrixMatrixDimensionException - If the matrices are different sizes.public IntegerMatrix subtract(IntegerMatrix m)
subtract in class IntegerTridiagonalMatrixm - an integer matrixMatrixDimensionException - If the matrices are different sizes.public IntegerSquareMatrix subtract(IntegerSquareMatrix m)
subtract in class IntegerTridiagonalMatrixm - an integer square matrixMatrixDimensionException - If the matrices are different sizes.public IntegerTridiagonalMatrix subtract(IntegerTridiagonalMatrix m)
subtract in class IntegerTridiagonalMatrixm - an integer tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public IntegerDiagonalMatrix subtract(IntegerDiagonalMatrix m)
m - an integer diagonal matrixMatrixDimensionException - If the matrices are different sizes.public IntegerMatrix scalarMultiply(int x)
scalarMultiply in class IntegerTridiagonalMatrixx - an integerpublic IntegerVector multiply(IntegerVector v)
multiply in class IntegerTridiagonalMatrixv - an integer vectorDimensionException - If the matrix and vector are incompatible.public IntegerMatrix multiply(IntegerMatrix m)
multiply in class IntegerTridiagonalMatrixm - an integer matrixMatrixDimensionException - If the matrices are different sizes.public IntegerSquareMatrix multiply(IntegerSquareMatrix m)
multiply in class IntegerTridiagonalMatrixm - an integer square matrixMatrixDimensionException - If the matrices are different sizes.public IntegerSquareMatrix multiply(IntegerTridiagonalMatrix m)
multiply in class IntegerTridiagonalMatrixm - an integer tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public IntegerDiagonalMatrix multiply(IntegerDiagonalMatrix m)
m - an integer diagonal matrixMatrixDimensionException - If the matrices are different sizes.public Matrix transpose()
transpose in class IntegerTridiagonalMatrixpublic DoubleSquareMatrix[] luDecompose(int[] pivot)
luDecompose in class IntegerTridiagonalMatrixpivot - 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 IntegerTridiagonalMatrix