code: public T extractMatrix(int y0 , int y1, int x0 , int x1 ) {
          if( y0 == SimpleMatrix.END ) y0 = mat.getNumRows();
          if( y1 == SimpleMatrix.END ) y1 = mat.getNumRows();
          if( x0 == SimpleMatrix.END ) x0 = mat.getNumCols();
          if( x1 == SimpleMatrix.END ) x1 = mat.getNumCols();
  
          T ret = createMatrix(y1-y0,x1-x0, mat.getType());
  
          ops.extract(mat, y0, y1, x0, x1, ret.mat, 0, 0);
  
          return ret;
      }
docs: <p>
  Creates a new SimpleMatrix which is a submatrix of this matrix.
  </p>
  <p>
  s<sub>i-y0 , j-x0</sub> = o<sub>ij</sub> for all y0 &le; i &lt; y1 and x0 &le; j &lt; x1<br>
  <br>
  where 's<sub>ij</sub>' is an element in the submatrix and 'o<sub>ij</sub>' is an element in the
  original matrix.
  </p>
  
  <p>
  If any of the inputs are set to SimpleMatrix.END then it will be set to the last row
  or column in the matrix.
  </p>
  
  @param y0 Start row.
  @param y1 Stop row + 1.
  @param x0 Start column.
  @param x1 Stop column + 1.
  @return The submatrix.