From 83d207539b88d1a45e2ca34b2934781f80117071 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 20 Oct 2005 07:28:45 +0000 Subject: Tried different ones algorithm. Wasn't faster. --- scipy/base/numeric.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scipy/base/numeric.py') 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_): -- cgit v1.2.1