summaryrefslogtreecommitdiff
path: root/numpy/core/defmatrix.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-01-17 02:59:51 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-01-17 02:59:51 +0000
commite92c9c4400da1024053666b62e2e20bd312a937c (patch)
treef6abc8dc65bc005f68a1a1ed9a2e8125c5890744 /numpy/core/defmatrix.py
parent4593515985f1aa30cf07715ace5eeee6da848c97 (diff)
downloadnumpy-e92c9c4400da1024053666b62e2e20bd312a937c.tar.gz
Add Paulo's improvements to _dotblas.c and don't always require contiguous.
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r--numpy/core/defmatrix.py40
1 files changed, 3 insertions, 37 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py
index d90530fa4..d506220a2 100644
--- a/numpy/core/defmatrix.py
+++ b/numpy/core/defmatrix.py
@@ -135,44 +135,10 @@ class matrix(N.ndarray):
return truend
def __mul__(self, other):
- if (self.ndim != self._get_truendim()):
- myself = self.A.squeeze()
- else:
- myself = self
-
- myother = other
- if isinstance(other, matrix):
- if (other.ndim != other._get_truendim()):
- myother = other.A.squeeze()
-
- if isinstance(myother, N.ndarray) and myother.size == 1:
- res = N.multiply(myself, myother.item())
- else:
- res = N.dot(myself, myother)
-
- if not isinstance(res, matrix):
- res = res.view(matrix)
- return res
-
+ return N.dot(self, other)
+
def __rmul__(self, other):
- if (self.ndim != self._get_truendim()):
- myself = self.A.squeeze()
- else:
- myself = self
-
- myother = other
- if isinstance(other, matrix):
- if (other.ndim != other._get_truendim()):
- myother = other.A.squeeze()
-
- if isinstance(myother, N.ndarray) and myother.size == 1:
- res = N.multiply(myother.item(), myself)
- else:
- res = N.dot(myother, myself)
-
- if not isinstance(res, matrix):
- res = res.view(matrix)
- return res
+ return N.dot(other, self)
def __imul__(self, other):
self[:] = self * other