public class DoubleSquareMatrix extends DoubleMatrix
| Modifier and Type | Field and Description |
|---|---|
protected DoubleSquareMatrix[] |
LU |
protected int[] |
LUpivot |
ARRAY_2D, matrixCLASS_SPECIFIC, numCols, numRows, storageFormat| Modifier | Constructor and Description |
|---|---|
|
DoubleSquareMatrix(double[][] array)
Constructs a matrix by wrapping an array.
|
|
DoubleSquareMatrix(DoubleVector[] array)
Constructs a matrix from an array of vectors (columns).
|
|
DoubleSquareMatrix(int size)
Constructs an empty matrix.
|
protected |
DoubleSquareMatrix(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.
|
DoubleSquareMatrix[] |
choleskyDecompose()
Returns the Cholesky decomposition of this matrix.
|
double |
det()
Returns the determinant.
|
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.
|
DoubleSquareMatrix |
multiply(DoubleSquareMatrix 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.
|
DoubleSquareMatrix[] |
polarDecompose()
Returns the polar decomposition of this matrix.
|
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.
|
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.
|
double |
trace()
Returns the trace.
|
Matrix |
transpose()
Returns the transpose of this matrix.
|
add, directSum, equals, finalize, frobeniusNorm, getElement, hashCode, infNorm, multiply, multiply, negate, scalarDivide, scalarDivide, scalarMultiply, setElement, subtract, tensorProduct, toComplexMatrix, toIntegerMatrix, toStringcolumns, getInvalidElementMsg, rowsprotected transient DoubleSquareMatrix[] LU
protected transient int[] LUpivot
protected DoubleSquareMatrix(int size,
int storeID)
public DoubleSquareMatrix(int size)
size - the number of rows/columns.public DoubleSquareMatrix(double[][] array)
array - an assigned value.MatrixDimensionException - If the array is not square.public DoubleSquareMatrix(DoubleVector[] array)
array - an assigned value.public boolean isSymmetric()
public boolean isUnitary()
public double det()
public double trace()
public double operatorNorm()
throws MaximumIterationsExceededException
MaximumIterationsExceededException - If it takes more than 50 iterations to determine an eigenvalue.public DoubleMatrix add(DoubleMatrix m)
add in class DoubleMatrixm - a double matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix add(DoubleSquareMatrix m)
m - a double square matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleMatrix subtract(DoubleMatrix m)
subtract in class DoubleMatrixm - a double matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleSquareMatrix subtract(DoubleSquareMatrix m)
m - a double square matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleMatrix scalarMultiply(double x)
scalarMultiply in class DoubleMatrixx - a double.public double scalarProduct(DoubleMatrix m)
scalarProduct in class DoubleMatrixm - a double matrix.MatrixDimensionException - If the matrices are different sizes.public double scalarProduct(DoubleSquareMatrix m)
m - a double square matrix.MatrixDimensionException - If the matrices are different sizes.public DoubleVector multiply(DoubleVector v)
multiply in class DoubleMatrixv - a double vector.DimensionException - If the matrix and vector are incompatible.public DoubleSquareMatrix multiply(DoubleSquareMatrix m)
m - a double square matrix.MatrixDimensionException - If the matrices are incompatible.public Matrix transpose()
transpose in class DoubleMatrixpublic DoubleSquareMatrix inverse()
public DoubleSquareMatrix[] luDecompose(int[] pivot)
pivot - 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()
public DoubleSquareMatrix[] singularValueDecompose()
public DoubleSquareMatrix[] polarDecompose()
public DoubleMatrix mapElements(Mapping f)
mapElements in class DoubleMatrixf - a user-defined function.