docs: def _finalize_iteration(self, yk, resnorm):
          '''Compute solution, error norm and residual norm if required.
  
          :return: the residual norm or ``None``.
          '''
          self.xk = None
          # compute error norm if asked for
          if self.linear_system.exact_solution is not None:
              self.xk = self._get_xk(yk)
              self.errnorms.append(utils.norm(
                  self.linear_system.exact_solution - self.xk,
                  ip_B=self.linear_system.ip_B))
  
          rkn = None
  
          # compute explicit residual if asked for or if the updated residual
          # is below the tolerance or if this is the last iteration
          if self.explicit_residual or \
              resnorm/self.linear_system.MMlb_norm <= self.tol \
                  or self.iter+1 == self.maxiter:
              # compute xk if not yet done
              if self.xk is None:
                  self.xk = self._get_xk(yk)
  
              # compute residual norm
              _, _, rkn = self.linear_system.get_residual(self.xk,
                                                          compute_norm=True)
  
              # store relative residual norm
              self.resnorms.append(rkn/self.linear_system.MMlb_norm)
  
              # no convergence?
              if self.resnorms[-1] > self.tol:
                  # no convergence in last iteration -> raise exception
                  # (approximate solution can be obtained from exception)
                  if self.iter+1 == self.maxiter:
                      self._finalize()
                      raise utils.ConvergenceError(
                          ('No convergence in last iteration '
                           '(maxiter: {0}, residual: {1}).')
                          .format(self.maxiter, self.resnorms[-1]), self)
                  # updated residual was below but explicit is not: warn
                  elif not self.explicit_residual \
                          and resnorm/self.linear_system.MMlb_norm <= self.tol:
                      warnings.warn(
                          'updated residual is below tolerance, explicit '
                          'residual is NOT! (upd={0} <= tol={1} < exp={2})'
                          .format(resnorm, self.tol, self.resnorms[-1]))
          else:
              # only store updated residual
              self.resnorms.append(resnorm/self.linear_system.MMlb_norm)
  
          return rkn