[Numpy-tickets] [NumPy] #425: Faster clip for scalar clipping values

NumPy numpy-tickets at scipy.net
Wed Jan 24 23:54:11 CST 2007

#425: Faster clip for scalar clipping values
 Reporter:  david cournapeau  |        Owner:  somebody
     Type:  enhancement       |       Status:  new     
 Priority:  normal            |    Milestone:          
Component:  Other             |      Version:  devel   
 Severity:  normal            |   Resolution:          
 Keywords:                    |  
Comment (by oliphant):

 The "magic function lists" are all of your
 @TYPE at _numeric_native_scalar_clip functions in clip_imp.inc.src.   These
 functions should all be added to and attached to the .f member of the
 relevant data-type structure.  Then, any data-type that somebody adds can
 participate in the speed-up as long as this member is present.

 Then, a switch-statement just checks for the existence of this function
 and calls it if it is present.

 Mixed-type is handled using the coercion rules established (scalars do not
 tell arrays how to behave unless they are of a different kind) and
 automatic coercion is done otherwise.   Coercion occurs to a single data-
 type and the function of that data-type is called.

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

More information about the Numpy-tickets mailing list