[Numpy-discussion] partial computations

santhu kumar mesanthu@gmail....
Wed Apr 11 22:38:20 CDT 2012

Hello all,

I am trying to optimise a code and want your suggestions.
A : - NX3 matrix (coordinates of N points)

After performing pairwise distance computations(called pdist) between these
points, depending upon a condition that the distance is in, I would perform
further computations.
Most of the computations require schur products (element by element) of NXN
matrices with each other and then computing either the coloumn sum or row

As N goes to be large, these computations are taking some time (0.7 secs)
which is not much generally but since this is being called many times, it
acts as a bottleneck.
I want to leverage on the fact that many of the NXN computations are not
going to be used, or would be set to zero (if the pdist is greater than
some minimum distance).

How do i achieve it ?? Is masked array the elegant solution? Would it save
me time?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120411/357aa980/attachment.html 

More information about the NumPy-Discussion mailing list