# HG changeset patch # User dbateman # Date 1174507983 0 # Node ID 6ff2d413cf58dffbfe2a0ba75bc557398676a0bd # Parent 1a59ba7d32f0d9f2dce428fbd9467e7b93a2311e [project @ 2007-03-21 20:13:03 by dbateman] diff -r 1a59ba7d32f0 -r 6ff2d413cf58 scripts/ChangeLog --- a/scripts/ChangeLog Wed Mar 21 18:57:07 2007 +0000 +++ b/scripts/ChangeLog Wed Mar 21 20:13:03 2007 +0000 @@ -1,7 +1,8 @@ -2007-03-20 David Bateman +2007-03-21 David Bateman * plot/__go_draw_axes__.m: Handle some colors with older gnuplot. - + * testfun/speed.m: Documentation and example fix. + 2007-03-21 John W. Eaton * plot/subplot.m: If we find an existing subplot region, set diff -r 1a59ba7d32f0 -r 6ff2d413cf58 scripts/testfun/speed.m --- a/scripts/testfun/speed.m Wed Mar 21 18:57:07 2007 +0000 +++ b/scripts/testfun/speed.m Wed Mar 21 20:13:03 2007 +0000 @@ -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.");