[SciPy-user] Callback feature for iterative solvers

Ed Schofield edschofield at gmail.com
Wed Jan 24 08:35:09 CST 2007


On 1/23/07, Nils Wagner <nwagner at iam.uni-stuttgart.de> wrote:
>
> Hi Ed,
>
> Please find attached my modified iterative.py. The output of my test is
> attached as well.
>
> python -i test_callback.py yields
>
> iter_ 1
> ||A.x - b|| = 2.04635901219
> iter_ 1
> ||A.x - b|| = 2.04635901219
> iter_ 1
> ||A.x - b|| = 0.528173459455

...
>

Yeah, so iter_ doesn't increase monotonically. We probably want to call the
callback function only once per iteration -- whenever iter_ increases. I've
added a check for this and checked it into SVN for bicg(), bicgstab(), cg(),
cgs(), gmres(), and qmr(). I've also added some unit tests based on your
test case.

So the iterative solvers now support callback functions. If anyone runs into
any problems, please shout!

-- Ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070124/88093c80/attachment.html 


More information about the SciPy-user mailing list