summaryrefslogtreecommitdiff
path: root/scipy/base/matrix.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-09-28 06:53:37 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-09-28 06:53:37 +0000
commitdcd3bd07a910e1bb727e048de0e7ff2443f7285f (patch)
tree989bfa0d98885a97b3c7ddd1a329a4554acce4e1 /scipy/base/matrix.py
parent2199334cfa7e3934bf81076510a84a73054ca868 (diff)
downloadnumpy-dcd3bd07a910e1bb727e048de0e7ff2443f7285f.tar.gz
Eliminated random_lite library
Diffstat (limited to 'scipy/base/matrix.py')
-rw-r--r--scipy/base/matrix.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/scipy/base/matrix.py b/scipy/base/matrix.py
index 3710dc4da..34a4673c8 100644
--- a/scipy/base/matrix.py
+++ b/scipy/base/matrix.py
@@ -1,6 +1,7 @@
import numeric as N
from numeric import ArrayType, concatenate
+from function_base import binary_repr
import types
import string as str_
@@ -41,25 +42,6 @@ def _convert_from_string(data):
newdata.append(newrow)
return newdata
-_lkup = {'0':'000',
- '1':'001',
- '2':'010',
- '3':'011',
- '4':'100',
- '5':'101',
- '6':'110',
- '7':'111'}
-
-def _binary(num):
- ostr = oct(num)
- bin = ''
- for ch in ostr[1:]:
- bin += _lkup[ch]
- ind = 0
- while bin[ind] == '0':
- ind += 1
- return bin[ind:]
-
class matrix(N.ndarray):
__array_priority__ = 10.0
@@ -163,7 +145,7 @@ class matrix(N.ndarray):
return result
# binary decomposition to reduce the number of Matrix
# Multiplies for other > 3.
- beta = _binary(other)
+ beta = binary_repr(other)
t = len(beta)
Z,q = x.copy(),0
while beta[t-q-1] == '0':