|
From: | Barbara Lócsi |
Subject: | Testing for time? |
Date: | Wed, 3 Aug 2016 01:14:44 +0200 |
Dear all,
As far as I know there is no tests in Octave that tests the time passed with tic toc or cputime.
I am working on new calling forms for eig() (GSoC). In Matlab in case of a generalized eigenvalue problem you can choose which algorithm you want to use('chol' or 'qz').
'chol' supposed to be faster for large-scale inputs(symmetric), and sometimes it is more accurate (and sometimes not). But when it is not, the only reason to use it is because it is supposed to be faster, so it makes sense to be tested.
For example, wouldn't something like Carnë wrote work? :
alg1_t = 0;
alg2_t = 0;
for i = 1:10
## generate input each time to avoid cache
worst = gallery (...);
t0 = cputime ();
[x, ...] = foo (worst, ..., "alg1");
alg1_t += cputime () - t0;
worst = gallery (...);
t0 = cputime ();
[x, ...] = foo (worst, ..., "alg2");
alg2_t += cputime () - t0;
endfor
assert ((alg1_t * 100) < alg2_t)
What is your opinion about this?
[Prev in Thread] | Current Thread | [Next in Thread] |