Package org.flag4j.core
Interface MatrixPropertiesMixin
- Type Parameters:
T
- Matrix type.U
- Dense Matrix type.V
- Sparse Matrix type.W
- Complex Matrix type.Y
- Real Matrix type.X
- Matrix entry type.
- All Known Subinterfaces:
MatrixMixin<T,
U, V, W, VV, X, TT, UU>
- All Known Implementing Classes:
CMatrix
,CooCMatrix
,CooMatrix
,CsrCMatrix
,CsrMatrix
,Matrix
public interface MatrixPropertiesMixin
This interface specifies methods which provide properties of a matrix. All matrices should implement this interface.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
isDiag()
Checks if this matrix is diagonal.boolean
Checks if a matrix has full rank.default boolean
Checks if a matrix is invertible.
Also seeisSingular()
.boolean
Checks if a matrix is singular.boolean
isSquare()
Checks if this matrix is square.default boolean
isTri()
Checks if this matrix is triangular (i.e.boolean
isTriL()
Checks if this matrix is lower triangular.boolean
isTriU()
Checks if this matrix is upper triangular.boolean
isVector()
Checks if a matrix can be represented as a vector.int
Computes the rank of this matrix (i.e.int
Checks what type of vector this matrix is.
-
Method Details
-
isSquare
boolean isSquare()Checks if this matrix is square.- Returns:
- True if the matrix is square (i.e. the number of rows equals the number of columns). Otherwise, returns false.
-
isVector
boolean isVector()Checks if a matrix can be represented as a vector. That is, if a matrix has only one row or one column.- Returns:
- True if this matrix can be represented as either a row or column vector.
-
vectorType
int vectorType()Checks what type of vector this matrix is. i.e. not a vector, a 1x1 matrix, a row vector, or a column vector.- Returns:
- - If this matrix can not be represented as a vector, then returns -1.
- If this matrix is a 1x1 matrix, then returns 0.
- If this matrix is a row vector, then returns 1.
- If this matrix is a column vector, then returns 2.
-
isTri
default boolean isTri()Checks if this matrix is triangular (i.e. upper triangular, diagonal, lower triangular).- Returns:
- True is this matrix is triangular. Otherwise, returns false.
-
isTriL
boolean isTriL()Checks if this matrix is lower triangular.- Returns:
- True is this matrix is lower triangular. Otherwise, returns false.
-
isTriU
boolean isTriU()Checks if this matrix is upper triangular.- Returns:
- True is this matrix is upper triangular. Otherwise, returns false.
-
isDiag
default boolean isDiag()Checks if this matrix is diagonal.- Returns:
- True is this matrix is diagonal. Otherwise, returns false.
-
isFullRank
boolean isFullRank()Checks if a matrix has full rank. That is, if a matrices rank is equal to the number of rows in the matrix.- Returns:
- True if this matrix has full rank. Otherwise, returns false.
-
isSingular
boolean isSingular()Checks if a matrix is singular. That is, if the matrix is NOT invertible.
Also seeisInvertible()
.- Returns:
- True if this matrix is singular. Otherwise, returns false.
-
isInvertible
default boolean isInvertible()Checks if a matrix is invertible.
Also seeisSingular()
.- Returns:
- True if this matrix is invertible.
-
matrixRank
int matrixRank()Computes the rank of this matrix (i.e. the dimension of the column space of this matrix). Note that here, rank is NOT the same as a tensor rank.- Returns:
- The matrix rank of this matrix.
-