summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-01-29 02:58:55 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-01-29 02:58:55 +0000
commit83d691d731082ec8d2367affb77b454c2a0b0855 (patch)
tree03b5f5c02feedb77076c03a4f615d7d393ecd370
parente97d2da5c89a2dc2ee87bc67d54b7d6a946835a9 (diff)
downloadnumpy-83d691d731082ec8d2367affb77b454c2a0b0855.tar.gz
Add test for column-vector bug in dotblas.
-rw-r--r--numpy/core/tests/test_numeric.py7
-rw-r--r--numpy/lib/function_base.py2
2 files changed, 9 insertions, 0 deletions
diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
index 3befaf4a2..8ebb825d5 100644
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -64,6 +64,13 @@ class test_dot(ScipyTestCase):
b1 = matrix(ones((3,3),dtype=complex))
assert_equal(b1*1.0, b1)
+ def check_columnvect(self):
+ b1 = ones((3,1))
+ b2 = [5.3]
+ c1 = dot(b1,b2)
+ c2 = dot_(b1,b2)
+ assert_almost_equal(c1, c2, decimal=self.N)
+
class test_bool_scalar(ScipyTestCase):
def test_logical(self):
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index d0a28b4dd..7f87818b1 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -183,6 +183,8 @@ def piecewise(x, condlist, funclist, *args, **kw):
Each function should return an array output for an array input
Each function can take (the same set) of extra arguments and
keyword arguments which are passed in after the function list.
+ A constant may be used in funclist for a function that returns a
+ constant (e.g. val and lambda x: val are equivalent in a funclist).
The output is the same shape and type as x and is found by
calling the functions on the appropriate portions of x.