[SciPy-user] Convergence behaviour of iterative solvers

Matthew Brett matthew.brett at gmail.com
Fri Jan 19 07:57:45 CST 2007


On 1/19/07, Giovanni Samaey <Giovanni.Samaey at cs.kuleuven.be> wrote:
> I needed this as well and I altered the GMRES function in scipy's linalg
> file as follows:
>
> I added an input parameter prnt and
> added at line 618 the following lines
>
> if prnt:
>     print "#GMRES: ", nbiter,resid

Or maybe an observer function of some sort for more flexibility:

def show_convergence(nbiter, resid):
   print "#GMRES: ", nbiter,resid

def solver(...., observer_func = None)
...
if observer_func:
   observer_func(nbiter, resid)

sort of thing.

Matthew


More information about the SciPy-user mailing list