[SciPy-User] GMRES iteration number

Jonathan Tu jonathantu at gmail.com
Mon Jun 9 16:18:32 EDT 2014


Hi,

Using a callback makes sense to me conceptually, but I have never implemented something like this.  Is there a standard way to do such a thing?  I would like something lightweight, obviously.  I can imagine defining a small class containing a counter attribute and a parens function that updates this value.  This seems better than doing something like defining a global variable that callback() can modify.  Since the callback function will be called as callback(rk), where rk is the residual, I don't know how else to have it update a value whose scope needs to lie outside the callback function itself.



Jonathan Tu


On May 30, 2014, at 1:47 AM, Ralf Gommers <ralf.gommers at gmail.com> wrote:

> 
> 
> 
> On Fri, May 30, 2014 at 10:37 AM, Arun Gokule <arun.gokule at gmail.com> wrote:
> AFAICT no.
> 
> 
> On Thu, May 29, 2014 at 1:20 PM, Jonathan Tu <jonathantu at gmail.com> wrote:
> Hi,
> 
> Is there any way to access the number of iterations it takes to complete a GMRES computation?  I've checked the documentation at http://docs.scipy.org/doc/scipy-0.13.0/reference/generated/scipy.sparse.linalg.gmres.html and it doesn't appear so.  I am doing some testing with passing in initial guesses x0, and I am interested to know whether or not this significantly reduces the required number of iterations.
> 
> There's no return value that tells you tells (and we can't add one in nice a backwards-compatible way), but you can use a callback function to do this. Just provide a callback that increments some counter each time it is called.
> 
> Ralf
> 
> 
> 
> 
> 
> Thanks,
> Jonathan Tu
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20140609/2dd69170/attachment.html>


More information about the SciPy-User mailing list