src/main/java/com/osiris/maths/human/Matrix.java
/**
     * @return a new matrix containing the result.
     */
@return a new matrix containing the result.
@return a new matrix containing the result .
public Matrix subtract(Matrix m) throws NotEqual {
        if (rowsCount != m.rowsCount || columnsCount != m.columnsCount)
            throw new NotEqual(this, m);
        Matrix newM = new Matrix(m.rowsCount, m.columnsCount);
        for (int i = 0; i < m.rows.size(); i++) {
            List<Double> row = rows.get(i);
            List<Double> otherRow = m.rows.get(i);
            List<Double> newRow = new ArrayList<>(row.size());
            newM.setRow(i, newRow);
            for (int j = 0; j < row.size(); j++) {
                newRow.add(row.get(j) - otherRow.get(j));
            }
        }
        return newM;
    }
public Matrix subtract ( Matrix m ) throws NotEqual { if ( rowsCount != m . rowsCount || columnsCount != m . columnsCount ) throw new NotEqual ( this , m ) ; Matrix newM = new Matrix ( m . rowsCount , m . columnsCount ) ; for ( int i = 0 ; i < m . rows . size ( ) ; i ++ ) { List < Double > row = rows . get ( i ) ; List < Double > otherRow = m . rows . get ( i ) ; List < Double > newRow = new ArrayList < > ( row . size ( ) ) ; newM . setRow ( i , newRow ) ; for ( int j = 0 ; j < row . size ( ) ; j ++ ) { newRow . add ( row . get ( j ) - otherRow . get ( j ) ) ; } } return newM ; }
@return a new matrix containing the result.
@return a new matrix containing the result .