On 1/16/07, Rick White <[EMAIL PROTECTED]> wrote: > On Jan 15, 2007, at 10:41 PM, David Cournapeau wrote: > > > Concerning the point of avoiding allocating new storage, I am a bit > > suspicious: if the types do not match, and the casting is done at the > > end, then it means all internal computation will be done is whatever > > type is chosen by the function (I am using PyArray_CommonType for > > that), > > and the cast done at the end, meaning new storage. > > Presumably you should do what ufuncs do: divide the computation up > into blocks when the array is big. If a cast is required then you do > the computation for each block, allocating new storage for that > block. Then you do the cast for the block and copy it to the output > array. > Well, at that point, why not making clip a ufunc, then... I was already wondering about that, but I don't know much about ufunc on C side.
David _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion