[Scipy-svn] r4476 - in trunk/scipy/sparse: . linalg/eigen/lobpcg linalg/isolve
scipy-svn at scipy.org
scipy-svn at scipy.org
Tue Jun 24 09:53:51 EDT 2008
Author: wnbell
Date: 2008-06-24 08:53:46 -0500 (Tue, 24 Jun 2008)
New Revision: 4476
Modified:
trunk/scipy/sparse/base.py
trunk/scipy/sparse/construct.py
trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
trunk/scipy/sparse/linalg/isolve/utils.py
Log:
edited a few docstrings
Modified: trunk/scipy/sparse/base.py
===================================================================
--- trunk/scipy/sparse/base.py 2008-06-24 11:41:19 UTC (rev 4475)
+++ trunk/scipy/sparse/base.py 2008-06-24 13:53:46 UTC (rev 4476)
@@ -195,13 +195,14 @@
"""Return this matrix in a given sparse format
Parameters
- ==========
- - format : desired sparse matrix format
- - If format is None then no conversion is performed
- - Other possible values include:
- - "csr" for csr_matrix format
- - "csc" for csc_matrix format
- - "dok" for dok_matrix format and so on
+ ----------
+ format : {string, None}
+ desired sparse matrix format
+ - None for no format conversion
+ - "csr" for csr_matrix format
+ - "csc" for csc_matrix format
+ - "lil" for lil_matrix format
+ - "dok" for dok_matrix format and so on
"""
Modified: trunk/scipy/sparse/construct.py
===================================================================
--- trunk/scipy/sparse/construct.py 2008-06-24 11:41:19 UTC (rev 4475)
+++ trunk/scipy/sparse/construct.py 2008-06-24 13:53:46 UTC (rev 4476)
@@ -27,30 +27,32 @@
def spdiags(data, diags, m, n, format=None):
- """Return a sparse matrix given its diagonals.
+ """Return a sparse matrix from diagonals.
Parameters
----------
- - data : matrix whose rows contain the diagonal values
- - diags : diagonals to set
- - k = 0 - the main diagonal
- - k > 0 - the k-th upper diagonal
- - k < 0 - the k-th lower diagonal
- - m, n : dimensions of the result
- - format : format of the result (e.g. "csr")
- - By default (format=None) an appropriate sparse matrix
- format is returned. This choice is subject to change.
+ data : array_like
+ matrix diagonals stored row-wise
+ diags : diagonals to set
+ - k = 0 the main diagonal
+ - k > 0 the k-th upper diagonal
+ - k < 0 the k-th lower diagonal
+ m, n : int
+ shape of the result
+ format : format of the result (e.g. "csr")
+ By default (format=None) an appropriate sparse matrix
+ format is returned. This choice is subject to change.
See Also
--------
- The dia_matrix class which implements the DIAgonal format.
+ The dia_matrix class which implements the DIAgonal format.
Example
-------
- >>> data = array([[1,2,3,4]]).repeat(3,axis=0)
+ >>> data = array([[1,2,3,4],[1,2,3,4],[1,2,3,4]])
>>> diags = array([0,-1,2])
- >>> spdiags(data,diags,4,4).todense()
+ >>> spdiags(data, diags, 4, 4).todense()
matrix([[1, 0, 3, 0],
[1, 2, 0, 4],
[0, 2, 3, 0],
@@ -87,8 +89,12 @@
Parameters
----------
- A,B : dense or sparse matrices
- format : format of the result (e.g. "csr")
+ A
+ matrix
+ B
+ matrix
+ format : string
+ format of the result (e.g. "csr")
Returns
-------
@@ -169,15 +175,19 @@
Parameters
----------
- A,B : square dense or sparse matrices
- format : format of the result (e.g. "csr")
+ A
+ square matrix
+ B
+ square matrix
+ format : string
+ format of the result (e.g. "csr")
Returns
- =======
- kronecker sum in a sparse matrix format
+ -------
+ kronecker sum in a sparse matrix format
Examples
- ========
+ --------
"""
@@ -206,7 +216,8 @@
blocks
sequence of sparse matrices with compatible shapes
- format : sparse format of the result (e.g. "csr")
+ format : string
+ sparse format of the result (e.g. "csr")
by default an appropriate sparse matrix format is returned.
This choice is subject to change.
@@ -232,7 +243,8 @@
blocks
sequence of sparse matrices with compatible shapes
- format : sparse format of the result (e.g. "csr")
+ format : string
+ sparse format of the result (e.g. "csr")
by default an appropriate sparse matrix format is returned.
This choice is subject to change.
Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
===================================================================
--- trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2008-06-24 11:41:19 UTC (rev 4475)
+++ trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2008-06-24 13:53:46 UTC (rev 4476)
@@ -5,7 +5,7 @@
License: BSD
-(c) Robert Cimrman, Andrew Knyazev
+Authors: Robert Cimrman, Andrew Knyazev
Examples in tests directory contributed by Nils Wagner.
"""
@@ -91,8 +91,9 @@
Example
-------
- A = makeOperator( arrayA, (n, n) )
- vectorB = A( vectorX )
+ >>> A = makeOperator( arrayA, (n, n) )
+ >>> vectorB = A( vectorX )
+
"""
if operatorInput is None:
def ident(x):
@@ -203,8 +204,8 @@
Notes
-----
If both retLambdaHistory and retResidualNormsHistory are True, the
- return tuple has the following format:
- (lambda, V, lambda history, residual norms history)
+ return tuple has the following format
+ (lambda, V, lambda history, residual norms history)
"""
failureFlag = True
Modified: trunk/scipy/sparse/linalg/isolve/utils.py
===================================================================
--- trunk/scipy/sparse/linalg/isolve/utils.py 2008-06-24 11:41:19 UTC (rev 4475)
+++ trunk/scipy/sparse/linalg/isolve/utils.py 2008-06-24 13:53:46 UTC (rev 4476)
@@ -1,3 +1,7 @@
+__docformat__ = "restructuredtext en"
+
+__all__ = []
+
from warnings import warn
from numpy import asanyarray, asarray, asmatrix, array, matrix, zeros
@@ -24,27 +28,34 @@
def make_system(A, M, x0, b, xtype=None):
"""Make a linear system Ax=b
- Parameters:
- A - LinearOperator
- - sparse or dense matrix (or any valid input to aslinearoperator)
- M - LinearOperator or None
- - preconditioner
- - sparse or dense matrix (or any valid input to aslinearoperator)
- x0 - array_like or None
- - initial guess to iterative method
- b - array_like
- - right hand side
- xtype - None or one of 'fdFD'
- - dtype of the x vector
+ Parameters
+ ----------
+ A : LinearOperator
+ sparse or dense matrix (or any valid input to aslinearoperator)
+ M : {LinearOperator, Nones}
+ preconditioner
+ sparse or dense matrix (or any valid input to aslinearoperator)
+ x0 : {array_like, None}
+ initial guess to iterative method
+ b : array_like
+ right hand side
+ xtype : {'f', 'd', 'F', 'D', None}
+ dtype of the x vector
- Returns:
- (A, M, x, b, postprocess) where:
- - A is a LinearOperator
- - M is a LinearOperator
- - x is the initial guess (rank 1 array)
- - b is the rhs (rank 1 array)
- - postprocess is a function that converts the solution vector
- to the appropriate type and dimensions (e.g. (N,1) matrix)
+ Returns
+ -------
+ (A, M, x, b, postprocess)
+ A : LinearOperator
+ matrix of the linear system
+ M : LinearOperator
+ preconditioner
+ x : rank 1 ndarray
+ initial guess
+ b : rank 1 ndarray
+ right hand side
+ postprocess : function
+ converts the solution vector to the appropriate
+ type and dimensions (e.g. (N,1) matrix)
"""
A_ = A
More information about the Scipy-svn
mailing list