-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Migrated from TracdefectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.sparse.linalg
Description
Original ticket http://projects.scipy.org/scipy/ticket/939 on 2009-05-03 by @pv, assigned to @wnbell.
The tol
parameter in the scipy.sparse.linalg.isolve.*
routines is documented wrong. The documentation says:
tol : float
Relative tolerance to achieve before terminating.
However, the algorithms terminate as if tol
was absolute tolerance (in addition to being relative tolerance; STOPTEST2 anyway treats tol
as relative tolerance only):
>>> import scipy.sparse.linalg as la
>>> import numpy as np
>>> A = np.array([[1,0],[0,-1]])
>>> A = np.array([[1,0],[0,-1.]])
>>> b = np.array([1,-1]) * 1e-9
>>> la.gmres(A, b, tol=1e-8)
(array([ 0., 0.]), 0)
>>> la.gmres(A, b, tol=1e-12)
(array([ 1.00000000e-09, 1.00000000e-09]), 0)
>>> la.bicgstab(A, b, tol=1e-8)
(array([ 0., 0.]), 0)
>>> la.bicgstab(A, b, tol=1e-12)
(array([ NaN, NaN]), 1)
Is this the intended behaviour? Should the documentation or the code be fixed?
Some changes to behavior were apparently made in 9a40153, possibly erroneously.
Metadata
Metadata
Assignees
Labels
Migrated from TracdefectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.sparse.linalg