chaimbaskin / cusp-library

Automatically exported from code.google.com/p/cusp-library
Apache License 2.0
0 stars 0 forks source link

convergence_monitor should handle multiple calls to .finished() per iteration #49

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In light of issue #27 it seems we'll need to make convergence_monitor [1] 
handle multiple calls to .finished() per iteration.  Possible remedies are

1) Record all residual norms and use iteration_count() to compute the 
convergence rates.
2) Record only one residual norm per iteration
3) Record both the iteration number and norm for all calls to .finished()

For #2 we could keep the first, last or minimum norm by default and support 
general BinaryOperators so any behavior can be handled.

My initial preference is for #2.  The problem with #1 is that the 
immediate_rate() computation is no longer straightforward.  The last option 
keeps the most information but is probably not what most people want.  Option 
#2 also has the nice property that (for reasonable BinaryOperators) any 
redundant calls to finished() won't affect the results.

So, I like #2, but I haven't given much thought to how monitors will work with 
multiple RHS or handle methods like GMRES.

Thoughts?

[1] http://code.google.com/p/cusp-library/source/browse/cusp/monitor.h#256

Original issue reported on code.google.com by wnbell on 14 Nov 2010 at 7:29

GoogleCodeExporter commented 8 years ago
Someone suggested to me that a better solution is to add a separate callback(x) 
parameter that is invoked exactly once per iteration.

Let's revisit this for v0.3.

Original comment by wnbell on 14 Feb 2011 at 8:37

GoogleCodeExporter commented 8 years ago

Original comment by wnbell on 5 Feb 2012 at 1:08