[Numpy-discussion] New ufuncs

Charles R Harris charlesr.harris@gmail....
Tue Nov 4 23:26:38 CST 2008


Hi All,

I'm thinking of adding some new ufuncs. Some possibilities are

   - expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs:
   - absdiff(a,b) = abs(a - b) -- Useful for forming norms
   - absmax(a,b) = max(abs(a), abs(b))
   - absadd(a,b) = abs(a) + abs(b) -- Useful for L_1 norm and inequalities?

I would really like a powadd = abs(a)**p + abs(b)**p, but I can't think of
an easy way to pass a variable p that is compatible with the way ufuncs work
without going to three variables, something that might not work with the
reduce functions. Along these lines I also think it is time to review
generalized ufuncs to see what we can do with them. Thoughts?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081104/da707e2c/attachment.html 


More information about the Numpy-discussion mailing list