docs: def solve(self, linear_system,
                vector_factory=None,
                *args, **kwargs):
          '''Solve the given linear system with recycling.
  
          The provided `vector_factory` determines which vectors are used for
          deflation.
  
          :param linear_system: the :py:class:`~krypy.linsys.LinearSystem` that
            is about to be solved.
          :param vector_factory: (optional) see description in constructor.
  
          All remaining arguments are passed to the ``DeflatedSolver``.
  
          :returns: instance of ``DeflatedSolver`` which was used to obtain the
            approximate solution. The approximate solution is available under the
            attribute ``xk``.
          '''
  
          # replace linear_system with equivalent TimedLinearSystem on demand
          if not isinstance(linear_system, linsys.TimedLinearSystem):
              linear_system = linsys.ConvertedTimedLinearSystem(linear_system)
  
          with self.timings['vector_factory']:
              if vector_factory is None:
                  vector_factory = self._vector_factory
  
              # construct vector_factory if strings are provided
              if vector_factory == 'RitzApproxKrylov':
                  vector_factory = factories.RitzFactory(
                      subset_evaluator=evaluators.RitzApproxKrylov()
                      )
              elif vector_factory == 'RitzAprioriCg':
                  vector_factory = factories.RitzFactory(
                      subset_evaluator=evaluators.RitzApriori(
                          Bound=utils.BoundCG
                          )
                      )
              elif vector_factory == 'RitzAprioriMinres':
                  vector_factory = factories.RitzFactory(
                      subset_evaluator=evaluators.RitzApriori(
                          Bound=utils.BoundMinres
                          )
                      )
  
              # get deflation vectors
              if self.last_solver is None or vector_factory is None:
                  U = numpy.zeros((linear_system.N, 0))
              else:
                  U = vector_factory.get(self.last_solver)
  
          with self.timings['solve']:
              # solve deflated linear system
              self.last_solver = self._DeflatedSolver(linear_system,
                                                      U=U,
                                                      store_arnoldi=True,
                                                      *args, **kwargs)
  
          # return solver instance
          return self.last_solver