jsci.maths.matrices
Class AbstractIntegerSquareMatrix
- java.lang.Object
-
- jsci.maths.matrices.Matrix
-
- jsci.maths.matrices.AbstractIntegerMatrix
-
- jsci.maths.matrices.AbstractIntegerSquareMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, Algebra.Member, Module.Member, VectorSpace.Member, Ring.Member, AbelianGroup.Member, SquareMatrix, Member
- Direct Known Subclasses:
- IntegerDiagonalMatrix, IntegerSquareMatrix, IntegerTridiagonalMatrix
public abstract class AbstractIntegerSquareMatrix extends AbstractIntegerMatrix implements SquareMatrix
The AbstractIntegerSquareMatrix class provides an object for encapsulating integer square matrices.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AbstractIntegerMatrixadd(AbstractIntegerMatrix m)Returns the addition of this matrix and another.AbstractIntegerSquareMatrixadd(AbstractIntegerSquareMatrix m)Returns the addition of this matrix and another.AbstractDoubleSquareMatrix[]choleskyDecompose()Returns the Cholesky decomposition of this matrix.intdet()Returns the determinant.AbstractIntegerSquareMatrixdirectSum(AbstractIntegerSquareMatrix m)Returns the direct sum of this matrix and another.AbstractDoubleSquareMatrixinverse()Returns the inverse of this matrix.booleanisSymmetric()Returns true if this matrix is symmetric.booleanisUnitary()Returns true if this matrix is unitary.AbstractDoubleSquareMatrix[]luDecompose()Returns the LU decomposition of this matrix.AbstractDoubleSquareMatrix[]luDecompose(int[] pivot)Returns the LU decomposition of this matrix.AbstractIntegerSquareMatrixmultiply(AbstractIntegerSquareMatrix m)Returns the multiplication of this matrix and another.AbelianGroup.Membernegate()Returns the negative of this matrix.AbstractDoubleSquareMatrix[]qrDecompose()Returns the QR decomposition of this matrix.AbstractIntegerMatrixscalarMultiply(int x)Returns the multiplication of this matrix by a scalar.intscalarProduct(AbstractIntegerMatrix m)Returns the scalar product of this matrix and another.intscalarProduct(AbstractIntegerSquareMatrix m)Returns the scalar product of this matrix and another.AbstractDoubleSquareMatrix[]singularValueDecompose()Returns the singular value decomposition of this matrix.AbstractIntegerMatrixsubtract(AbstractIntegerMatrix m)Returns the subtraction of this matrix and another.AbstractIntegerSquareMatrixsubtract(AbstractIntegerSquareMatrix m)Returns the subtraction of this matrix by another.AbstractIntegerSquareMatrixtensor(AbstractIntegerSquareMatrix m)Returns the tensor product of this matrix and another.AbstractComplexMatrixtoComplexMatrix()Converts this matrix to a complex matrix.AbstractDoubleMatrixtoDoubleMatrix()Converts this matrix to a double matrix.inttrace()Returns the trace.Matrixtranspose()Returns the transpose of this matrix.-
Methods inherited from class jsci.maths.matrices.AbstractIntegerMatrix
add, directSum, equals, equals, equals, frobeniusNorm, getElement, getSet, hashCode, infNorm, multiply, multiply, multiply, scalarDivide, scalarMultiply, setElement, subtract, tensor, toString
-
-
-
-
Method Detail
-
toDoubleMatrix
public AbstractDoubleMatrix toDoubleMatrix()
Converts this matrix to a double matrix.- Overrides:
toDoubleMatrixin classAbstractIntegerMatrix- Returns:
- a double square matrix
-
toComplexMatrix
public AbstractComplexMatrix toComplexMatrix()
Converts this matrix to a complex matrix.- Overrides:
toComplexMatrixin classAbstractIntegerMatrix- Returns:
- a complex square matrix
-
isSymmetric
public boolean isSymmetric()
Returns true if this matrix is symmetric.
-
isUnitary
public boolean isUnitary()
Returns true if this matrix is unitary.
-
det
public int det()
Returns the determinant.
-
trace
public int trace()
Returns the trace.
-
negate
public AbelianGroup.Member negate()
Returns the negative of this matrix.- Specified by:
negatein interfaceAbelianGroup.Member- Overrides:
negatein classAbstractIntegerMatrix
-
add
public final AbstractIntegerMatrix add(AbstractIntegerMatrix m)
Returns the addition of this matrix and another.- Overrides:
addin classAbstractIntegerMatrix- Parameters:
m- a int square matrix- Throws:
MatrixDimensionException- If the matrices are not square or different sizes.
-
add
public AbstractIntegerSquareMatrix add(AbstractIntegerSquareMatrix m)
Returns the addition of this matrix and another.- Parameters:
m- a int square matrix- Throws:
MatrixDimensionException- If the matrices are different sizes.
-
subtract
public final AbstractIntegerMatrix subtract(AbstractIntegerMatrix m)
Returns the subtraction of this matrix and another.- Overrides:
subtractin classAbstractIntegerMatrix- Parameters:
m- a int square matrix- Throws:
MatrixDimensionException- If the matrices are not square or different sizes.
-
subtract
public AbstractIntegerSquareMatrix subtract(AbstractIntegerSquareMatrix m)
Returns the subtraction of this matrix by another.- Parameters:
m- a int square matrix- Throws:
MatrixDimensionException- If the matrices are different sizes.
-
scalarMultiply
public AbstractIntegerMatrix scalarMultiply(int x)
Returns the multiplication of this matrix by a scalar.- Overrides:
scalarMultiplyin classAbstractIntegerMatrix- Parameters:
x- a int.- Returns:
- a int square matrix.
-
scalarProduct
public final int scalarProduct(AbstractIntegerMatrix m)
Returns the scalar product of this matrix and another.- Overrides:
scalarProductin classAbstractIntegerMatrix- Parameters:
m- a int square matrix.- Throws:
MatrixDimensionException- If the matrices are not square or different sizes.
-
scalarProduct
public int scalarProduct(AbstractIntegerSquareMatrix m)
Returns the scalar product of this matrix and another.- Parameters:
m- a int square matrix.- Throws:
MatrixDimensionException- If the matrices are different sizes.
-
multiply
public AbstractIntegerSquareMatrix multiply(AbstractIntegerSquareMatrix m)
Returns the multiplication of this matrix and another.- Parameters:
m- a int square matrix- Throws:
MatrixDimensionException- If the matrices are different sizes.
-
directSum
public AbstractIntegerSquareMatrix directSum(AbstractIntegerSquareMatrix m)
Returns the direct sum of this matrix and another.
-
tensor
public AbstractIntegerSquareMatrix tensor(AbstractIntegerSquareMatrix m)
Returns the tensor product of this matrix and another.
-
transpose
public Matrix transpose()
Returns the transpose of this matrix.- Overrides:
transposein classAbstractIntegerMatrix- Returns:
- a int square matrix
-
inverse
public AbstractDoubleSquareMatrix inverse()
Returns the inverse of this matrix.- Returns:
- a double square matrix.
-
luDecompose
public AbstractDoubleSquareMatrix[] luDecompose(int[] pivot)
Returns the LU decomposition of this matrix.- Parameters:
pivot- an empty array of lengthrows()+1to hold the pivot information (null if not interested). The last array element will contain the parity.- Returns:
- an array with [0] containing the L-matrix and [1] containing the U-matrix.
-
luDecompose
public AbstractDoubleSquareMatrix[] luDecompose()
Returns the LU decomposition of this matrix. Warning: no pivoting.- Returns:
- an array with [0] containing the L-matrix and [1] containing the U-matrix.
-
choleskyDecompose
public AbstractDoubleSquareMatrix[] choleskyDecompose()
Returns the Cholesky decomposition of this matrix. Matrix must be symmetric and positive definite.- Returns:
- an array with [0] containing the L-matrix and [1] containing the U-matrix.
-
qrDecompose
public AbstractDoubleSquareMatrix[] qrDecompose()
Returns the QR decomposition of this matrix. Based on the code from JAMA (public domain).- Returns:
- an array with [0] containing the Q-matrix and [1] containing the R-matrix.
-
singularValueDecompose
public AbstractDoubleSquareMatrix[] singularValueDecompose()
Returns the singular value decomposition of this matrix. Based on the code from JAMA (public domain).- Returns:
- an array with [0] containing the U-matrix, [1] containing the S-matrix and [2] containing the V-matrix.
-
-
DMelt 3.0 © DataMelt by jWork.ORG