On Thu, Jan 05, 2012 at 09:33:28AM -0800, Jacob VanderPlas wrote:
> In computing the mahalanobis distance, a temporary storage array is 
> needed.  To avoid repeated allocation within the distance C-function 
> (and to avoid the need for malloc/free), I pre-allocate this temporary 
> array via numpy and store the pointer in the parameter structure.  A 
> more informative name for 'tmp' would probably help, as well as some 
> in-line documentation :)

Beautiful solution! Just add a comment explaining it, for dense people
like me. I would also call this variable something like tmp_buffer.

G

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to