Code optimization [message #75145] |
Wed, 16 February 2011 12:38  |
kisCA
Messages: 78 Registered: January 2011
|
Member |
|
|
Hi there,
I am trying, if it's possible to write thes lines in matrix formalism
but it seems a bit tricky for me.
FOR I=1,NUM DO BEGIN
SUMI=0.
FOR K=1,M1 DO BEGIN
FOR J=1,M1 DO BEGIN
SUMI=SUMI+COV(J-1,K-1)*CS(J-1,I-1)*CS(K-1,I-1)
ENDFOR
ENDFOR
VAR_ALPHA(I-1)=SUMI*VAR_FACTOR(I-1)
ENDFOR
Is anyone got an idea it will be welcome
Cheers
|
|
|
|
Re: Code optimization [message #75187 is a reply to message #75145] |
Fri, 18 February 2011 06:46  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
Here are a couple of tongue-in-cheek ones:
- If it doesn't involve HISTOGRAM, it's too slow.
- The shorter actual code, the faster it will be (it's not true, but it correlates surprisingly well!)
-Jeremy.
|
|
|
Re: Code optimization [message #75196 is a reply to message #75145] |
Thu, 17 February 2011 13:14  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth P. Bowman writes:
> This seems sure to start a discussion. ;-)
Or, another book! ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|