public class ComplexTridiagonalMatrix extends ComplexSquareMatrix
Modifier and Type | Field and Description |
---|---|
protected double[] |
diagIm |
protected double[] |
diagRe |
protected double[] |
ldiagIm
Tridiagonal data.
|
protected double[] |
ldiagRe
Tridiagonal data.
|
protected static int |
TRIDIAGONAL
Storage format identifier.
|
protected double[] |
udiagIm |
protected double[] |
udiagRe |
LU, LUpivot
ARRAY_2D, matrixIm, matrixRe
CLASS_SPECIFIC, numCols, numRows, storageFormat
Modifier | Constructor and Description |
---|---|
|
ComplexTridiagonalMatrix(Complex[][] array)
Constructs a matrix from an array.
|
|
ComplexTridiagonalMatrix(int size)
Constructs an empty matrix.
|
protected |
ComplexTridiagonalMatrix(int size,
int storeID)
Constructs a matrix.
|
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
equals(java.lang.Object m)
Compares two complex tridiagonal 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.
|
DoubleMatrix |
imag()
Returns the imaginary part of this complex matrix.
|
double |
infNorm()
Returns the l
![]() |
ComplexSquareMatrix[] |
luDecompose(int[] pivot)
Returns the LU decomposition of this matrix.
|
ComplexMatrix |
mapElements(ComplexMapping f)
Applies a function on all the matrix elements.
|
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.
|
ComplexMatrix |
subtract(ComplexMatrix m)
Returns the subtraction of this matrix and another.
|
ComplexSquareMatrix |
subtract(ComplexSquareMatrix m)
Returns the subtraction of this matrix by another.
|
ComplexTridiagonalMatrix |
subtract(ComplexTridiagonalMatrix m)
Returns the subtraction of this matrix and another.
|
java.lang.String |
toString()
Returns a string representing this matrix.
|
Complex |
trace()
Returns the trace.
|
Matrix |
transpose()
Returns the transpose of this matrix.
|
det, inverse, involution, isHermitian, isUnitary, norm, polarDecompose
add, directSum, finalize, hashCode, multiply, negate, scalarDivide, scalarDivide, scalarDivide, scalarMultiply, subtract, tensorProduct
columns, getInvalidElementMsg, rows
multiply
scalarDivide
scalarMultiply
protected static final int TRIDIAGONAL
protected double[] ldiagRe
protected double[] ldiagIm
protected double[] diagRe
protected double[] diagIm
protected double[] udiagRe
protected double[] udiagIm
protected ComplexTridiagonalMatrix(int size, int storeID)
public ComplexTridiagonalMatrix(int size)
size
- the number of rows/columnspublic ComplexTridiagonalMatrix(Complex[][] array)
array
- an assigned valueMatrixDimensionException
- If the array is not square.public boolean equals(java.lang.Object m)
equals
in class ComplexMatrix
m
- a complex tridiagonal matrixpublic java.lang.String toString()
toString
in class ComplexMatrix
public DoubleMatrix real()
real
in class ComplexMatrix
public DoubleMatrix imag()
imag
in class ComplexMatrix
public Complex getElement(int i, int j)
getElement
in class ComplexMatrix
i
- 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 ComplexMatrix
i
- 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 ComplexMatrix
i
- 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 Complex trace()
trace
in class ComplexSquareMatrix
public double infNorm()
infNorm
in class ComplexMatrix
public double frobeniusNorm()
frobeniusNorm
in class ComplexMatrix
public double operatorNorm() throws MaximumIterationsExceededException
operatorNorm
in class ComplexSquareMatrix
MaximumIterationsExceededException
- If it takes more than 50 iterations to determine an eigenvalue.public ComplexMatrix add(ComplexMatrix m)
add
in class ComplexSquareMatrix
m
- a complex matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexSquareMatrix add(ComplexSquareMatrix m)
add
in class ComplexSquareMatrix
m
- a complex square matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexTridiagonalMatrix add(ComplexTridiagonalMatrix m)
m
- a complex tridiagonal matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexMatrix subtract(ComplexMatrix m)
subtract
in class ComplexSquareMatrix
m
- a complex matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexSquareMatrix subtract(ComplexSquareMatrix m)
subtract
in class ComplexSquareMatrix
m
- a complex square matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexTridiagonalMatrix subtract(ComplexTridiagonalMatrix m)
m
- a complex tridiagonal matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexMatrix scalarMultiply(Complex z)
scalarMultiply
in class ComplexSquareMatrix
z
- a complex numberpublic ComplexMatrix scalarMultiply(double x)
scalarMultiply
in class ComplexSquareMatrix
x
- a doublepublic ComplexVector multiply(ComplexVector v)
multiply
in class ComplexSquareMatrix
v
- a complex vectorDimensionException
- If the matrix and vector are incompatible.public ComplexMatrix multiply(ComplexMatrix m)
multiply
in class ComplexMatrix
m
- a complex matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexSquareMatrix multiply(ComplexSquareMatrix m)
multiply
in class ComplexSquareMatrix
m
- a complex square matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexSquareMatrix multiply(ComplexTridiagonalMatrix m)
m
- a complex tridiagonal matrixMatrixDimensionException
- If the matrices are different sizes.public ComplexMatrix hermitianAdjoint()
hermitianAdjoint
in class ComplexSquareMatrix
public ComplexMatrix conjugate()
conjugate
in class ComplexSquareMatrix
public Matrix transpose()
transpose
in class ComplexSquareMatrix
public ComplexSquareMatrix[] luDecompose(int[] pivot)
luDecompose
in class ComplexSquareMatrix
public ComplexMatrix mapElements(ComplexMapping f)
mapElements
in class ComplexSquareMatrix
f
- a user-defined function