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 boolean
canAdd(AnyMatrix other)
Checks that this matrix and theother
matrix can be added.default boolean
canMultiply(AnyMatrix other)
Checks that this matrix can be multiplied by theother
matrix.default void
checkAdd(AnyMatrix other)
Checks that this matrix and theother
matrix can be added.default void
checkMultiply(AnyMatrix other)
Checks that this matrix can be multiplied by theother
matrix.int
getColumnDimension()
Gets the number of columns.int
getRowDimension()
Gets the number of rows.default boolean
isSquare()
Indicates whether this is a square matrix.
-
-
-
Method Detail
-
isSquare
default boolean isSquare()
Indicates whether this is a square matrix.- Returns:
true
if 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 theother
matrix can be added.- Parameters:
other
- Matrix to be added.- Returns:
false
if the dimensions do not match.
-
checkAdd
default void checkAdd(AnyMatrix other)
Checks that this matrix and theother
matrix 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 theother
matrix.- Parameters:
other
- Matrix to be added.- Returns:
false
if the dimensions do not match.
-
checkMultiply
default void checkMultiply(AnyMatrix other)
Checks that this matrix can be multiplied by theother
matrix.- Parameters:
other
- Matrix to check.- Throws:
IllegalArgumentException
- if the dimensions do not match.
-
-