summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorSankarshan Mudkavi <Sankarshan.Mudkavi@gmail.com>2014-03-05 17:23:22 -0500
committerSankarshan Mudkavi <Sankarshan.Mudkavi@gmail.com>2014-03-05 22:16:46 -0500
commit26f053db9d9cf9b4701dc8f4c48f733338635fa7 (patch)
tree660ce403f3a4c762c27f3b5d47c740ba3fec5566 /numpy/core/numeric.py
parenta509af15328c7f7461934de81e176d559e5fd03c (diff)
downloadnumpy-26f053db9d9cf9b4701dc8f4c48f733338635fa7.tar.gz
ENH: Added an output argument for numpy.outer
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 713f6f8f0..a02e12b45 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -991,7 +991,7 @@ def convolve(a,v,mode='full'):
mode = _mode_from_name(mode)
return multiarray.correlate(a, v[::-1], mode)
-def outer(a, b):
+def outer(a, b, out=None):
"""
Compute the outer product of two vectors.
@@ -1012,6 +1012,8 @@ def outer(a, b):
b : (N,) array_like
Second input vector. Input is flattened if
not already 1-dimensional.
+ out : (M, N) ndarray, optional
+ A location where the result is stored
Returns
-------
@@ -1065,7 +1067,7 @@ def outer(a, b):
"""
a = asarray(a)
b = asarray(b)
- return a.ravel()[:, newaxis]*b.ravel()[newaxis,:]
+ return multiply(a.ravel()[:, newaxis], b.ravel()[newaxis,:], out)
# try to import blas optimized dot if available
try: