Mercurial > hg > octave-lojdl
changeset 6429:6ff2d413cf58
[project @ 2007-03-21 20:13:03 by dbateman]
author | dbateman |
---|---|
date | Wed, 21 Mar 2007 20:13:03 +0000 |
parents | 1a59ba7d32f0 |
children | 215b141470b4 |
files | scripts/ChangeLog scripts/testfun/speed.m |
diffstat | 2 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,7 +1,8 @@ -2007-03-20 David Bateman <dbateman@free.fr> +2007-03-21 David Bateman <dbateman@free.fr> * plot/__go_draw_axes__.m: Handle some colors with older gnuplot. - + * testfun/speed.m: Documentation and example fix. + 2007-03-21 John W. Eaton <jwe@octave.org> * plot/subplot.m: If we find an existing subplot region, set
--- a/scripts/testfun/speed.m +++ b/scripts/testfun/speed.m @@ -51,8 +51,9 @@ ## results of expression @var{f} and expression @var{f2}. Otherwise, ## expression @var{f} should produce a value @var{v} and expression @var{f2} ## should produce a value @var{v2}, and these shall be compared using -## @code{assert(@var{v},@var{v2},@var{tol})}. The default is -## @code{eps}. +## @code{assert(@var{v},@var{v2},@var{tol})}. If @var{tol} is positive, +## the tolerance is assumed to be absolutr. If @var{tol} is negative, +## the tolerance is assumed to be relative. The default is @code{eps}. ## ## @item @var{order} ## The time complexity of the expression @code{O(a n^p)}. This @@ -122,9 +123,9 @@ ## ## @example ## speed("v=xcorr(x,n)", "x=rand(128,1);", 100, ... -## "v2=xcorr_orig(x,n)", 100*eps,'rel') +## "v2=xcorr_orig(x,n)", -100*eps) ## speed("v=xcorr(x,15)", "x=rand(20+n,1);", 100, ... -## "v2=xcorr_orig(x,n)", 100*eps,'rel') +## "v2=xcorr_orig(x,n)", -100*eps) ## @end example ## ## Assuming one of the two versions is in @var{xcorr_orig}, this would @@ -315,11 +316,10 @@ %! disp("-----------------------"); %! %! disp("Preallocated vector test.\nThis takes a little while..."); -%! speed('build', 'build_orig', 1000, 'v=n;'); +%! speed('build(n)', '', 1000, 'build_orig(n)'); %! clear build build_orig %! disp("Note how much faster it is to pre-allocate a vector."); %! disp("Notice the peak speedup ratio."); -%! clear build build_orig %! endif %!demo if 1 @@ -343,7 +343,7 @@ %! disp("-----------------------"); %! %! disp("Vectorized test. This takes a little while..."); -%! speed('build', 'build_orig', 1000, 'v=n;'); +%! speed('build(n)', '', 1000, 'build_orig(n)'); %! clear build build_orig %! disp("-----------------------"); %! disp("This time, the for loop is done away with entirely.");