help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

very very very slow computing


From: Depo
Subject: very very very slow computing
Date: Fri, 6 Feb 2009 08:04:47 -0800 (PST)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]