public class DoubleTridiagonalMatrix extends DoubleSquareMatrix
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
diag |
protected double[] |
ldiag
Tridiagonal data.
|
protected static int |
TRIDIAGONAL
Storage format identifier.
|
protected double[] |
udiag |
LU, LUpivotARRAY_2D, matrixCLASS_SPECIFIC, numCols, numRows, storageFormat| Modifier | Constructor and Description |
|---|---|
|
DoubleTridiagonalMatrix(double[][] array)
Constructs a matrix from an array.
|
|
DoubleTridiagonalMatrix(int size)
Constructs an empty matrix.
|
protected |
DoubleTridiagonalMatrix(int size,
int storeID)
Constructs a matrix.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
equals(java.lang.Object m)
Compares two double tridiagonal matrices for equality.
|
double |
frobeniusNorm()
Returns the Frobenius (l2) norm.
|
double |
getElement(int i,
int j)
Returns an element of the matrix.
|
double |
infNorm()
Returns the l
-norm. |
boolean |
isSymmetric()
Returns true if this matrix is symmetric.
|
DoubleSquareMatrix[] |
luDecompose(int[] pivot)
Returns the LU decomposition of this matrix.
|
DoubleMatrix |
mapElements(Mapping f)
Applies a function on all the matrix elements.
|
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(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.
|
DoubleMatrix |
subtract(DoubleMatrix m)
Returns the subtraction of this matrix and another.
|
DoubleSquareMatrix |
subtract(DoubleSquareMatrix m)
Returns the subtraction of this matrix by 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.
|
java.lang.String |
toString()
Returns a string representing this matrix.
|
double |
trace()
Returns the trace.
|
Matrix |
transpose()
Returns the transpose of this matrix.
|
det, inverse, isUnitary, polarDecomposeadd, directSum, finalize, hashCode, multiply, negate, scalarDivide, scalarDivide, scalarMultiply, subtract, tensorProductcolumns, getInvalidElementMsg, rowsprotected static final int TRIDIAGONAL
protected double[] ldiag
protected double[] diag
protected double[] udiag
protected DoubleTridiagonalMatrix(int size,
int storeID)
public DoubleTridiagonalMatrix(int size)
size - the number of rows/columnspublic DoubleTridiagonalMatrix(double[][] array)
array - an assigned valueMatrixDimensionException - If the array is not square.public boolean equals(java.lang.Object m)
equals in class DoubleMatrixm - a double tridiagonal matrixpublic java.lang.String toString()
toString in class DoubleMatrixpublic IntegerMatrix toIntegerMatrix()
toIntegerMatrix in class DoubleMatrixpublic ComplexMatrix toComplexMatrix()
toComplexMatrix in class DoubleMatrixpublic double getElement(int i,
int j)
getElement in class DoubleMatrixi - row index of the element.j - column index of the element.MatrixDimensionException - If attempting to access an invalid element.public void setElement(int i,
int j,
double x)
setElement in class DoubleMatrixi - row index of the element.j - column index of the element.x - a number.MatrixDimensionException - If attempting to access an invalid element.public boolean isSymmetric()
isSymmetric in class DoubleSquareMatrixpublic double trace()
trace in class DoubleSquareMatrixpublic double infNorm()
-norm.infNorm in class DoubleMatrixpublic double frobeniusNorm()
frobeniusNorm in class DoubleMatrixpublic double operatorNorm()
throws MaximumIterationsExceededException
operatorNorm in class DoubleSquareMatrixMaximumIterationsExceededException - If it takes more than 50 iterations to determine an eigenvalue.public DoubleMatrix add(DoubleMatrix m)
add in class DoubleSquareMatrixm - a double matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix add(DoubleSquareMatrix m)
add in class DoubleSquareMatrixm - a double square matrixMatrixDimensionException - If the matrices are different sizes.public DoubleTridiagonalMatrix add(DoubleTridiagonalMatrix m)
m - a double tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleMatrix subtract(DoubleMatrix m)
subtract in class DoubleSquareMatrixm - a double matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
subtract in class DoubleSquareMatrixm - a double square matrixMatrixDimensionException - If the matrices are different sizes.public DoubleTridiagonalMatrix subtract(DoubleTridiagonalMatrix m)
m - a double tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public DoubleMatrix scalarMultiply(double x)
scalarMultiply in class DoubleSquareMatrixx - a double.public double scalarProduct(DoubleMatrix m)
scalarProduct in class DoubleSquareMatrixm - a double matrix.MatrixDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleSquareMatrix m)
scalarProduct in class DoubleSquareMatrixm - a double square matrix.MatrixDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleTridiagonalMatrix m)
m - a double tridiagonal matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleVector multiply(DoubleVector v)
multiply in class DoubleSquareMatrixv - a double vector.DimensionException - If the matrix and vector are incompatible.public DoubleMatrix multiply(DoubleMatrix m)
multiply in class DoubleMatrixm - a double matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix multiply(DoubleSquareMatrix m)
multiply in class DoubleSquareMatrixm - a double square matrixMatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix multiply(DoubleTridiagonalMatrix m)
m - a double tridiagonal matrixMatrixDimensionException - If the matrices are different sizes.public Matrix transpose()
transpose in class DoubleSquareMatrixpublic DoubleSquareMatrix[] luDecompose(int[] pivot)
luDecompose in class DoubleSquareMatrixpivot - 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 DoubleSquareMatrixpublic DoubleSquareMatrix[] singularValueDecompose()
singularValueDecompose in class DoubleSquareMatrixpublic DoubleMatrix mapElements(Mapping f)
mapElements in class DoubleSquareMatrixf - a user-defined function