<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/728" rel="nofollow">http://projects.scipy.org/scipy/ticket/728</a> on 2008-08-25 by trac user jschrod3, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wnbell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wnbell">@wnbell</a>.</em></p>
<p dir="auto">I'm using scipy version<br>
Out[4]: scipy.version.version<br>
Out[5]: '0.7.0.dev4561'</p>
<p dir="auto">When I use the gmres routine from scipy.sparse.linalg, I cannot control its maximum number of iterations through the maxiter variable, nor does the "callback" routine ever seem to get called, so I can't track convergence.</p>
<p dir="auto">I found this ticket,<br>
<a href="http://www.scipy.org/scipy/scipy/attachment/ticket/360/new_iterative_gmres.py" rel="nofollow">http://www.scipy.org/scipy/scipy/attachment/ticket/360/new_iterative_gmres.py</a><br>
which I was able to adapt to the current gmres (see attached modified iterative.py) so that I can get access to residuals in gmres and track convergence.  However since maxiter is broken, gmres will sometimes iterate an insane number of times before returning and my residual history can be about 10,000 values long for a 744x744 matrix.  This also takes a long time, so that doing automated numerical tests is not at all efficient.  (note the 10,000 gmres iterations are what my research aims to fix.  I'm well aware that a well-preconditioned gmres call will terminate much sooner.)</p>
<p dir="auto">Could gmres be extended so that it<br>
(1) uses maxiter<br>
(2) executes "callback(resid)" every full gmres iteration so that I can track convergence?</p>
<p dir="auto">These functionalities are critical if I'm to use gmres at all.  I would imagine that others are in my boat.</p>
<p dir="auto">Thanks</p>
<p dir="auto">With Python 3.9a3</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="_____________________________________________________________________ TestFactorialFunctions.test_mixed_nan_inputs ______________________________________________________________________
scipy/special/tests/test_basic.py:1835: in test_mixed_nan_inputs
    result = special.factorial(x, exact=True)
scipy/special/_basic.py:2354: in factorial
    val = math.factorial(un[0])
E   DeprecationWarning: Using factorial() with floats is deprecated"><pre class="notranslate"><code class="notranslate">_____________________________________________________________________ TestFactorialFunctions.test_mixed_nan_inputs ______________________________________________________________________
scipy/special/tests/test_basic.py:1835: in test_mixed_nan_inputs
    result = special.factorial(x, exact=True)
scipy/special/_basic.py:2354: in factorial
    val = math.factorial(un[0])
E   DeprecationWarning: Using factorial() with floats is deprecated
</code></pre></div>