diff options
author | cookedm <cookedm@localhost> | 2006-07-06 16:57:20 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-07-06 16:57:20 +0000 |
commit | 6782a92fd1a7625ee48f6b2946a7d7149ab28a77 (patch) | |
tree | 177a92f0673655b58b247e663477af06ac1192b6 /numpy/oldnumeric/olddefaults.py | |
parent | 216f071ab060a6f08c22666aea33f7095f079d1e (diff) | |
download | numpy-6782a92fd1a7625ee48f6b2946a7d7149ab28a77.tar.gz |
Branch numpy.distutils to distutils-revamp
Diffstat (limited to 'numpy/oldnumeric/olddefaults.py')
-rw-r--r-- | numpy/oldnumeric/olddefaults.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/numpy/oldnumeric/olddefaults.py b/numpy/oldnumeric/olddefaults.py deleted file mode 100644 index 356f5f00c..000000000 --- a/numpy/oldnumeric/olddefaults.py +++ /dev/null @@ -1,45 +0,0 @@ -__all__ = ['ones', 'empty', 'identity', 'zeros', 'eye', 'tri'] - -import numpy.core.multiarray as mu -import numpy.core.numeric as nn - -def ones(shape, dtype=int, order='C'): - """ones(shape, dtype=int) returns an array of the given - dimensions which is initialized to all ones. - """ - a = mu.empty(shape, dtype, order) - a.fill(1) - return a - -def zeros(shape, dtype=int, order='C'): - """zeros(shape, dtype=int) returns an array of the given - dimensions which is initialized to all zeros - """ - return mu.zeros(shape, dtype, order) - -def identity(n,dtype=int): - """identity(n) returns the identity 2-d array of shape n x n. - """ - return nn.identity(n, dtype) - -def eye(N, M=None, k=0, dtype=int): - """ eye returns a N-by-M 2-d array where the k-th diagonal is all ones, - and everything else is zeros. - """ - if M is None: M = N - m = nn.equal(nn.subtract.outer(nn.arange(N), nn.arange(M)),-k) - if m.dtype != dtype: - return m.astype(dtype) - -def tri(N, M=None, k=0, dtype=int): - """ returns a N-by-M array where all the diagonals starting from - lower left corner up to the k-th are all ones. - """ - if M is None: M = N - m = nn.greater_equal(nn.subtract.outer(nn.arange(N), nn.arange(M)),-k) - if m.dtype != dtype: - return m.astype(dtype) - -def empty(shape, dtype=int, order='C'): - return mu.empty(shape, dtype, order) - |