summaryrefslogtreecommitdiff
path: root/scipy/base/numeric.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-10-20 07:28:45 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-10-20 07:28:45 +0000
commit83d207539b88d1a45e2ca34b2934781f80117071 (patch)
treeff9c9c6f91dde20073d285b28158d796e827409d /scipy/base/numeric.py
parent8bc53bd09afa8be668fcd50f67542f2e21ce2d65 (diff)
downloadnumpy-83d207539b88d1a45e2ca34b2934781f80117071.tar.gz
Tried different ones algorithm. Wasn't faster.
Diffstat (limited to 'scipy/base/numeric.py')
-rw-r--r--scipy/base/numeric.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scipy/base/numeric.py b/scipy/base/numeric.py
index f2009b8bf..ce631e016 100644
--- a/scipy/base/numeric.py
+++ b/scipy/base/numeric.py
@@ -248,8 +248,11 @@ def ones(shape, dtype=int_, fortran=0):
"""ones(shape, dtype=int_) returns an array of the given
dimensions which is initialized to all ones.
"""
- a = empty(shape, dtype, fortran)
- a.fill(1)
+ # This appears to be slower...
+ #a = empty(shape, dtype, fortran)
+ #a.fill(1)
+ a = zeros(shape, dtype, fortran)
+ a+=1
return a
def identity(n,dtype=int_):