public Matrix plus ( final Matrix B ) { final Matrix A = this ; if ( ( B . m_rows != A . m_rows ) || ( B . m_columns != A . m_columns ) ) { throw new GeometryException ( "Illegal matrix dimensions" ) ; } final Matrix C = new Matrix ( m_rows , m_columns ) ; for ( int i = 0 ; i < m_rows ; i ++ ) { for ( int j = 0 ; j < m_columns ; j ++ ) { C . m_data [ i ] [ j ] = A . m_data [ i ] [ j ] + B . m_data [ i ] [ j ] ; } } return C ; }
Returns C = A + B