# [Scipy-svn] r3889 - trunk/scipy/splinalg/isolve

scipy-svn@scip... scipy-svn@scip...
Fri Feb 1 22:26:53 CST 2008

```Author: wnbell
Date: 2008-02-01 22:26:51 -0600 (Fri, 01 Feb 2008)
New Revision: 3889

Modified:
trunk/scipy/splinalg/isolve/minres.py
Log:
disable checking by default

Modified: trunk/scipy/splinalg/isolve/minres.py
===================================================================
--- trunk/scipy/splinalg/isolve/minres.py	2008-02-01 23:29:37 UTC (rev 3888)
+++ trunk/scipy/splinalg/isolve/minres.py	2008-02-02 04:26:51 UTC (rev 3889)
@@ -4,7 +4,7 @@
from utils import make_system

def minres(A, b, x0=None, shift=0.0, tol=1e-5, maxiter=None, xtype=None,
-           M=None, callback=None, show=False, check=True):
+           M=None, callback=None, show=False, check=False):
"""Use the Minimum Residual Method (MINRES) to solve Ax=b

MINRES minimizes norm(A*x - b) for the symmetric matrix A.  Unlike
@@ -90,6 +90,18 @@
beta1 = sqrt( beta1 )

if check:
+        # are these too strict?
+
+        # see if A is symmetric
+        w    = matvec(y)
+        r2   = matvec(w)
+        s    = inner(w,w)
+        t    = inner(y,r2)
+        z    = abs( s - t )
+        epsa = (s + eps) * eps**(1.0/3.0)
+        if z > epsa:
+            raise ValueError('non-symmetric matrix')
+
# see if M is symmetric
r2   = psolve(y)
s    = inner(y,y)
@@ -99,16 +111,7 @@
if z > epsa:
raise ValueError('non-symmetric preconditioner')

-        # see if A is symmetric
-        w    = matvec(y)
-        r2   = matvec(w)
-        s    = inner(w,w)
-        t    = inner(y,r2)
-        epsa = (s + eps) * eps**(1.0/3.0)
-        if z > epsa:
-            raise ValueError('non-symmetric matrix')

-
# Initialize other quantities
oldb   = 0;          beta   = beta1;   dbar   = 0;       epsln  = 0;
qrnorm = beta1;      phibar = beta1;   rhs1   = beta1;

```