Interface AnyMatrix

    • 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 the other 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 the other 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 the other 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 the other matrix.
        Parameters:
        other - Matrix to check.
        Throws:
        IllegalArgumentException - if the dimensions do not match.