diff options
author | David Cournapeau <cournape@gmail.com> | 2009-03-02 14:46:20 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-03-02 14:46:20 +0000 |
commit | 1e150f025f2e0d8f03bb31d42cfff648e6efb269 (patch) | |
tree | ea1bd58980216052f791f8ce4e59eb9c434bbe87 /numpy/core/defmatrix.py | |
parent | 9505ef3f9bbdc13d6c4e76c66dbc273650f80297 (diff) | |
download | numpy-1e150f025f2e0d8f03bb31d42cfff648e6efb269.tar.gz |
Add in-place power raising for matrices (#787).
Diffstat (limited to 'numpy/core/defmatrix.py')
-rw-r--r-- | numpy/core/defmatrix.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/defmatrix.py b/numpy/core/defmatrix.py index 1c500e886..d1636e8b5 100644 --- a/numpy/core/defmatrix.py +++ b/numpy/core/defmatrix.py @@ -302,6 +302,10 @@ class matrix(N.ndarray): def __pow__(self, other): return matrix_power(self, other) + def __ipow__(self, other): + self[:] = self ** other + return self + def __rpow__(self, other): return NotImplemented |