[Scipy-svn] r4864 - trunk/scipy/integrate

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Nov 1 07:11:11 EDT 2008


Author: stefan
Date: 2008-11-01 06:11:05 -0500 (Sat, 01 Nov 2008)
New Revision: 4864

Modified:
   trunk/scipy/integrate/quadrature.py
Log:
Add docstring to `vectorize1` [patch by Neil Muller].


Modified: trunk/scipy/integrate/quadrature.py
===================================================================
--- trunk/scipy/integrate/quadrature.py	2008-11-01 10:56:47 UTC (rev 4863)
+++ trunk/scipy/integrate/quadrature.py	2008-11-01 11:11:05 UTC (rev 4864)
@@ -48,6 +48,30 @@
     return (b-a)/2.0*sum(w*func(y,*args),0), None
 
 def vectorize1(func, args=(), vec_func=False):
+    """Vectorize the call to a function.
+
+    This is an internal utility function used by `romberg` and
+    `quadrature` to create a vectorized version of a function.
+
+    If `vec_func` is True, the function `func` is assumed to take vector
+    arguments.
+
+    Parameters
+    ----------
+    func : callable
+        User defined function.
+    args : tuple
+        Extra arguments for the function.
+    vec_func : bool
+        True if the function func takes vector arguments.
+
+    Returns
+    -------
+    vfunc : callable
+        A function that will take a vector argument and return the
+        result.
+
+    """
     if vec_func:
         def vfunc(x):
             return func(x, *args)




More information about the Scipy-svn mailing list