performance hit with functions of vectors
augustm
augustmiles at yahoo.com
Fri Jan 4 08:32:57 CST 2008
Dear David,
the information you provided was most useful.
1) Firstly why is the vector sparse? I am calculating it as
octave> zz=diag(u);
where u is from a LU factorization. The thing that was
shocking me was the discovery that performing the full factorization
octave> [l u p q]= lu(M);
was much slower than working with the diagonal elements of the result.
I need the the log-function for an application in quantum
mechanics.
Note, there are no elements of value zero in the vector. They are all positive
and "non extreme" 0.25<zz<146
however converting to full does work to speed things up.
octave:1> tic; j=log(zz); toc
Elapsed time is 0.58444 seconds.
octave:2> tic; j=log(full(zz)); toc
Elapsed time is 0.0019059 seconds.
There is thus a "delicate" interaction between sparse behaviour and
function application.
But Thank You again for putting me on the right track!
TM,
Paris 05.
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
More information about the Bug-octave
mailing list