[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Computation time for newcommer
From: |
Joza |
Subject: |
Re: Computation time for newcommer |
Date: |
Sat, 29 Sep 2012 14:49:16 -0700 (PDT) |
Thanks for the input! I know it is a terrible algorithm for computing pi -
it's just an exercise.
So I think I have learned two things:
1) Using vectors instead of for loops is faster, as it uses the vector math
optimizations of the processor?
2) In my assignment of x(i) = x(i+1), there exists 2 arrays in memory - 1
for x(i), and then this is copied to a new memory location and the i+1 term
is added. So if I initialize the array to n=zeroes, there will always just
exist 1 array in memory, and hence save space?
Am I right?!
Thanks again!
--
View this message in context:
http://octave.1599824.n4.nabble.com/Computation-time-for-newcommer-tp4644594p4644778.html
Sent from the Octave - General mailing list archive at Nabble.com.