xiaotaiye / cusp-library

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

Reset function for monitor template #52

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A simple reset function that resets norms and counters would be useful for 
repeated Krylov method use. 

So:
cusp::default_monitor<ValueType> monitor(b,k, tol);

The function

monitor.reset()

will set:
r_norm=std::numeric_limits<Real>::max()
iteration_count_=0;

Original issue reported on code.google.com by erlend.a...@gmail.com on 17 Nov 2010 at 6:25

GoogleCodeExporter commented 8 years ago
Does anyone know a work around in the mean time?

Original comment by S.R.S.Ba...@gmail.com on 14 Apr 2011 at 11:36

GoogleCodeExporter commented 8 years ago
Just insert this into monitor.h

monitor.reset()
{
r_norm=std::numeric_limits<Real>::max()
iteration_count_=0;
}

Original comment by erlend.a...@gmail.com on 15 Apr 2011 at 9:34

GoogleCodeExporter commented 8 years ago
Ok, ya I did pretty much the same thing. I have attached a patch with the above 
change if anyone is interested. It worked fine for me, but I haven't "properly" 
tested it, it is only 3 lines of code though.

Original comment by S.R.S.Ba...@gmail.com on 15 Apr 2011 at 9:26

Attachments: