# [Scipy-svn] r6828 - in trunk/scipy/sparse/linalg: . eigen/lobpcg isolve

scipy-svn@scip... scipy-svn@scip...
Fri Oct 1 05:23:35 CDT 2010

```Author: ptvirtan
Date: 2010-10-01 05:23:34 -0500 (Fri, 01 Oct 2010)
New Revision: 6828

Modified:
trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
trunk/scipy/sparse/linalg/interface.py
trunk/scipy/sparse/linalg/isolve/iterative.py
Log:
DOC: sparse.linalg: reformat docstrings

Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
===================================================================
--- trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py	2010-09-28 02:08:26 UTC (rev 6827)
+++ trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py	2010-10-01 10:23:34 UTC (rev 6828)
@@ -158,7 +158,6 @@
This function implements the Locally Optimal Block Preconditioned
Conjugate Gradient Method (LOBPCG).

-
Parameters
----------
A : {sparse matrix, dense matrix, LinearOperator}
@@ -167,44 +166,40 @@
X : array_like
Initial approximation to the k eigenvectors. If A has
shape=(n,n) then X should have shape shape=(n,k).
-
-    Returns
-    -------
-    w : array
-        Array of k eigenvalues
-    v : array
-        An array of k eigenvectors.  V has the same shape as X.
-
-
-    Optional Parameters
-    -------------------
-    B : {dense matrix, sparse matrix, LinearOperator}
+    B : {dense matrix, sparse matrix, LinearOperator}, optional
the right hand side operator in a generalized eigenproblem.
by default, B = Identity
often called the "mass matrix"
-    M : {dense matrix, sparse matrix, LinearOperator}
+    M : {dense matrix, sparse matrix, LinearOperator}, optional
preconditioner to A; by default M = Identity
M should approximate the inverse of A
-    Y : array_like
+    Y : array_like, optional
n-by-sizeY matrix of constraints, sizeY < n
The iterations will be performed in the B-orthogonal complement
of the column-space of Y. Y must be full rank.

+    Returns
+    -------
+    w : array
+        Array of k eigenvalues
+    v : array
+        An array of k eigenvectors.  V has the same shape as X.
+
Other Parameters
----------------
-    tol : scalar
+    tol : scalar, optional
Solver tolerance (stopping criterion)
by default: tol=n*sqrt(eps)
-    maxiter: integer
+    maxiter: integer, optional
maximum number of iterations
by default: maxiter=min(n,20)
-    largest : boolean
+    largest : boolean, optional
when True, solve for the largest eigenvalues, otherwise the smallest
-    verbosityLevel : integer
+    verbosityLevel : integer, optional
controls solver output.  default: verbosityLevel = 0.
-    retLambdaHistory : boolean
+    retLambdaHistory : boolean, optional
whether to return eigenvalue history
-    retResidualNormsHistory : boolean
+    retResidualNormsHistory : boolean, optional
whether to return history of residual norms

Modified: trunk/scipy/sparse/linalg/interface.py
===================================================================
--- trunk/scipy/sparse/linalg/interface.py	2010-09-28 02:08:26 UTC (rev 6827)
+++ trunk/scipy/sparse/linalg/interface.py	2010-10-01 10:23:34 UTC (rev 6828)
@@ -21,8 +21,8 @@
matvec : callable f(v)
Returns returns A * v.

-    Optional Parameters
-    -------------------
+    Other Parameters
+    ----------------
rmatvec : callable f(v)
Returns A^H * v, where A^H is the conjugate transpose of A.
matmat : callable f(V)

Modified: trunk/scipy/sparse/linalg/isolve/iterative.py
===================================================================
--- trunk/scipy/sparse/linalg/isolve/iterative.py	2010-09-28 02:08:26 UTC (rev 6827)
+++ trunk/scipy/sparse/linalg/isolve/iterative.py	2010-10-01 10:23:34 UTC (rev 6828)
@@ -21,8 +21,18 @@
b : {array, matrix}
Right hand side of the linear system. Has shape (N,) or (N,1).

-Optional Parameters
--------------------
+Returns
+-------
+x : {array, matrix}
+    The converged solution.
+info : integer
+    Provides convergence information:
+        0  : successful exit
+        >0 : convergence to tolerance not achieved, number of iterations
+        <0 : illegal input or breakdown
+
+Other Parameters
+----------------
x0  : {array, matrix}
Starting guess for the solution.
tol : float
@@ -39,26 +49,16 @@
callback : function
User-supplied function to call after each iteration.  It is called
as callback(xk), where xk is the current solution vector.
-
-Outputs
--------
-x : {array, matrix}
-    The converged solution.
-info : integer
-    Provides convergence information:
-        0  : successful exit
-        >0 : convergence to tolerance not achieved, number of iterations
-        <0 : illegal input or breakdown
-
-Deprecated Parameters
-----------------------
xtype : {'f','d','F','D'}
+    This parameter is deprecated -- avoid using it.
+
The type of the result.  If None, then it will be determined from
A.dtype.char and b.  If A does not have a typecode method then it
will compute A.matvec(x0) to get a typecode.   To save the extra
computation when A does not have a typecode attribute use xtype=0
for the same type as b or use xtype='f','d','F',or 'D'.
This parameter has been superceeded by LinearOperator.
+
"""

@@ -314,8 +314,18 @@
b : {array, matrix}
Right hand side of the linear system. Has shape (N,) or (N,1).

-    Optional Parameters
-    -------------------
+    Returns
+    -------
+    x : {array, matrix}
+        The converged solution.
+    info : integer
+        Provides convergence information:
+            0  : successful exit
+            >0 : convergence to tolerance not achieved, number of iterations
+            <0 : illegal input or breakdown
+
+    Other Parameters
+    ----------------
x0  : {array, matrix}
Starting guess for the solution.
tol : float
@@ -336,24 +346,9 @@
callback : function
User-supplied function to call after each iteration.  It is called
as callback(rk), where rk is the current residual vector.
-
-    Outputs
-    -------
-    x : {array, matrix}
-        The converged solution.
-    info : integer
-        Provides convergence information:
-            0  : successful exit
-            >0 : convergence to tolerance not achieved, number of iterations
-            <0 : illegal input or breakdown
-
-    See Also
-    --------
-    LinearOperator
-
-    Deprecated Parameters
-    ---------------------
xtype : {'f','d','F','D'}
+        This parameter is DEPRECATED --- avoid using it.
+
The type of the result.  If None, then it will be determined from
A.dtype.char and b.  If A does not have a typecode method then it
will compute A.matvec(x0) to get a typecode.   To save the extra
@@ -361,6 +356,10 @@
for the same type as b or use xtype='f','d','F',or 'D'.
This parameter has been superceeded by LinearOperator.

+    See Also
+    --------
+    LinearOperator
+
"""

# Change 'restrt' keyword to 'restart'
@@ -460,8 +459,18 @@
b : {array, matrix}
Right hand side of the linear system. Has shape (N,) or (N,1).

-    Optional Parameters
-    -------------------
+    Returns
+    -------
+    x : {array, matrix}
+        The converged solution.
+    info : integer
+        Provides convergence information:
+            0  : successful exit
+            >0 : convergence to tolerance not achieved, number of iterations
+            <0 : illegal input or breakdown
+
+    Other Parameters
+    ----------------
x0  : {array, matrix}
Starting guess for the solution.
tol : float
@@ -479,24 +488,9 @@
callback : function
User-supplied function to call after each iteration.  It is called
as callback(xk), where xk is the current solution vector.
-
-    Outputs
-    -------
-    x : {array, matrix}
-        The converged solution.
-    info : integer
-        Provides convergence information:
-            0  : successful exit
-            >0 : convergence to tolerance not achieved, number of iterations
-            <0 : illegal input or breakdown
-
-    See Also
-    --------
-    LinearOperator
-
-    Deprecated Parameters
-    ---------------------
xtype : {'f','d','F','D'}
+        This parameter is DEPRECATED -- avoid using it.
+
The type of the result.  If None, then it will be determined from
A.dtype.char and b.  If A does not have a typecode method then it
will compute A.matvec(x0) to get a typecode.   To save the extra
@@ -504,6 +498,10 @@
for the same type as b or use xtype='f','d','F',or 'D'.
This parameter has been superceeded by LinearOperator.

+    See Also
+    --------
+    LinearOperator
+
"""
A_ = A
A,M,x,b,postprocess = make_system(A,None,x0,b,xtype)

```

More information about the Scipy-svn mailing list