code: public void setRestart(int restart) {
          this.restart = restart;
          if (restart <= 0)
              throw new IllegalArgumentException(
                      "restart must be a positive integer");
  
          s = new DenseVector(restart + 1);
          H = new DenseMatrix(restart + 1, restart);
          rotation = new GivensRotation[restart + 1];
  
          v = new Vector[restart + 1];
          for (int i = 0; i < v.length; ++i)
              v[i] = r.copy().zero();
      }
docs: Sets the restart parameter
  
  @param restart
  GMRES iteration is restarted after this number of iterations