src/utils/matrix/ComputableMatrix.java
public Matrix applyBi(Matrix other, Matrix result, Matrix.MatrixBinaryOperation matrixBinaryOperation) throws MatrixException {
        if (!isScalar() && !other.isScalar() && (getRows() != other.getRows() || getColumns() != other.getColumns())) {
            throw new MatrixException("Incompatible matrix sizes: " + getRows() + "x" + getColumns() + " by " + other.getRows() + "x" + other.getColumns());
        }
        if (!isScalar() && !result.isScalar() && (getRows() != result.getRows() || getColumns() != result.getColumns())) {
            throw new MatrixException("Incompatible result matrix sizes: " + result.getRows() + "x" + result.getColumns());
        }
        // Checks if there is need to broadcast or un-broadcast due to scalar matrix.
        int rows = !isScalar() ? getRows() : other.getRows();
        int columns = !isScalar() ? getColumns() : other.getColumns();
        return new BinaryMatrixOperation(rows, columns, matrixBinaryOperation).apply(this, other, result);
    }
/**
     * Applies two variable operation to this matrix and other matrix and stores operation result into result matrix.<br>
     * Example of operation can be subtraction of other matrix from this matrix or
     * multiplying current matrix with other matrix.<br>
     * Applies masking element wise if either matrix is masked.<br>
     *
     * @param other matrix which acts as second variable in the operation.
     * @param result matrix which stores operation result.
     * @param matrixBinaryOperation two variable operation defined as matrix binary operation.
     * @return matrix which stores operation result.
     * @throws MatrixException throws MatrixException if this, other and result matrix are not of equal dimensions.
     */
Applies two variable operation to this matrix and other matrix and stores operation result into result matrix.
Example of operation can be subtraction of other matrix from this matrix or
multiplying current matrix with other matrix.
Applies masking element wise if either matrix is masked.

@param other matrix which acts as second variable in the operation.
@param result matrix which stores operation result.
@param matrixBinaryOperation two variable operation defined as matrix binary operation.
@return matrix which stores operation result.
@throws MatrixException throws MatrixException if this, other and result matrix are not of equal dimensions.
Applies two variable operation to this matrix and other matrix and stores operation result into result matrix . Example of operation can be subtraction of other matrix from this matrix or multiplying current matrix with other matrix . Applies masking element wise if either matrix is masked . @param other matrix which acts as second variable in the operation . @param result matrix which stores operation result . @param matrixBinaryOperation two variable operation defined as matrix binary operation . @return matrix which stores operation result . @throws MatrixException throws MatrixException if this other and result matrix are not of equal dimensions .
public Matrix applyBi(Matrix other, Matrix result, Matrix.MatrixBinaryOperation matrixBinaryOperation) throws MatrixException {
        if (!isScalar() && !other.isScalar() && (getRows() != other.getRows() || getColumns() != other.getColumns())) {
            throw new MatrixException("Incompatible matrix sizes: " + getRows() + "x" + getColumns() + " by " + other.getRows() + "x" + other.getColumns());
        }
        if (!isScalar() && !result.isScalar() && (getRows() != result.getRows() || getColumns() != result.getColumns())) {
            throw new MatrixException("Incompatible result matrix sizes: " + result.getRows() + "x" + result.getColumns());
        }
        int rows = !isScalar() ? getRows() : other.getRows();
        int columns = !isScalar() ? getColumns() : other.getColumns();
        return new BinaryMatrixOperation(rows, columns, matrixBinaryOperation).apply(this, other, result);
    }
public Matrix applyBi ( Matrix other , Matrix result , Matrix . MatrixBinaryOperation matrixBinaryOperation ) throws MatrixException { if ( ! isScalar ( ) && ! other . isScalar ( ) && ( getRows ( ) != other . getRows ( ) || getColumns ( ) != other . getColumns ( ) ) ) { throw new MatrixException ( "Incompatible matrix sizes: " + getRows ( ) + "x" + getColumns ( ) + " by " + other . getRows ( ) + "x" + other . getColumns ( ) ) ; } if ( ! isScalar ( ) && ! result . isScalar ( ) && ( getRows ( ) != result . getRows ( ) || getColumns ( ) != result . getColumns ( ) ) ) { throw new MatrixException ( "Incompatible result matrix sizes: " + result . getRows ( ) + "x" + result . getColumns ( ) ) ; } int rows = ! isScalar ( ) ? getRows ( ) : other . getRows ( ) ; int columns = ! isScalar ( ) ? getColumns ( ) : other . getColumns ( ) ; return new BinaryMatrixOperation ( rows , columns , matrixBinaryOperation ) . apply ( this , other , result ) ; }
Applies two variable operation to this matrix and other matrix and stores operation result into result matrix.<br>
 Example of operation can be subtraction of other matrix from this matrix or
 multiplying current matrix with other matrix.<br>
 Applies masking element wise if either matrix is masked.<br>
Applies two variable operation to this matrix and other matrix and stores operation result into result matrix . <br > Example of operation can be subtraction of other matrix from this matrix or multiplying current matrix with other matrix . <br > Applies masking element wise if either matrix is masked . <br >
// Checks if there is need to broadcast or un-broadcast due to scalar matrix.
