[Numpy-discussion] minor improvment to ones

Neal Becker ndbecker2@gmail....
Fri Jan 30 08:22:46 CST 2009


Right now there are 2 options to create an array of constant value:

1) empty (size); fill (val)

2) ones (size) * val

1 has disadvantage of not being an expression, so can't be an arg to a 
function call.  Also probably slower than create+fill @ same time

2 is probably slower than create+fill @ same time

Now what would be _really_ cool is a special array type that would represent 
a constant array without wasting memory.  boost::ublas, for example, has 
this feature.





More information about the Numpy-discussion mailing list