code: public void setMatrix(int i0, int i1, int j0, int j1, Matrix X)
      {
          try
          {
              for (int i = i0; i <= i1; i++)
              {
                  for (int j = j0; j <= j1; j++)
                  {
                      A[i][j] = X.get(i - i0, j - j0);
                  }
              }
          }
          catch (ArrayIndexOutOfBoundsException e)
          {
              throw new ArrayIndexOutOfBoundsException("Submatrix indices");
          }
      }
docs: Set a submatrix.
  
  @param i0 Initial row index
  @param i1 Final row index
  @param j0 Initial column index
  @param j1 Final column index
  @param X  A(i0:i1,j0:j1)
  @throws ArrayIndexOutOfBoundsException Submatrix indices