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

Home » Public Forums » archive » correlation matrix
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: correlation matrix [message #35462 is a reply to message #35323] Wed, 11 June 2003 18:18 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
kevinlausten@hotmail.com (Kevin M. Lausten) writes:
> I have written code to create the correlation matix of a data cube,
> however, it seems to run slower than I would expect. I am I doing
> anything inefficiently?
>
> for r = 0, (nrows-1) do begin
> for c = 0, (ncols-1) do begin
> ;sum = 0
> for bb = 0, (nbands-1) do begin
> ref(bb) = in_cube(bb, c, r)
> ; 'ref' equals 'back_cube' for all values of 'bb' at location
> ; (c, r)
> endfor

Whatever the IN_CUBE() is, it will be the limiting factor in your
snippet, since it is in the innermost loop. If you can vectorize
IN_CUBE over BB then your routine should be faster.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Redirect STDOUT
Next Topic: IDL and DODS (OpenDAP) data?

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

Current Time: Fri Dec 05 01:31:57 PST 2025

Total time taken to generate the page: 1.52615 seconds