very very very slow computing

Depo ste_depo at yahoo.it
Fri Feb 6 10:04:47 CST 2009


Hi everybody,

I was just trying making some simple operations on a large matrix (10, 3000)
and I faced off o very slow computational time comparing to the simple
operation I was attempting to do. Looking for the problem I saw that even
copying same values to a new matrix was a computationally huge
operation!!!!!!!!!!!!!

That is the code:

clear new_sign_difference;                                        #to ensure
it is emty
i=1; k=1;
while (k <= n_rows)                                                  #I have
used while statement instead of for because some says it is faster... 
while (i <= n_cols) 
new_sign_difference(k,i)=sign_difference(k,i)           #reassign same
values to a new matrix
disp(i);
disp(k);
i++;
endwhile
k++; i=1;
endwhile  

the matrix sign_difference has size 10x3'000, so this is a 30'000-operation
loop. It takes up to 10
minutes!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If I only visualize on screen matrix' values it takes 1
second............................., here is the code:


clear new_sign_difference; 
i=1; k=1;
while (k <= n_rows) 
while (i <= n_cols) 
sign_difference(k,i)                #only to screen, without writing on a
new matrix
disp(i);
disp(k);
i++;
endwhile
k++; i=1;
endwhile  


How is it possible?????????????????????????????????????
Please help me, I'm getting crazy and I can't work at all at these
conditions..........................


Tanks everybody 
-- 
View this message in context: http://www.nabble.com/very-very-very-slow-computing-tp21875383p21875383.html
Sent from the Octave - General mailing list archive at Nabble.com.



More information about the Help-octave mailing list