comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » array indexing question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
array indexing question [message #31442] Thu, 11 July 2002 15:57 Go to previous message
mmiller3 is currently offline  mmiller3
Messages: 81
Registered: January 2002
Member
I'm doing some calculations to calculate mutual information and I
have a question about the most efficient/slickest way to
calculate the sum. I wonder if there is a loop-free way to do
this.

I have three arrays, pa, pb and pab. pa and pb are both 1D
arrays of length N and pab is a 2D NxN array. I want to
calculate the sum of pab[i,j]*alog(pab[i,j])/pa[i]/pb[j]. I know
that I can do things like total( pa * alog(pa) ) when I'm dealing
with a single array. Any suggestions for how to do my first sum
most efficiently?

Mike

--
Michael A. Miller mmiller3@iupui.edu
Imaging Sciences, Department of Radiology, IU School of Medicine
[Message index]
 
Read Message
Read Message
Previous Topic: Array indexing
Next Topic: widget layout

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:39:41 PDT 2025

Total time taken to generate the page: 0.00574 seconds