private void checkMatrixDimensions(Matrix B){
  if (B.m != m || B.n != n) {
    throw new IllegalArgumentException("Matrix dimensions must agree.");
  }
}

private void checkMatrixDimensions ( Matrix B ) { if ( B . m != m || B . n != n ) { throw new IllegalArgumentException ( "Matrix dimensions must agree." ) ; } }
check if size ( a ) = = size ( b )
