Interface AnyMatrix
-
- All Known Subinterfaces:
FieldMatrix<T>,RealMatrix,SparseRealMatrix
- All Known Implementing Classes:
AbstractFieldMatrix,AbstractRealMatrix,Array2DRowFieldMatrix,Array2DRowRealMatrix,BlockFieldMatrix,BlockRealMatrix,DiagonalMatrix,FieldDenseMatrix,OpenMapRealMatrix,SparseFieldMatrix
public interface AnyMatrix
Interface defining very basic matrix operations.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancanAdd(AnyMatrix other)Checks that this matrix and theothermatrix can be added.default booleancanMultiply(AnyMatrix other)Checks that this matrix can be multiplied by theothermatrix.default voidcheckAdd(AnyMatrix other)Checks that this matrix and theothermatrix can be added.default voidcheckMultiply(AnyMatrix other)Checks that this matrix can be multiplied by theothermatrix.intgetColumnDimension()Gets the number of columns.intgetRowDimension()Gets the number of rows.default booleanisSquare()Indicates whether this is a square matrix.
-
-
-
Method Detail
-
isSquare
default boolean isSquare()
Indicates whether this is a square matrix.- Returns:
trueif the number of rows is the same as the number of columns.
-
getRowDimension
int getRowDimension()
Gets the number of rows.- Returns:
- the number of rows.
-
getColumnDimension
int getColumnDimension()
Gets the number of columns.- Returns:
- the number of columns.
-
canAdd
default boolean canAdd(AnyMatrix other)
Checks that this matrix and theothermatrix can be added.- Parameters:
other- Matrix to be added.- Returns:
falseif the dimensions do not match.
-
checkAdd
default void checkAdd(AnyMatrix other)
Checks that this matrix and theothermatrix can be added.- Parameters:
other- Matrix to check.- Throws:
IllegalArgumentException- if the dimensions do not match.
-
canMultiply
default boolean canMultiply(AnyMatrix other)
Checks that this matrix can be multiplied by theothermatrix.- Parameters:
other- Matrix to be added.- Returns:
falseif the dimensions do not match.
-
checkMultiply
default void checkMultiply(AnyMatrix other)
Checks that this matrix can be multiplied by theothermatrix.- Parameters:
other- Matrix to check.- Throws:
IllegalArgumentException- if the dimensions do not match.
-
-