Solve a matrix equation using the LGMRES algorithm.
The LGMRES algorithm [BJM] [BPh] is designed to avoid some problems in the convergence in restarted GMRES, and often converges in fewer iterations.
Parameters :  A : {sparse matrix, dense matrix, LinearOperator}
b : {array, matrix}
x0 : {array, matrix}
tol : float
maxiter : int
M : {sparse matrix, dense matrix, LinearOperator}
callback : function
inner_m : int, optional
outer_k : int, optional
outer_v : list of tuples, optional
store_outer_Av : bool, optional


Returns :  x : array or matrix
info : int

Notes
The LGMRES algorithm [BJM] [BPh] is designed to avoid the slowing of convergence in restarted GMRES, due to alternating residual vectors. Typically, it often outperforms GMRES(m) of comparable memory requirements by some measure, or at least is not much worse.
Another advantage in this algorithm is that you can supply it with ‘guess’ vectors in the outer_v argument that augment the Krylov subspace. If the solution lies close to the span of these vectors, the algorithm converges faster. This can be useful if several very similar matrices need to be inverted one after another, such as in NewtonKrylov iteration where the Jacobian matrix often changes little in the nonlinear steps.
References
[BJM]  (1, 2, 3, 4) A.H. Baker and E.R. Jessup and T. Manteuffel, SIAM J. Matrix Anal. Appl. 26, 962 (2005). 
[BPh]  (1, 2, 3) A.H. Baker, PhD thesis, University of Colorado (2003). http://amath.colorado.edu/activities/thesis/allisonb/Thesis.ps 