Numeric write-in place facility

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Nov 29 10:27:41 EST 1999


"Ionel Simionescu" <ionel at psy.uva.nl> writes:

> Playing around I see now that other ufuncs allow a write-in target
> specification as their last argument. For example,
> 
> Numeric.sqrt(a,b)
> 
> will put the result in b (if its dimension and type are Ok).
> 
> The docs do not tell much about this.
> Can anyone confirm/clarify/comment ?

I can confirm that the feature exists and that it is well hidden ;-)

This was implemented to permit the fast evaluation of complicated
formulas without the allocation of temporary arrays for each
intermediate. Using this approach means more work and less readable
code, but also faster execution and lower memory needs.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the Python-list mailing list