[Numpy-tickets] [NumPy] #413: Reduction with noncommutative ufuncs is broken

NumPy numpy-tickets at scipy.net
Mon Jan 8 11:39:44 CST 2007


#413: Reduction with noncommutative ufuncs is broken
------------------------+---------------------------------------------------
 Reporter:  rkern       |        Owner:  oliphant
     Type:  defect      |       Status:  new     
 Priority:  high        |    Milestone:          
Component:  numpy.core  |      Version:  devel   
 Severity:  critical    |   Resolution:          
 Keywords:              |  
------------------------+---------------------------------------------------
Changes (by rkern):

  * owner:  somebody => oliphant

Comment:

 It appears to me that {{{construct_reduce()}}} and {{{PyUFunc_Reduce()}}}
 are using a bad ordering of the member {{{char* bufptr[3]}}} in
 {{{PyUFuncReduceObject}}}. That array points to the three arguments to a
 binary ufunc (the last being the output argument). Those two functions
 treat {{{bufptr}}} as {input, output, output} when it ought to be {output,
 input, output} in order to correctly handle noncommutative ufuncs.

 I think this may be resolved by changing all instances of {{{bufptr[0]}}}
 and {{{bufptr[1]}}} in those functions, but my head hurts a little from
 reading that code. Travis, am I correct here?

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/413#comment:2>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list