comparison scripts/testfun/speed.m @ 10549:95c3e38098bf

Untabify .m scripts
author Rik <code@nomad.inbox5.com>
date Fri, 23 Apr 2010 11:28:50 -0700
parents 1bf0ce0930be
children 3140cb7a05a1
comparison
equal deleted inserted replaced
10548:479536c5bb10 10549:95c3e38098bf
222 __tnew(k) = __t; 222 __tnew(k) = __t;
223 223
224 if (! isempty (__f2)) 224 if (! isempty (__f2))
225 eval (cstrcat ("__t = time();", __f2, "; __v2=ans; __t = time()-__t;")); 225 eval (cstrcat ("__t = time();", __f2, "; __v2=ans; __t = time()-__t;"));
226 if (__t < 0.25) 226 if (__t < 0.25)
227 eval (cstrcat ("__t2 = time();", __f2, "; __t2 = time()-__t2;")); 227 eval (cstrcat ("__t2 = time();", __f2, "; __t2 = time()-__t2;"));
228 eval (cstrcat ("__t3 = time();", __f2, "; __t3 = time()-__t3;")); 228 eval (cstrcat ("__t3 = time();", __f2, "; __t3 = time()-__t3;"));
229 endif 229 endif
230 __torig(k) = __t; 230 __torig(k) = __t;
231 if (! isinf(__tol)) 231 if (! isinf(__tol))
232 assert (__v1, __v2, __tol); 232 assert (__v1, __v2, __tol);
233 endif 233 endif
234 endif 234 endif
235 endfor 235 endfor
236 236
237 ## Drop times of zero. 237 ## Drop times of zero.
262 endif 262 endif
263 263
264 if (doplot && ! isempty (__f2)) 264 if (doplot && ! isempty (__f2))
265 subplot (1, 2, 1); 265 subplot (1, 2, 1);
266 semilogx (__test_n, __torig./__tnew, 266 semilogx (__test_n, __torig./__tnew,
267 cstrcat ("-*r;", strrep (__f1, ";", "."), "/", 267 cstrcat ("-*r;", strrep (__f1, ";", "."), "/",
268 strrep (__f2, ";", "."), ";"), 268 strrep (__f2, ";", "."), ";"),
269 __test_n, __tnew./__torig, 269 __test_n, __tnew./__torig,
270 cstrcat ("-*g;", strrep (__f2, ";", "."), "/", 270 cstrcat ("-*g;", strrep (__f2, ";", "."), "/",
271 strrep (__f1, ";", "."), ";")); 271 strrep (__f1, ";", "."), ";"));
272 xlabel ("test length"); 272 xlabel ("test length");
273 title (__f1); 273 title (__f1);
274 ylabel ("speedup ratio"); 274 ylabel ("speedup ratio");
275 275
276 subplot (1, 2, 2); 276 subplot (1, 2, 2);
277 loglog (__test_n, __tnew*1000, 277 loglog (__test_n, __tnew*1000,
278 cstrcat ("*-g;", strrep (__f1, ";", "."), ";"), 278 cstrcat ("*-g;", strrep (__f1, ";", "."), ";"),
279 __test_n, __torig*1000, 279 __test_n, __torig*1000,
280 cstrcat ("*-r;", strrep (__f2,";","."), ";")); 280 cstrcat ("*-r;", strrep (__f2,";","."), ";"));
281 281
282 xlabel ("test length"); 282 xlabel ("test length");
283 ylabel ("best execution time (ms)"); 283 ylabel ("best execution time (ms)");
284 title (cstrcat ("init: ", __init)); 284 title (cstrcat ("init: ", __init));
285 285