public final class ComplexDiagonalMatrix extends ComplexTridiagonalMatrix
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DIAGONAL
Storage format identifier.
|
diagIm, diagRe, ldiagIm, ldiagRe, TRIDIAGONAL, udiagIm, udiagReLU, LUpivotARRAY_2D, matrixIm, matrixReCLASS_SPECIFIC, numCols, numRows, storageFormat| Modifier | Constructor and Description |
|---|---|
|
ComplexDiagonalMatrix(Complex[] array)
Constructs a matrix from an array containing the diagonal elements.
|
|
ComplexDiagonalMatrix(Complex[][] array)
Constructs a matrix from an array.
|
|
ComplexDiagonalMatrix(double[] arrayRe,
double[] arrayIm)
Constructs a matrix by wrapping two arrays containing the diagonal elements.
|
|
ComplexDiagonalMatrix(int size)
Constructs an empty matrix.
|
protected |
ComplexDiagonalMatrix(int size,
int storeID)
Constructs a matrix.
|
| Modifier and Type | Method and Description |
|---|---|
ComplexDiagonalMatrix |
add(ComplexDiagonalMatrix m)
Returns the addition of this matrix and another.
|
ComplexMatrix |
add(ComplexMatrix m)
Returns the addition of this matrix and another.
|
ComplexSquareMatrix |
add(ComplexSquareMatrix m)
Returns the addition of this matrix and another.
|
ComplexTridiagonalMatrix |
add(ComplexTridiagonalMatrix m)
Returns the addition of this matrix and another.
|
ComplexMatrix |
conjugate()
Returns the complex conjugate of this matrix.
|
Complex |
det()
Returns the determinant.
|
boolean |
equals(java.lang.Object m)
Compares two complex diagonal matrices for equality.
|
double |
frobeniusNorm()
Returns the Frobenius (l2) norm.
|
Complex |
getElement(int i,
int j)
Returns an element of the matrix.
|
ComplexMatrix |
hermitianAdjoint()
Returns the hermitian adjoint of this matrix.
|
static ComplexDiagonalMatrix |
identity(int size)
Creates an identity matrix.
|
DoubleMatrix |
imag()
Returns the imaginary part of this complex matrix.
|
double |
infNorm()
Returns the l
-norm. |
ComplexSquareMatrix |
inverse()
Returns the inverse of this matrix.
|
boolean |
isHermitian()
Returns true if this matrix is hermitian.
|
boolean |
isUnitary()
Returns true if this matrix is unitary.
|
ComplexSquareMatrix[] |
luDecompose(int[] pivot)
Returns the LU decomposition of this matrix.
|
ComplexMatrix |
mapElements(ComplexMapping f)
Applies a function on all the matrix elements.
|
ComplexDiagonalMatrix |
multiply(ComplexDiagonalMatrix m)
Returns the multiplication of this matrix and another.
|
ComplexMatrix |
multiply(ComplexMatrix m)
Returns the multiplication of this matrix and another.
|
ComplexSquareMatrix |
multiply(ComplexSquareMatrix m)
Returns the multiplication of this matrix and another.
|
ComplexSquareMatrix |
multiply(ComplexTridiagonalMatrix m)
Returns the multiplication of this matrix and another.
|
ComplexVector |
multiply(ComplexVector v)
Returns the multiplication of a vector by this matrix.
|
double |
operatorNorm()
Returns the operator norm.
|
DoubleMatrix |
real()
Returns the real part of this complex matrix.
|
ComplexMatrix |
scalarMultiply(Complex z)
Returns the multiplication of this matrix by a scalar.
|
ComplexMatrix |
scalarMultiply(double x)
Returns the multiplication of this matrix by a scalar.
|
void |
setElement(int i,
int j,
Complex z)
Sets the value of an element of the matrix.
|
void |
setElement(int i,
int j,
double x,
double y)
Sets the value of an element of the matrix.
|
ComplexDiagonalMatrix |
subtract(ComplexDiagonalMatrix m)
Returns the subtraction of this matrix by another.
|
ComplexMatrix |
subtract(ComplexMatrix m)
Returns the subtraction of this matrix by another.
|
ComplexSquareMatrix |
subtract(ComplexSquareMatrix m)
Returns the subtraction of this matrix by another.
|
ComplexTridiagonalMatrix |
subtract(ComplexTridiagonalMatrix m)
Returns the subtraction of this matrix by another.
|
Complex |
trace()
Returns the trace.
|
Matrix |
transpose()
Returns the transpose of this matrix.
|
toStringinvolution, norm, polarDecomposeadd, directSum, finalize, hashCode, multiply, negate, scalarDivide, scalarDivide, scalarDivide, scalarMultiply, subtract, tensorProductcolumns, getInvalidElementMsg, rowsmultiplyscalarDividescalarMultiplyprotected static final int DIAGONAL
protected ComplexDiagonalMatrix(int size,
int storeID)
public ComplexDiagonalMatrix(int size)
size - the number of rows/columnspublic ComplexDiagonalMatrix(Complex[][] array)
array - an assigned valueMatrixDimensionException - If the array is not square.public ComplexDiagonalMatrix(double[] arrayRe,
double[] arrayIm)
arrayRe - an array of real valuesarrayIm - an array of imaginary valuespublic ComplexDiagonalMatrix(Complex[] array)
array - an assigned valuepublic static ComplexDiagonalMatrix identity(int size)
size - the number of rows/columnspublic boolean equals(java.lang.Object m)
equals in class ComplexTridiagonalMatrixm - a complex diagonal matrixpublic DoubleMatrix real()
real in class ComplexTridiagonalMatrixpublic DoubleMatrix imag()
imag in class ComplexTridiagonalMatrixpublic Complex getElement(int i, int j)
getElement in class ComplexTridiagonalMatrixi - row index of the elementj - column index of the elementMatrixDimensionException - If attempting to access an invalid element.public void setElement(int i,
int j,
Complex z)
setElement in class ComplexTridiagonalMatrixi - row index of the elementj - column index of the elementz - a complex numberMatrixDimensionException - If attempting to access an invalid element.public void setElement(int i,
int j,
double x,
double y)
setElement in class ComplexTridiagonalMatrixi - row index of the elementj - column index of the elementx - the real part of a complex numbery - the imaginary part of a complex numberMatrixDimensionException - If attempting to access an invalid element.public boolean isHermitian()
isHermitian in class ComplexSquareMatrixpublic boolean isUnitary()
isUnitary in class ComplexSquareMatrixpublic Complex det()
det in class ComplexSquareMatrixpublic Complex trace()
trace in class ComplexTridiagonalMatrixpublic double infNorm()
-norm.infNorm in class ComplexTridiagonalMatrixpublic double frobeniusNorm()
frobeniusNorm in class ComplexTridiagonalMatrixpublic double operatorNorm()
operatorNorm in class ComplexTridiagonalMatrixpublic ComplexMatrix add(ComplexMatrix m)
add in class ComplexTridiagonalMatrixm - a complex matrixMatrixDimensionException - If the matrices are different sizes.public ComplexSquareMatrix add(ComplexSquareMatrix m)
add in class ComplexTridiagonalMatrixm - a complex square matrixMatrixDimensionException - If the matrices are different sizes.public ComplexTridiagonalMatrix add(ComplexTridiagonalMatrix m)
add in class ComplexTridiagonalMatrixm - a complex tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public ComplexDiagonalMatrix add(ComplexDiagonalMatrix m)
m - a complex diagonal matrixMatrixDimensionException - If the matrices are different sizes.public ComplexMatrix subtract(ComplexMatrix m)
subtract in class ComplexTridiagonalMatrixm - a complex matrixMatrixDimensionException - If the matrices are different sizes.public ComplexSquareMatrix subtract(ComplexSquareMatrix m)
subtract in class ComplexTridiagonalMatrixm - a complex square matrixMatrixDimensionException - If the matrices are different sizes.public ComplexTridiagonalMatrix subtract(ComplexTridiagonalMatrix m)
subtract in class ComplexTridiagonalMatrixm - a complex tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public ComplexDiagonalMatrix subtract(ComplexDiagonalMatrix m)
m - a complex diagonal matrixMatrixDimensionException - If the matrices are different sizes.public ComplexMatrix scalarMultiply(Complex z)
scalarMultiply in class ComplexTridiagonalMatrixz - a complex numberpublic ComplexMatrix scalarMultiply(double x)
scalarMultiply in class ComplexTridiagonalMatrixx - a doublepublic ComplexVector multiply(ComplexVector v)
multiply in class ComplexTridiagonalMatrixv - a complex vectorDimensionException - If the matrix and vector are incompatible.public ComplexMatrix multiply(ComplexMatrix m)
multiply in class ComplexTridiagonalMatrixm - a complex matrixMatrixDimensionException - If the matrices are different sizes.public ComplexSquareMatrix multiply(ComplexSquareMatrix m)
multiply in class ComplexTridiagonalMatrixm - a complex square matrixMatrixDimensionException - If the matrices are different sizes.public ComplexSquareMatrix multiply(ComplexTridiagonalMatrix m)
multiply in class ComplexTridiagonalMatrixm - a complex tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public ComplexDiagonalMatrix multiply(ComplexDiagonalMatrix m)
m - a complex diagonal matrixMatrixDimensionException - If the matrices are different sizes.public ComplexSquareMatrix inverse()
inverse in class ComplexSquareMatrixpublic ComplexMatrix hermitianAdjoint()
hermitianAdjoint in class ComplexTridiagonalMatrixpublic ComplexMatrix conjugate()
conjugate in class ComplexTridiagonalMatrixpublic Matrix transpose()
transpose in class ComplexTridiagonalMatrixpublic ComplexSquareMatrix[] luDecompose(int[] pivot)
luDecompose in class ComplexTridiagonalMatrixpublic ComplexMatrix mapElements(ComplexMapping f)
mapElements in class ComplexTridiagonalMatrixf - a user-defined function