[Scipy-svn] r6225 - trunk/scipy/optimize

scipy-svn@scip... scipy-svn@scip...
Wed Feb 10 01:41:40 CST 2010


Author: stefan
Date: 2010-02-10 01:41:40 -0600 (Wed, 10 Feb 2010)
New Revision: 6225

Modified:
   trunk/scipy/optimize/slsqp.py
Log:
DOC: Reformat approx_jacobian docstring.

Modified: trunk/scipy/optimize/slsqp.py
===================================================================
--- trunk/scipy/optimize/slsqp.py	2010-02-10 01:50:37 UTC (rev 6224)
+++ trunk/scipy/optimize/slsqp.py	2010-02-10 07:41:40 UTC (rev 6225)
@@ -17,20 +17,28 @@
 _epsilon = sqrt(finfo(float).eps)
 
 def approx_jacobian(x,func,epsilon,*args):
-    """Approximate the Jacobian matrix of callable function func
+    """Approximate the Jacobian matrix of a callable function.
 
-       *Parameters*:
-         x       - The state vector at which the Jacobian matrix is desired
-         func    - A vector-valued function of the form f(x,*args)
-         epsilon - The peturbation used to determine the partial derivatives
-         *args   - Additional arguments passed to func
+    Parameters
+    ----------
+    x : array_like
+        The state vector at which to compute the Jacobian matrix.
+    func : callable f(x, *args)
+        The vector-valued function.
+    epsilon : float\
+        The peturbation used to determine the partial derivatives.
+    *args : tuple
+        Additional arguments passed to func.
 
-       *Returns*:
-         An array of dimensions (lenf, lenx) where lenf is the length
-         of the outputs of func, and lenx is the number of
+    Returns
+    -------
+    An array of dimensions ``(lenf, lenx)`` where ``lenf`` is the length
+    of the outputs of `func`, and ``lenx`` is the number of elements in
+    `x`.
 
-       *Notes*:
-         The approximation is done using forward differences
+    Notes
+    -----
+    The approximation is done using forward differences.
 
     """
     x0 = asfarray(x)
@@ -44,8 +52,6 @@
     return jac.transpose()
 
 
-
-
 def fmin_slsqp( func, x0 , eqcons=[], f_eqcons=None, ieqcons=[], f_ieqcons=None,
                 bounds = [], fprime = None, fprime_eqcons=None,
                 fprime_ieqcons=None, args = (), iter = 100, acc = 1.0E-6,



More information about the Scipy-svn mailing list