summaryrefslogtreecommitdiff
path: root/numpy/core/defmatrix.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-02-27 23:32:49 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-02-27 23:32:49 +0000
commitd46782def8fff463f8dcff69e7d8b4f3e3ddfb71 (patch)
treee453068dcbf7b87a8515413fff732205450abda4 /numpy/core/defmatrix.py
parent5ffd88a782e28c9a6af60e61a4064389d0b80d93 (diff)
downloadnumpy-d46782def8fff463f8dcff69e7d8b4f3e3ddfb71.tar.gz
Don't check scalars in matrix mul. There is fast code for them in dotblas.
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r--numpy/core/defmatrix.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py
index b22efc108..e762734e9 100644
--- a/numpy/core/defmatrix.py
+++ b/numpy/core/defmatrix.py
@@ -145,11 +145,11 @@ class matrix(N.ndarray):
return truend
def __mul__(self, other):
- if isinstance(other, N.ndarray) or N.isscalar(other) \
- or not hasattr(other, '__rmul__'):
- return N.dot(self, other)
- else:
+ if not isinstance(other, N.ndarray) and \
+ hasattr(other, '__rmul__'):
return NotImplemented
+ else:
+ return N.dot(self, other)
def __rmul__(self, other):
return N.dot(other, self)