# HG changeset patch # User Rik # Date 1377703658 25200 # Node ID b81b9d079515fc60486fbee7755e918b72c680ee # Parent 583306fe7e4fc72adcd1143079361c6431f74c46 Use '##' for comments which stand alone on a line. * libinterp/corefcn/besselj.cc, libinterp/corefcn/conv2.cc, libinterp/corefcn/pinv.cc, libinterp/corefcn/rand.cc, libinterp/corefcn/regexp.cc, libinterp/corefcn/sqrtm.cc, libinterp/dldfcn/qr.cc, libinterp/parse-tree/pt-eval.cc, scripts/general/cplxpair.m, scripts/general/repmat.m, scripts/help/doc.m, scripts/help/doc_cache_create.m, scripts/image/colorcube.m, scripts/image/hsv2rgb.m, scripts/image/image.m, scripts/io/strread.m, scripts/io/textscan.m, scripts/miscellaneous/bzip2.m, scripts/miscellaneous/edit.m, scripts/miscellaneous/gzip.m, scripts/optimization/__all_opts__.m, scripts/optimization/fminbnd.m, scripts/optimization/sqp.m, scripts/pkg/private/get_forge_pkg.m, scripts/plot/area.m, scripts/plot/stemleaf.m, scripts/plot/surfc.m, scripts/plot/uiresume.m, scripts/plot/zlabel.m, scripts/polynomial/mkpp.m, scripts/polynomial/ppval.m, scripts/set/intersect.m, scripts/signal/freqz.m, scripts/sparse/pcg.m, scripts/sparse/pcr.m, scripts/sparse/svds.m, scripts/sparse/treelayout.m, scripts/specfun/ellipke.m, scripts/special-matrix/toeplitz.m, scripts/strings/dec2base.m, scripts/strings/strsplit.m, scripts/testfun/test.m, test/build-sparse-tests.sh, test/index.tst, test/system.tst: Use '##' for comments which stand alone on a line. diff -r 583306fe7e4f -r b81b9d079515 libinterp/corefcn/besselj.cc --- a/libinterp/corefcn/besselj.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/corefcn/besselj.cc Wed Aug 28 08:27:38 2013 -0700 @@ -649,11 +649,10 @@ } /* -%! # Test values computed with GP/PARI version 2.3.3 -%! +## Test values computed with GP/PARI version 2.3.3 %!shared alpha, x, jx, yx, ix, kx, nix %! -%! # Bessel functions, even order, positive and negative x +%! ## Bessel functions, even order, positive and negative x %! alpha = 2; x = 1.25; %! jx = 0.1710911312405234823613091417; %! yx = -1.193199310178553861283790424; @@ -706,7 +705,7 @@ %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps) %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps) %! -%! # Bessel functions, odd order, positive and negative x +%! ## Bessel functions, odd order, positive and negative x %! alpha = 3; x = 2.5; %! jx = 0.2166003910391135247666890035; %! yx = -0.7560554967536709968379029772; @@ -761,7 +760,7 @@ %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps) %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps) %! -%! # Bessel functions, fractional order, positive and negative x +%! ## Bessel functions, fractional order, positive and negative x %! %! alpha = 3.5; x = 2.75; %! jx = 0.1691636439842384154644784389; @@ -819,7 +818,7 @@ %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps) %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps) %! -%! # Bessel functions, even order, complex x +%! ## Bessel functions, even order, complex x %! %! alpha = 2; x = 1.25 + 3.625 * I; %! jx = -1.299533366810794494030065917 + 4.370833116012278943267479589*I; @@ -855,7 +854,7 @@ %!assert (besselh (-alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps) %!assert (besselh (-alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps) %! -%! # Bessel functions, odd order, complex x +%! ## Bessel functions, odd order, complex x %! %! alpha = 3; x = 2.5 + 1.875 * I; %! jx = 0.1330721523048277493333458596 + 0.5386295217249660078754395597*I; @@ -891,7 +890,7 @@ %!assert (besselh (-alpha,1,x,1), -(jx + I*yx)*exp(-I*x), 100*eps) %!assert (besselh (-alpha,2,x,1), -(jx - I*yx)*exp(I*x), 100*eps) %! -%! # Bessel functions, fractional order, complex x +%! ## Bessel functions, fractional order, complex x %! %! alpha = 3.5; x = 1.75 + 4.125 * I; %! jx = -3.018566131370455929707009100 - 0.7585648436793900607704057611*I; diff -r 583306fe7e4f -r b81b9d079515 libinterp/corefcn/conv2.cc --- a/libinterp/corefcn/conv2.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/corefcn/conv2.cc Wed Aug 28 08:27:38 2013 -0700 @@ -277,7 +277,7 @@ %! y = ones (5); %! A = conv2 (x, y)(5:end-4,5:end-4); %! B = conv2 (x, y, "valid"); -%! assert (B, A); ## Yes, this test is for *exact* equivalence. +%! assert (B, A); # Yes, this test is for *exact* equivalence. %% Test input validation diff -r 583306fe7e4f -r b81b9d079515 libinterp/corefcn/pinv.cc --- a/libinterp/corefcn/pinv.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/corefcn/pinv.cc Wed Aug 28 08:27:38 2013 -0700 @@ -172,12 +172,12 @@ /* %!shared a, b, tol, hitol, d, u, x, y -%! a = reshape (rand*[1:16], 4, 4); ## Rank 2 matrix +%! a = reshape (rand*[1:16], 4, 4); # Rank 2 matrix %! b = pinv (a); %! tol = 4e-14; %! hitol = 40*sqrt (eps); %! d = diag ([rand, rand, hitol, hitol]); -%! u = rand (4); ## Could be singular by freak accident +%! u = rand (4); # Could be singular by freak accident %! x = inv (u)*d*u; %! y = pinv (x, sqrt (eps)); %! diff -r 583306fe7e4f -r b81b9d079515 libinterp/corefcn/rand.cc --- a/libinterp/corefcn/rand.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/corefcn/rand.cc Wed Aug 28 08:27:38 2013 -0700 @@ -49,7 +49,7 @@ /* %!shared __random_statistical_tests__ -%! # Flag whether the statistical tests should be run in "make check" or not +%! ## Flag whether the statistical tests should be run in "make check" or not %! __random_statistical_tests__ = 0; */ @@ -502,16 +502,16 @@ /* %!test -%! # Test fixed state +%! ## Test fixed state %! rand ("state", 1); %! assert (rand (1,6), [0.1343642441124013 0.8474337369372327 0.763774618976614 0.2550690257394218 0.495435087091941 0.4494910647887382], 1e-6); %!test -%! # Test fixed seed +%! ## Test fixed seed %! rand ("seed", 1); %! assert (rand (1,6), [0.8668024251237512 0.9126510815694928 0.09366085007786751 0.1664607301354408 0.7408077004365623 0.7615650338120759], 1e-6); %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! rand ("state", 12); %! x = rand (100000, 1); %! assert (max (x) < 1); #*** Please report this!!! *** @@ -523,7 +523,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! rand ("seed", 12); %! x = rand (100000, 1); %! assert (max (x) < 1); #*** Please report this!!! *** @@ -593,16 +593,16 @@ /* %!test -%! # Test fixed state +%! ## Test fixed state %! randn ("state", 1); %! assert (randn (1, 6), [-2.666521678978671 -0.7381719971724564 1.507903992673601 0.6019427189162239 -0.450661261143348 -0.7054431351574116], 1e-6); %!test -%! # Test fixed seed +%! ## Test fixed seed %! randn ("seed", 1); %! assert (randn (1, 6), [-1.039402365684509 -1.25938892364502 0.1968704611063004 0.3874166905879974 -0.5976632833480835 -0.6615074276924133], 1e-6); %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randn ("state", 12); %! x = randn (100000, 1); %! assert (mean (x), 0, 0.01); @@ -612,7 +612,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randn ("seed", 12); %! x = randn (100000, 1); %! assert (mean (x), 0, 0.01); @@ -664,16 +664,16 @@ /* %!test -%! # Test fixed state +%! ## Test fixed state %! rande ("state", 1); %! assert (rande (1, 6), [3.602973885835625 0.1386190677555021 0.6743112889616958 0.4512830847258422 0.7255744741233175 0.3415969205292291], 1e-6); %!test -%! # Test fixed seed +%! ## Test fixed seed %! rande ("seed", 1); %! assert (rande (1, 6), [0.06492075175653866 1.717980206012726 0.4816154008731246 0.5231300676241517 0.103910739364359 1.668931916356087], 1e-6); %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally +%! ## statistical tests may fail occasionally %! rande ("state", 1); %! x = rande (100000, 1); %! assert (min (x) > 0); # *** Please report this!!! *** @@ -684,7 +684,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally +%! ## statistical tests may fail occasionally %! rande ("seed", 1); %! x = rande (100000, 1); %! assert (min (x)>0); # *** Please report this!!! *** @@ -812,49 +812,49 @@ %! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); # *** Please report %!test -%! # Test fixed state +%! ## Test fixed state %! randg ("state", 1); %! assert (randg (0.1, 1, 6), [0.0103951513331241 8.335671459898252e-05 0.00138691397249762 0.000587308416993855 0.495590518784736 2.3921917414795e-12], 1e-6); %!test -%! # Test fixed state +%! ## Test fixed state %! randg ("state", 1); %! assert (randg (0.95, 1, 6), [3.099382433255327 0.3974529788871218 0.644367450750855 1.143261091802246 1.964111762696822 0.04011915547957939], 1e-6); %!test -%! # Test fixed state +%! ## Test fixed state %! randg ("state", 1); %! assert (randg (1, 1, 6), [0.2273389379645993 1.288822625058359 0.2406335209340746 1.218869553370733 1.024649860162554 0.09631230343599533], 1e-6); %!test -%! # Test fixed state +%! ## Test fixed state %! randg ("state", 1); %! assert (randg (10, 1, 6), [3.520369644331133 15.15369864472106 8.332112081991205 8.406211067432674 11.81193475187611 10.88792728177059], 1e-5); %!test -%! # Test fixed state +%! ## Test fixed state %! randg ("state", 1); %! assert (randg (100, 1, 6), [75.34570255262264 115.4911985594699 95.23493031356388 95.48926019250911 106.2397448229803 103.4813150404118], 1e-4); %!test -%! # Test fixed seed +%! ## Test fixed seed %! randg ("seed", 1); %! assert (randg (0.1, 1, 6), [0.07144210487604141 0.460641473531723 0.4749028384685516 0.06823389977216721 0.000293838675133884 1.802567535340305e-12], 1e-6); %!test -%! # Test fixed seed +%! ## Test fixed seed %! randg ("seed", 1); %! assert (randg (0.95, 1, 6), [1.664905071258545 1.879976987838745 1.905677795410156 0.9948706030845642 0.5606933236122131 0.0766092911362648], 1e-6); %!test -%! # Test fixed seed +%! ## Test fixed seed %! randg ("seed", 1); %! assert (randg (1, 1, 6), [0.03512085229158401 0.6488978862762451 0.8114678859710693 0.1666885763406754 1.60791552066803 1.90356981754303], 1e-6); %!test -%! # Test fixed seed +%! ## Test fixed seed %! randg ("seed", 1); %! assert (randg (10, 1, 6), [6.566435813903809 10.11648464202881 10.73162078857422 7.747178077697754 6.278522491455078 6.240195751190186], 1e-5); %!test -%! # Test fixed seed +%! ## Test fixed seed %! randg ("seed", 1); %! assert (randg (100, 1, 6), [89.40208435058594 101.4734725952148 103.4020004272461 93.62763214111328 88.33104705810547 88.1871337890625], 1e-4); %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("state", 12); %! a = 0.1; %! x = randg (a, 100000, 1); @@ -865,7 +865,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("state", 12); %! a = 0.95; %! x = randg (a, 100000, 1); @@ -876,7 +876,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("state", 12); %! a = 1; %! x = randg (a, 100000, 1); @@ -887,7 +887,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("state", 12); %! a = 10; %! x = randg (a, 100000, 1); @@ -898,7 +898,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("state", 12); %! a = 100; %! x = randg (a, 100000, 1); @@ -912,7 +912,7 @@ %!assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]) # *** Please report %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("seed", 12); %! a = 0.1; %! x = randg (a, 100000, 1); @@ -923,7 +923,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("seed", 12); %! a = 0.95; %! x = randg (a, 100000, 1); @@ -934,7 +934,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("seed", 12); %! a = 1; %! x = randg (a, 100000, 1); @@ -945,7 +945,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("seed", 12); %! a = 10; %! x = randg (a, 100000, 1); @@ -956,7 +956,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randg ("seed", 12); %! a = 100; %! x = randg (a, 100000, 1); @@ -1034,33 +1034,33 @@ %! randp ("state", 12); %! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); # *** Please report %!test -%! # Test fixed state +%! ## Test fixed state %! randp ("state", 1); %! assert (randp (5, 1, 6), [5 5 3 7 7 3]) %!test -%! # Test fixed state +%! ## Test fixed state %! randp ("state", 1); %! assert (randp (15, 1, 6), [13 15 8 18 18 15]) %!test -%! # Test fixed state +%! ## Test fixed state %! randp ("state", 1); %! assert (randp (1e9, 1, 6), [999915677 999976657 1000047684 1000019035 999985749 999977692], -1e-6) %!test -%! # Test fixed state +%! ## Test fixed state %! randp ("seed", 1); %! %%assert (randp (5, 1, 6), [8 2 3 6 6 8]) %! assert (randp (5, 1, 5), [8 2 3 6 6]) %!test -%! # Test fixed state +%! ## Test fixed state %! randp ("seed", 1); %! assert (randp (15, 1, 6), [15 16 12 10 10 12]) %!test -%! # Test fixed state +%! ## Test fixed state %! randp ("seed", 1); %! assert (randp (1e9, 1, 6), [1000006208 1000012224 999981120 999963520 999963072 999981440], -1e-6) %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randp ("state", 12); %! for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] %! x = randp (a (1), 100000, 1); @@ -1073,7 +1073,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randp ("state", 12); %! for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] %! x = randp (a(1)*ones (100000, 1), 100000, 1); @@ -1089,7 +1089,7 @@ %! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]); # *** Please report %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randp ("seed", 12); %! for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] %! x = randp (a(1), 100000, 1); @@ -1102,7 +1102,7 @@ %! endif %!test %! if (__random_statistical_tests__) -%! # statistical tests may fail occasionally. +%! ## statistical tests may fail occasionally. %! randp ("seed", 12); %! for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03] %! x = randp (a(1)*ones (100000, 1), 100000, 1); diff -r 583306fe7e4f -r b81b9d079515 libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/corefcn/regexp.cc Wed Aug 28 08:27:38 2013 -0700 @@ -925,7 +925,7 @@ ## Tests for named tokens %!test -%! # Parenthesis in named token (ie (int)) causes a problem +%! ## Parenthesis in named token (ie (int)) causes a problem %! assert (regexp ('qwe int asd', ['(?(int))'], 'names'), struct ('typestr', 'int')); %!test diff -r 583306fe7e4f -r b81b9d079515 libinterp/corefcn/sqrtm.cc --- a/libinterp/corefcn/sqrtm.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/corefcn/sqrtm.cc Wed Aug 28 08:27:38 2013 -0700 @@ -272,5 +272,5 @@ %! z = eye (4); z(2,2) = z(3,3) = 2^-13; z(1,4) = 0.5; %! [y, err] = sqrtm (x); %! assert (y, z); -%! assert (err, 0); ## Yes, this one has to hold exactly +%! assert (err, 0); # Yes, this one has to hold exactly */ diff -r 583306fe7e4f -r b81b9d079515 libinterp/dldfcn/qr.cc --- a/libinterp/dldfcn/qr.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/dldfcn/qr.cc Wed Aug 28 08:27:38 2013 -0700 @@ -1392,7 +1392,7 @@ %! assert (norm (vec (triu (R) - R), Inf) == 0); %! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single")); %!testif HAVE_QRUPDATE -%! # Same test as above but with more precicision +%! ## Same test as above but with more precicision %! AA = single ([0.091364 0.613038 0.027504 0.999083; %! 0.594638 0.425302 0.562834 0.603537; %! 0.383594 0.291238 0.742073 0.085574; diff -r 583306fe7e4f -r b81b9d079515 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Wed Aug 28 08:41:55 2013 +0100 +++ b/libinterp/parse-tree/pt-eval.cc Wed Aug 28 08:27:38 2013 -0700 @@ -810,18 +810,18 @@ break; else { - // Clear preivous values before next statement is + // Clear previous values before next statement is // evaluated so that we aren't holding an extra // reference to a value that may be used next. For // example, in code like this: // - // X = rand (N); ## refcount for X should be 1 - // ## after this statement + // X = rand (N); # refcount for X should be 1 + // # after this statement // - // X(idx) = val; ## no extra copy of X should be - // ## needed, but we will be faked - // ## out if retval is not cleared - // ## between statements here + // X(idx) = val; # no extra copy of X should be + // # needed, but we will be faked + // # out if retval is not cleared + // # between statements here // result_values = empty_list; } diff -r 583306fe7e4f -r b81b9d079515 scripts/general/cplxpair.m --- a/scripts/general/cplxpair.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/general/cplxpair.m Wed Aug 28 08:27:38 2013 -0700 @@ -161,6 +161,6 @@ %!assert (cplxpair ([z(randperm(7)),z(randperm(7))],[],1), [z,z]) %!assert (cplxpair ([z(randperm(7)).';z(randperm(7)).'],[],2), [z.';z.']) -%!## tolerance test +## tolerance test %!assert (cplxpair ([1i, -1i, 1+(1i*eps)],2*eps), [-1i, 1i, 1+(1i*eps)]) diff -r 583306fe7e4f -r b81b9d079515 scripts/general/repmat.m --- a/scripts/general/repmat.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/general/repmat.m Wed Aug 28 08:27:38 2013 -0700 @@ -117,7 +117,7 @@ cidx{2,i} = ones (1, idx (i)); endfor aaidx = aidx; - # add singleton dims + ## add singleton dims aaidx(2,:) = 1; A = reshape (A, aaidx(:)); x = reshape (A (cidx{:}), idx .* aidx); diff -r 583306fe7e4f -r b81b9d079515 scripts/help/doc.m --- a/scripts/help/doc.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/help/doc.m Wed Aug 28 08:27:38 2013 -0700 @@ -53,7 +53,7 @@ fname = ""; endif - # if GUI is running, let it display the function + ## if GUI is running, let it display the function if isguirunning () __octave_link_show_doc__ (fname); else diff -r 583306fe7e4f -r b81b9d079515 scripts/help/doc_cache_create.m --- a/scripts/help/doc_cache_create.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/help/doc_cache_create.m Wed Aug 28 08:27:38 2013 -0700 @@ -119,25 +119,25 @@ ## If 'directory' is not in the current path, add it so we search it dir_in_path = ismember (directory, ostrsplit (path (), pathsep ())); - # dirs not in path + ## dirs not in path if (! iscell (directory)) directory = {directory}; endif dirs_notpath = {directory{!dir_in_path}}; - # add them + ## add them if (! isempty (dirs_notpath)) cellfun (@addpath, dirs_notpath); endif - # create cache + ## create cache func = @(s_) create_cache (__list_functions__ (s_)); cache = cellfun (func, directory, 'UniformOutput', false); - # concatenate results + ## concatenate results cache = [cache{:}]; - #remove dirs form path + ## remove dirs form path if (! isempty (dirs_notpath)) cellfun (@rmpath, dirs_notpath); endif diff -r 583306fe7e4f -r b81b9d079515 scripts/image/colorcube.m --- a/scripts/image/colorcube.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/image/colorcube.m Wed Aug 28 08:27:38 2013 -0700 @@ -46,12 +46,12 @@ return; endif - # Create colorcube of evenly spaced points with side length of n^1/3 + ## Create colorcube of evenly spaced points with side length of n^1/3 cubelen = fix (cbrt (n)); reserve = n - cubelen^3; if (reserve == 0) - # Steal space from blue to put the gray gradient + ## Steal space from blue to put the gray gradient [r, g, b] = meshgrid (linspace (0,1,cubelen), linspace (0,1,cubelen), linspace (0,1,cubelen-1)); @@ -61,16 +61,16 @@ linspace (0,1,cubelen)); endif - # Create map and weed out grays + ## Create map and weed out grays map = [r(:), g(:), b(:)]; idx = any (bsxfun (@ne, map(:, 1), map(:, 2:3)), 2); map = map(idx, :); - # Weed out pure colors + ## Weed out pure colors idx = sum (map == 0, 2); map = map(idx != 2, :); - # Put in remaining gradients of pure red, green, blue, and gray + ## Put in remaining gradients of pure red, green, blue, and gray reserve = n - rows (map) - 1; csteps = fix (reserve/4); cstepsz = 1 / csteps; diff -r 583306fe7e4f -r b81b9d079515 scripts/image/hsv2rgb.m --- a/scripts/image/hsv2rgb.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/image/hsv2rgb.m Wed Aug 28 08:27:38 2013 -0700 @@ -75,8 +75,8 @@ ## are outside range [0, 1]. We could also simply allow those values ## and re-instate this code to produce saturating semantics. ## Trim map to range [0, 1] - #hsv_map(hsv_map < 0) = 0; - #hsv_map(hsv_map > 1) = 1; + ## hsv_map(hsv_map < 0) = 0; + ## hsv_map(hsv_map > 1) = 1; h = hsv_map(:,1); s = hsv_map(:,2); diff -r 583306fe7e4f -r b81b9d079515 scripts/image/image.m --- a/scripts/image/image.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/image/image.m Wed Aug 28 08:27:38 2013 -0700 @@ -170,7 +170,7 @@ set (hax, "view", [0, 90]); if (strcmp (get (hax, "nextplot"), "replace")) - # Always reverse y-axis for images, unless hold is on + ## Always reverse y-axis for images, unless hold is on set (hax, "ydir", "reverse"); endif diff -r 583306fe7e4f -r b81b9d079515 scripts/io/strread.m --- a/scripts/io/strread.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/io/strread.m Wed Aug 28 08:27:38 2013 -0700 @@ -840,14 +840,14 @@ %! assert (a, {"a b c"; "d e"; ""; "f"}); %!test -%! # Bug #33536 +%! ## Bug #33536 %! [a, b, c] = strread ("1,,2", "%s%s%s", "delimiter", ","); %! assert (a{1}, "1"); %! assert (b{1}, ""); %! assert (c{1}, "2"); %!test -%! # Bug #33536 +%! ## Bug #33536 %! a = strread ("[SomeText]", "[%s", "delimiter", "]"); %! assert (a{1}, "SomeText"); @@ -868,7 +868,7 @@ %! assert (d, int32 ([0; 0])); %!test -%! # Default format (= %f) +%! ## Default format (= %f) %1 [a, b, c] = strread ("0.12 0.234 0.3567"); %1 assert (a, 0.12); %1 assert (b, 0.234); @@ -879,13 +879,13 @@ %1 assert (a, [0.41; 3.57]); %!test -%! # TreatAsEmpty +%! ## TreatAsEmpty %! [a, b, c, d] = strread ("1,2,3,NN,5,6\n", "%d%d%d%f", "delimiter", ",", "TreatAsEmpty", "NN"); %! assert (c, int32 ([3; 0])); %! assert (d, [NaN; NaN]); %!test -%! # No delimiters at all besides EOL. Plain reading numbers & strings +%! ## No delimiters at all besides EOL. Plain reading numbers & strings %! str = "Text1Text2Text\nText398Text4Text\nText57Text"; %! [a, b] = strread (str, "Text%dText%1sText"); %! assert (a, int32 ([1; 398; 57])); @@ -958,14 +958,14 @@ %! assert (b, NaN); %!test -%! # Bug #35999 +%! ## Bug #35999 %! [a, b, c] = strread ("", "%f"); %! assert (isempty (a)); %! assert (isempty (b)); %! assert (isempty (c)); -%% bug #37023 %!test +%! ## bug #37023 %! [a, b] = strread (" 1. 1 \n 2 3 \n", "%f %f", "endofline", "\n"); %! assert (a, [1; 2], 1e-15); %! assert (b, [1; 3], 1e-15); diff -r 583306fe7e4f -r b81b9d079515 scripts/io/textscan.m --- a/scripts/io/textscan.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/io/textscan.m Wed Aug 28 08:27:38 2013 -0700 @@ -80,8 +80,8 @@ function [C, position] = textscan (fid, format = "%f", varargin) - BUFLENGTH = 4096; ## Read buffer - emptfmt = 0; ## Signals deliberately empty format string + BUFLENGTH = 4096; # Read buffer + emptfmt = 0; # Signals deliberately empty format string ## Check input if (nargin < 1) @@ -439,7 +439,7 @@ %! assert (int8 (c{:}{:}), int8 ([ 76, 49, 10, 76, 50 ])); %!test -%! # No delimiters at all besides EOL. Skip fields, even empty fields +%! ## No delimiters at all besides EOL. Skip fields, even empty fields %! str = "Text1Text2Text\nTextText4Text\nText57Text"; %! c = textscan (str, "Text%*dText%dText"); %! assert (c{1}, int32 ([2; 4; 0])); diff -r 583306fe7e4f -r b81b9d079515 scripts/miscellaneous/bzip2.m --- a/scripts/miscellaneous/bzip2.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/miscellaneous/bzip2.m Wed Aug 28 08:27:38 2013 -0700 @@ -44,7 +44,7 @@ %!xtest -%! # test for correct cleanup of temporary files +%! ## test for correct cleanup of temporary files %! unwind_protect %! filename = tmpnam; %! dummy = 1; diff -r 583306fe7e4f -r b81b9d079515 scripts/miscellaneous/edit.m --- a/scripts/miscellaneous/edit.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/miscellaneous/edit.m Wed Aug 28 08:27:38 2013 -0700 @@ -161,7 +161,7 @@ "MODE", "async", "EDITINPLACE", false); ## Make sure the stateval variables survive "clear functions". - #mlock; + mlock; if (nargin == 1) ## User has supplied one arg, this can be a single file name diff -r 583306fe7e4f -r b81b9d079515 scripts/miscellaneous/gzip.m --- a/scripts/miscellaneous/gzip.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/miscellaneous/gzip.m Wed Aug 28 08:27:38 2013 -0700 @@ -42,7 +42,7 @@ %!xtest -%! # test gzip together with gunzip +%! ## test gzip together with gunzip %! unwind_protect %! filename = tmpnam; %! dummy = 1; diff -r 583306fe7e4f -r b81b9d079515 scripts/optimization/__all_opts__.m --- a/scripts/optimization/__all_opts__.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/optimization/__all_opts__.m Wed Aug 28 08:27:38 2013 -0700 @@ -49,7 +49,7 @@ fn = fieldnames (opts).'; names = [names, fn]; catch - # throw the error as a warning. + ## throw the error as a warning. warning (lasterr ()); end_try_catch endfor diff -r 583306fe7e4f -r b81b9d079515 scripts/optimization/fminbnd.m --- a/scripts/optimization/fminbnd.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/optimization/fminbnd.m Wed Aug 28 08:27:38 2013 -0700 @@ -269,7 +269,7 @@ printf (" - increase MaxIter option.\n"); printf (" Current function value: %.6f\n", opt.fx); case -1 - "FIXME"; ## FIXME: what's the message MATLAB prints for this case? + "FIXME"; # FIXME: what's the message MATLAB prints for this case? otherwise error ("internal error - fminbnd() is bug, sorry!"); endswitch diff -r 583306fe7e4f -r b81b9d079515 scripts/optimization/sqp.m --- a/scripts/optimization/sqp.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/optimization/sqp.m Wed Aug 28 08:27:38 2013 -0700 @@ -186,8 +186,7 @@ function [x, obj, info, iter, nf, lambda] = sqp (x0, objf, cef, cif, lb, ub, maxiter, tolerance) - globals = struct (); # data and handles, needed and changed by - # subfunctions + globals = struct (); # data and handles, needed and changed by subfunctions if (nargin < 2 || nargin > 8 || nargin == 5) print_usage (); diff -r 583306fe7e4f -r b81b9d079515 scripts/pkg/private/get_forge_pkg.m --- a/scripts/pkg/private/get_forge_pkg.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/pkg/private/get_forge_pkg.m Wed Aug 28 08:27:38 2013 -0700 @@ -49,7 +49,7 @@ else ver = t{1}{1}; if (nargout > 1) - # Build download string. + ## Build download string. pkg_file = sprintf ("%s-%s.tar.gz", name, ver); url = ["http://packages.octave.org/download/" pkg_file]; ## Verify that the package string exists on the page. diff -r 583306fe7e4f -r b81b9d079515 scripts/plot/area.m --- a/scripts/plot/area.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/plot/area.m Wed Aug 28 08:27:38 2013 -0700 @@ -229,7 +229,7 @@ %!demo -%! # Verify identity sin^2 + cos^2 = 1 +%! ## Verify identity sin^2 + cos^2 = 1 %! clf; %! t = linspace (0, 2*pi, 100)'; %! y = [sin(t).^2, cos(t).^2]; @@ -239,7 +239,7 @@ %! title ('area() plot'); %!demo -%! # Show effects of setting BaseValue +%! ## Show effects of setting BaseValue %! clf; %! x = [-2:0.1:2]'; %! y = x.^2 - 1; @@ -258,3 +258,4 @@ %! h = area (x, y); %! set (h, 'ydata', sort (get (h, 'ydata'))) %! title ('area() plot of sorted data'); + diff -r 583306fe7e4f -r b81b9d079515 scripts/plot/stemleaf.m --- a/scripts/plot/stemleaf.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/plot/stemleaf.m Wed Aug 28 08:27:38 2013 -0700 @@ -195,7 +195,7 @@ n_far_l = sum (xo_fence_h); - # display table similar to that on pg. 33 + ## display table similar to that on pg. 33 plot_out = sprintf (" Data: %s", caption); plot_out = [plot_out; sprintf(" ")]; plot_out = [plot_out; sprintf(" Fenced Letter Display")]; diff -r 583306fe7e4f -r b81b9d079515 scripts/plot/surfc.m --- a/scripts/plot/surfc.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/plot/surfc.m Wed Aug 28 08:27:38 2013 -0700 @@ -82,7 +82,7 @@ drawnow (); - # don't pass string arguments to __contour__() + ## don't pass string arguments to __contour__() stop_idx = find (cellfun ("isclass", varargin, "char"), 1); if (isempty (stop_idx)) stop_idx = nargin; diff -r 583306fe7e4f -r b81b9d079515 scripts/plot/uiresume.m --- a/scripts/plot/uiresume.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/plot/uiresume.m Wed Aug 28 08:27:38 2013 -0700 @@ -39,7 +39,7 @@ set (h, "__uiwait_state__", "triggered"); endif catch - # Ignore exception + ## Ignore exception end_try_catch endfunction diff -r 583306fe7e4f -r b81b9d079515 scripts/plot/zlabel.m --- a/scripts/plot/zlabel.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/plot/zlabel.m Wed Aug 28 08:27:38 2013 -0700 @@ -77,8 +77,6 @@ %! z = zlabel ("zlabel_string"); %! assert (get (gca, "zlabel"), z); %! assert (get (z, "type"), "text"); -%! ## FIXME: visible test is failing. Not sure why. -%! #assert (get (z, "visible"), "off"); %! assert (get (z, "string"), "zlabel_string"); %! unwind_protect_cleanup %! close (hf); diff -r 583306fe7e4f -r b81b9d079515 scripts/polynomial/mkpp.m --- a/scripts/polynomial/mkpp.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/polynomial/mkpp.m Wed Aug 28 08:27:38 2013 -0700 @@ -45,12 +45,12 @@ function pp = mkpp (x, P, d) - # check number of arguments + ## check number of arguments if (nargin < 2 || nargin > 3) print_usage (); endif - # check x + ## check x if (length (x) < 2) error ("mkpp: at least one interval is needed"); endif diff -r 583306fe7e4f -r b81b9d079515 scripts/polynomial/ppval.m --- a/scripts/polynomial/ppval.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/polynomial/ppval.m Wed Aug 28 08:27:38 2013 -0700 @@ -95,7 +95,7 @@ yi = shiftdim (yi, nd); endif - ## + ## FIXME: Why is this commented out, rather than just removed? #if (d == 1) # yi = reshape (yi, sxi); #endif diff -r 583306fe7e4f -r b81b9d079515 scripts/set/intersect.m --- a/scripts/set/intersect.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/set/intersect.m Wed Aug 28 08:27:38 2013 -0700 @@ -60,7 +60,7 @@ len_a = rows (a); else c = [a(:); b(:)]; - [c, ic] = sort (c); ## [a(:);b(:)](ic) == c + [c, ic] = sort (c); # [a(:);b(:)](ic) == c if (iscellstr (c)) ii = find (strcmp (c(1:end-1), c(2:end))); else @@ -71,8 +71,8 @@ endif if (nargout > 1) - ia = ja(ic(ii)); ## a(ia) == c - ib = jb(ic(ii+1) - len_a); ## b(ib) == c + ia = ja(ic(ii)); # a(ia) == c + ib = jb(ic(ii+1) - len_a); # b(ib) == c endif if (nargin == 2 && (rows (b) == 1 || rows (a) == 1)) diff -r 583306fe7e4f -r b81b9d079515 scripts/signal/freqz.m --- a/scripts/signal/freqz.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/signal/freqz.m Wed Aug 28 08:27:38 2013 -0700 @@ -178,7 +178,7 @@ %!test # correct values and fft-polyval consistency -%! # butterworth filter, order 2, cutoff pi/2 radians +%! ## butterworth filter, order 2, cutoff pi/2 radians %! b = [0.292893218813452 0.585786437626905 0.292893218813452]; %! a = [1 0 0.171572875253810]; %! [h,w] = freqz (b,a,32); diff -r 583306fe7e4f -r b81b9d079515 scripts/sparse/pcg.m --- a/scripts/sparse/pcg.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/sparse/pcg.m Wed Aug 28 08:27:38 2013 -0700 @@ -391,101 +391,101 @@ %!demo -%! # Simplest usage of pcg (see also 'help pcg') -%! -%! N = 10; -%! A = diag ([1:N]); b = rand (N, 1); -%! y = A \ b; # y is the true solution -%! x = pcg (A, b); -%! printf ("The solution relative error is %g\n", norm (x - y) / norm (y)); -%! -%! # You shouldn't be afraid if pcg issues some warning messages in this -%! # example: watch out in the second example, why it takes N iterations -%! # of pcg to converge to (a very accurate, by the way) solution +%! ## Simplest usage of pcg (see also 'help pcg') +%! +%! N = 10; +%! A = diag ([1:N]); b = rand (N, 1); +%! y = A \ b; # y is the true solution +%! x = pcg (A, b); +%! printf ("The solution relative error is %g\n", norm (x - y) / norm (y)); +%! +%! ## You shouldn't be afraid if pcg issues some warning messages in this +%! ## example: watch out in the second example, why it takes N iterations +%! ## of pcg to converge to (a very accurate, by the way) solution %!demo -%! # Full output from pcg, except for the eigenvalue estimates -%! # We use this output to plot the convergence history -%! -%! N = 10; -%! A = diag ([1:N]); b = rand (N, 1); -%! X = A \ b; # X is the true solution -%! [x, flag, relres, iter, resvec] = pcg (A, b); -%! printf ("The solution relative error is %g\n", norm (x - X) / norm (X)); -%! title ("Convergence history"); -%! semilogy ([0:iter], resvec / resvec(1), "o-g"); -%! xlabel ("Iteration"); ylabel ("log(||b-Ax||/||b||)"); -%! legend ("relative residual"); +%! ## Full output from pcg, except for the eigenvalue estimates +%! ## We use this output to plot the convergence history +%! +%! N = 10; +%! A = diag ([1:N]); b = rand (N, 1); +%! X = A \ b; # X is the true solution +%! [x, flag, relres, iter, resvec] = pcg (A, b); +%! printf ("The solution relative error is %g\n", norm (x - X) / norm (X)); +%! title ("Convergence history"); +%! semilogy ([0:iter], resvec / resvec(1), "o-g"); +%! xlabel ("Iteration"); ylabel ("log(||b-Ax||/||b||)"); +%! legend ("relative residual"); %!demo -%! # Full output from pcg, including the eigenvalue estimates -%! # Hilbert matrix is extremely ill-conditioned, so pcg WILL have problems -%! -%! N = 10; -%! A = hilb (N); b = rand (N, 1); -%! X = A \ b; # X is the true solution -%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], 200); -%! printf ("The solution relative error is %g\n", norm (x - X) / norm (X)); -%! printf ("Condition number estimate is %g\n", eigest(2) / eigest(1)); -%! printf ("Actual condition number is %g\n", cond (A)); -%! title ("Convergence history"); -%! semilogy ([0:iter], resvec, ["o-g";"+-r"]); -%! xlabel ("Iteration"); ylabel ("log(||b-Ax||)"); -%! legend ("absolute residual", "absolute preconditioned residual"); +%! ## Full output from pcg, including the eigenvalue estimates +%! ## Hilbert matrix is extremely ill-conditioned, so pcg WILL have problems +%! +%! N = 10; +%! A = hilb (N); b = rand (N, 1); +%! X = A \ b; # X is the true solution +%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], 200); +%! printf ("The solution relative error is %g\n", norm (x - X) / norm (X)); +%! printf ("Condition number estimate is %g\n", eigest(2) / eigest(1)); +%! printf ("Actual condition number is %g\n", cond (A)); +%! title ("Convergence history"); +%! semilogy ([0:iter], resvec, ["o-g";"+-r"]); +%! xlabel ("Iteration"); ylabel ("log(||b-Ax||)"); +%! legend ("absolute residual", "absolute preconditioned residual"); %!demo -%! # Full output from pcg, including the eigenvalue estimates -%! # We use the 1-D Laplacian matrix for A, and cond(A) = O(N^2) -%! # and that's the reason we need some preconditioner; here we take -%! # a very simple and not powerful Jacobi preconditioner, -%! # which is the diagonal of A +%! ## Full output from pcg, including the eigenvalue estimates +%! ## We use the 1-D Laplacian matrix for A, and cond(A) = O(N^2) +%! ## and that's the reason we need some preconditioner; here we take +%! ## a very simple and not powerful Jacobi preconditioner, +%! ## which is the diagonal of A. %! -%! N = 100; -%! A = zeros (N, N); -%! for i = 1 : N - 1 # form 1-D Laplacian matrix -%! A(i:i+1, i:i+1) = [2 -1; -1 2]; -%! endfor -%! b = rand (N, 1); -%! X = A \ b; # X is the true solution -%! maxit = 80; -%! printf ("System condition number is %g\n", cond (A)); -%! # No preconditioner: the convergence is very slow! +%! N = 100; +%! A = zeros (N, N); +%! for i = 1 : N - 1 # form 1-D Laplacian matrix +%! A(i:i+1, i:i+1) = [2 -1; -1 2]; +%! endfor +%! b = rand (N, 1); +%! X = A \ b; # X is the true solution +%! maxit = 80; +%! printf ("System condition number is %g\n", cond (A)); +%! ## No preconditioner: the convergence is very slow! %! -%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit); -%! printf ("System condition number estimate is %g\n", eigest(2) / eigest(1)); -%! title ("Convergence history"); -%! semilogy ([0:iter], resvec(:,1), "o-g"); -%! xlabel ("Iteration"); ylabel ("log(||b-Ax||)"); -%! legend ("NO preconditioning: absolute residual"); +%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit); +%! printf ("System condition number estimate is %g\n", eigest(2) / eigest(1)); +%! title ("Convergence history"); +%! semilogy ([0:iter], resvec(:,1), "o-g"); +%! xlabel ("Iteration"); ylabel ("log(||b-Ax||)"); +%! legend ("NO preconditioning: absolute residual"); %! -%! pause (1); -%! # Test Jacobi preconditioner: it will not help much!!! +%! pause (1); +%! ## Test Jacobi preconditioner: it will not help much!!! %! -%! M = diag (diag (A)); # Jacobi preconditioner -%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M); -%! printf ("JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1)); -%! hold on; -%! semilogy ([0:iter], resvec(:,1), "o-r"); -%! legend ("NO preconditioning: absolute residual", ... -%! "JACOBI preconditioner: absolute residual"); +%! M = diag (diag (A)); # Jacobi preconditioner +%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M); +%! printf ("JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1)); +%! hold on; +%! semilogy ([0:iter], resvec(:,1), "o-r"); +%! legend ("NO preconditioning: absolute residual", ... +%! "JACOBI preconditioner: absolute residual"); %! -%! pause (1); -%! # Test nonoverlapping block Jacobi preconditioner: it will help much! +%! pause (1); +%! ## Test nonoverlapping block Jacobi preconditioner: it will help much! %! -%! M = zeros (N, N); k = 4; -%! for i = 1 : k : N # form 1-D Laplacian matrix -%! M(i:i+k-1, i:i+k-1) = A(i:i+k-1, i:i+k-1); -%! endfor -%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M); -%! printf ("BLOCK JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1)); -%! semilogy ([0:iter], resvec(:,1), "o-b"); -%! legend ("NO preconditioning: absolute residual", ... -%! "JACOBI preconditioner: absolute residual", ... -%! "BLOCK JACOBI preconditioner: absolute residual"); -%! hold off; +%! M = zeros (N, N); k = 4; +%! for i = 1 : k : N # form 1-D Laplacian matrix +%! M(i:i+k-1, i:i+k-1) = A(i:i+k-1, i:i+k-1); +%! endfor +%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M); +%! printf ("BLOCK JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1)); +%! semilogy ([0:iter], resvec(:,1), "o-b"); +%! legend ("NO preconditioning: absolute residual", ... +%! "JACOBI preconditioner: absolute residual", ... +%! "BLOCK JACOBI preconditioner: absolute residual"); +%! hold off; %!test -%! # solve small diagonal system +%! ## solve small diagonal system %! %! N = 10; %! A = diag ([1:N]); b = rand (N, 1); @@ -495,9 +495,9 @@ %! assert (flag, 0); %!test -%! # solve small indefinite diagonal system -%! # despite A is indefinite, the iteration continues and converges -%! # indefiniteness of A is detected +%! ## solve small indefinite diagonal system +%! ## despite A is indefinite, the iteration continues and converges +%! ## indefiniteness of A is detected %! %! N = 10; %! A = diag([1:N] .* (-ones(1, N) .^ 2)); b = rand (N, 1); @@ -507,7 +507,7 @@ %! assert (flag, 3); %!test -%! # solve tridiagonal system, do not converge in default 20 iterations +%! ## solve tridiagonal system, do not converge in default 20 iterations %! %! N = 100; %! A = zeros (N, N); @@ -522,9 +522,9 @@ %! assert (iter, 20); # should perform max allowable default number of iterations %!test -%! # solve tridiagonal system with 'perfect' preconditioner -%! # which converges in one iteration, so the eigest does not -%! # work and issues a warning +%! ## solve tridiagonal system with 'perfect' preconditioner +%! ## which converges in one iteration, so the eigest does not +%! ## work and issues a warning %! %! N = 100; %! A = zeros (N, N); diff -r 583306fe7e4f -r b81b9d079515 scripts/sparse/pcr.m --- a/scripts/sparse/pcr.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/sparse/pcr.m Wed Aug 28 08:27:38 2013 -0700 @@ -303,7 +303,7 @@ %!demo -%! # Simplest usage of PCR (see also 'help pcr') +%! ## Simplest usage of PCR (see also 'help pcr') %! %! N = 20; %! A = diag (linspace (-3.1,3,N)); b = rand (N,1); @@ -311,13 +311,13 @@ %! x = pcr (A,b); %! printf ("The solution relative error is %g\n", norm (x-y) / norm (y)); %! -%! # You shouldn't be afraid if PCR issues some warning messages in this -%! # example: watch out in the second example, why it takes N iterations -%! # of PCR to converge to (a very accurate, by the way) solution +%! ## You shouldn't be afraid if PCR issues some warning messages in this +%! ## example: watch out in the second example, why it takes N iterations +%! ## of PCR to converge to (a very accurate, by the way) solution. %!demo -%! # Full output from PCR -%! # We use this output to plot the convergence history +%! ## Full output from PCR +%! ## We use this output to plot the convergence history %! %! N = 20; %! A = diag (linspace (-3.1,30,N)); b = rand (N,1); @@ -330,11 +330,11 @@ %! semilogy ([0:iter], resvec/resvec(1), "o-g;relative residual;"); %!demo -%! # Full output from PCR -%! # We use indefinite matrix based on the Hilbert matrix, with one -%! # strongly negative eigenvalue -%! # Hilbert matrix is extremely ill conditioned, so is ours, -%! # and that's why PCR WILL have problems +%! ## Full output from PCR +%! ## We use indefinite matrix based on the Hilbert matrix, with one +%! ## strongly negative eigenvalue +%! ## Hilbert matrix is extremely ill conditioned, so is ours, +%! ## and that's why PCR WILL have problems %! %! N = 10; %! A = hilb (N); A(1,1) = -A(1,1); b = rand (N,1); @@ -350,14 +350,14 @@ %! semilogy ([0:iter], resvec, "o-g;absolute residual;"); %!demo -%! # Full output from PCR -%! # We use an indefinite matrix based on the 1-D Laplacian matrix for A, -%! # and here we have cond(A) = O(N^2) -%! # That's the reason we need some preconditioner; here we take -%! # a very simple and not powerful Jacobi preconditioner, -%! # which is the diagonal of A +%! ## Full output from PCR +%! ## We use an indefinite matrix based on the 1-D Laplacian matrix for A, +%! ## and here we have cond(A) = O(N^2) +%! ## That's the reason we need some preconditioner; here we take +%! ## a very simple and not powerful Jacobi preconditioner, +%! ## which is the diagonal of A. %! -%! # Note that we use here indefinite preconditioners! +%! ## Note that we use here indefinite preconditioners! %! %! N = 100; %! A = zeros (N,N); @@ -369,7 +369,7 @@ %! X = A \ b; # X is the true solution %! maxit = 80; %! printf ("System condition number is %g\n", cond (A)); -%! # No preconditioner: the convergence is very slow! +%! ## No preconditioner: the convergence is very slow! %! %! [x, flag, relres, iter, resvec] = pcr (A,b,[],maxit); %! clf; @@ -378,7 +378,7 @@ %! semilogy ([0:iter], resvec, "o-g;NO preconditioning: absolute residual;"); %! %! pause (1); -%! # Test Jacobi preconditioner: it will not help much!!! +%! ## Test Jacobi preconditioner: it will not help much!!! %! %! M = diag (diag (A)); # Jacobi preconditioner %! [x, flag, relres, iter, resvec] = pcr (A,b,[],maxit,M); @@ -386,8 +386,8 @@ %! semilogy ([0:iter],resvec,"o-r;JACOBI preconditioner: absolute residual;"); %! %! pause (1); -%! # Test nonoverlapping block Jacobi preconditioner: this one should give -%! # some convergence speedup! +%! ## Test nonoverlapping block Jacobi preconditioner: this one should give +%! ## some convergence speedup! %! %! M = zeros (N,N); k = 4; %! for i=1:k:N # get k x k diagonal blocks of A @@ -399,7 +399,7 @@ %! hold off; %!test -%! # solve small indefinite diagonal system +%! ## solve small indefinite diagonal system %! %! N = 10; %! A = diag (linspace (-10.1,10,N)); b = ones (N,1); @@ -409,8 +409,8 @@ %! assert (flag, 0); %!test -%! # solve tridiagonal system, do not converge in default 20 iterations -%! # should perform max allowable default number of iterations +%! ## solve tridiagonal system, do not converge in default 20 iterations +%! ## should perform max allowable default number of iterations %! %! N = 100; %! A = zeros (N,N); @@ -425,8 +425,8 @@ %! assert (iter, 20); %!test -%! # solve tridiagonal system with "perfect" preconditioner -%! # converges in one iteration +%! ## solve tridiagonal system with "perfect" preconditioner +%! ## converges in one iteration %! %! N = 100; %! A = zeros (N,N); diff -r 583306fe7e4f -r b81b9d079515 scripts/sparse/svds.m --- a/scripts/sparse/svds.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/sparse/svds.m Wed Aug 28 08:27:38 2013 -0700 @@ -103,7 +103,7 @@ endif if (nargin < 4) - opts.tol = 0; ## use ARPACK default + opts.tol = 0; # use ARPACK default opts.disp = 0; opts.maxit = 300; else @@ -111,7 +111,7 @@ error ("svds: OPTS must be a structure"); endif if (!isfield (opts, "tol")) - opts.tol = 0; ## use ARPACK default + opts.tol = 0; # use ARPACK default else opts.tol = opts.tol / root2; endif diff -r 583306fe7e4f -r b81b9d079515 scripts/sparse/treelayout.m --- a/scripts/sparse/treelayout.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/sparse/treelayout.m Wed Aug 28 08:27:38 2013 -0700 @@ -144,7 +144,7 @@ if (columns (idx) == 1 && top_level == 1) s++; else - # We aren't in top level separator now. + ## We aren't in top level separator now. top_level = 0; endif ## If there is not any descendant of "parent node": diff -r 583306fe7e4f -r b81b9d079515 scripts/specfun/ellipke.m --- a/scripts/specfun/ellipke.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/specfun/ellipke.m Wed Aug 28 08:27:38 2013 -0700 @@ -98,13 +98,14 @@ endfunction -%% Test complete elliptic functions of first and second kind -%% against "exact" solution from Mathematica 3.0 + +## Test complete elliptic functions of first and second kind +## against "exact" solution from Mathematica 3.0 %!test %! m = [0.0; 0.01; 0.1; 0.5; 0.9; 0.99; 1.0 ]; %! [k,e] = ellipke (m); %! -%! # K(1.0) is really infinity - see below +%! ## K(1.0) is really infinity - see below %! k_exp = [1.5707963267948966192; %! 1.5747455615173559527; %! 1.6124413487202193982; @@ -123,7 +124,7 @@ %! assert (k, k_exp, 8*eps); %! assert (e, e_exp, 8*eps); -%% Test against A&S Table 17.1 +## Test against A&S Table 17.1 %!test %! m = [0:5:50]'/100; %! k_exp = [1.570796326794897; @@ -152,6 +153,7 @@ %! assert (k, k_exp, 1e-15); %! assert (e, e_exp, 1e-8); -%% Test input validation +## Test input validation %!error ellipke () %!error ellipke (1,2,3) + diff -r 583306fe7e4f -r b81b9d079515 scripts/special-matrix/toeplitz.m --- a/scripts/special-matrix/toeplitz.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/special-matrix/toeplitz.m Wed Aug 28 08:27:38 2013 -0700 @@ -96,8 +96,8 @@ endif if (issparse (c) && issparse (r)) - c = c(:).'; ## enforce row vector - r = r(:).'; ## enforce row vector + c = c(:).'; # enforce row vector + r = r(:).'; # enforce row vector cidx = find (c); ridx = find (r); diff -r 583306fe7e4f -r b81b9d079515 scripts/strings/dec2base.m --- a/scripts/strings/dec2base.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/strings/dec2base.m Wed Aug 28 08:27:38 2013 -0700 @@ -62,7 +62,7 @@ d = cell2mat (d); endif - # Create column vector for algorithm + ## Create column vector for algorithm if (! iscolumn (d)) d = d(:); endif diff -r 583306fe7e4f -r b81b9d079515 scripts/strings/strsplit.m --- a/scripts/strings/strsplit.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/strings/strsplit.m Wed Aug 28 08:27:38 2013 -0700 @@ -159,7 +159,7 @@ args.delimitertype = "simple"; endif - # Save the length of the "delimitertype" parameter + ## Save the length of the "delimitertype" parameter length_deltype = numel (args.delimitertype); if (nargin == 1 || (nargin > 1 && (islogical (del) || isnumeric (del)))) diff -r 583306fe7e4f -r b81b9d079515 scripts/testfun/test.m --- a/scripts/testfun/test.m Wed Aug 28 08:41:55 2013 +0100 +++ b/scripts/testfun/test.m Wed Aug 28 08:27:38 2013 -0700 @@ -358,7 +358,7 @@ __name = __block(__name_position(1):__name_position(2)); __code = __block; try - eval (__code); ## Define the function + eval (__code); # Define the function __clear = sprintf ("%sclear %s;\n", __clear, __name); catch __success = 0; @@ -750,9 +750,9 @@ %! % you should now see a spectrogram in the image window -### now test test itself +## now test 'test' itself -%!## usage and error testing +## usage and error testing % !fail ('test','usage.*test') # no args, generates usage() % !fail ('test (1,2,3,4)','usage.*test') # too many args, generates usage() %!fail ('test ("test", "bogus")','unknown flag') # incorrect args @@ -770,7 +770,7 @@ %!warning warning ('warning message'); -%!## test of shared variables +## test of shared variables %!shared a # create a shared variable %!test a=3; # assign to a shared variable %!test assert (a,3) # variable should equal 3 @@ -808,17 +808,17 @@ %! assert (x,6); %! assert (z,9); -%!## test of assert block +## test of assert block %!assert (isempty ([])) # support for test assert shorthand -%!## demo blocks +## demo blocks %!demo # multiline demo block %! t = [0:0.01:2*pi]; x = sin (t); %! plot (t,x); %! % you should now see a sine wave in your figure window %!demo a=3 # single line demo blocks work too -%!## this is a comment block. it can contain anything. +## this is a comment block. it can contain anything. %!## %! it is the "#" as the block type that makes it a comment %! and it stays as a comment even through continuation lines diff -r 583306fe7e4f -r b81b9d079515 test/build-sparse-tests.sh --- a/test/build-sparse-tests.sh Wed Aug 28 08:41:55 2013 +0100 +++ b/test/build-sparse-tests.sh Wed Aug 28 08:27:38 2013 -0700 @@ -653,7 +653,7 @@ %!testif HAVE_UMFPACK # simple LU + row permutations %! [L,U,P] = lu (bs); %! assert (P'*L*U, bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -662,7 +662,7 @@ %!testif HAVE_UMFPACK # simple LU + row/col permutations %! [L,U,P,Q] = lu (bs); %! assert (P'*L*U*Q', bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -671,7 +671,7 @@ %!testif HAVE_UMFPACK # LU with vector permutations %! [L,U,P,Q] = lu (bs,'vector'); %! assert (L(P,:)*U(:,Q), bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -680,7 +680,7 @@ %!testif HAVE_UMFPACK # LU with scaling %! [L,U,P,Q,R] = lu (bs); %! assert (R*P'*L*U*Q', bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -757,7 +757,7 @@ %!testif HAVE_UMFPACK # simple LU + row permutations %! [L,U,P] = lu (bs); %! assert (P'*L*U, bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -766,7 +766,7 @@ %!testif HAVE_UMFPACK # simple LU + row/col permutations %! [L,U,P,Q] = lu (bs); %! assert (P'*L*U*Q', bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -775,7 +775,7 @@ %!testif HAVE_UMFPACK # LU with vector permutations %! [L,U,P,Q] = lu (bs,'vector'); %! assert (L (P,:)*U (:,Q), bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); @@ -784,7 +784,7 @@ %!testif HAVE_UMFPACK # LU with scaling %! [L,U,P,Q,R] = lu (bs); %! assert (R*P'*L*U*Q', bs, 1e-10); -%! # triangularity +%! ## triangularity %! [i,j,v] = find (L); %! assert (i-j>=0); %! [i,j,v] = find (U); diff -r 583306fe7e4f -r b81b9d079515 test/index.tst --- a/test/index.tst Wed Aug 28 08:41:55 2013 +0100 +++ b/test/index.tst Wed Aug 28 08:27:38 2013 -0700 @@ -134,7 +134,7 @@ %!assert (b([],3), zeros (0,1)) %!shared x -%! # Dummy shared block to clear any previous definitions +%! ## Dummy shared block to clear any previous definitions %! x = 1; %!test diff -r 583306fe7e4f -r b81b9d079515 test/system.tst --- a/test/system.tst Wed Aug 28 08:41:55 2013 +0100 +++ b/test/system.tst Wed Aug 28 08:27:38 2013 -0700 @@ -140,7 +140,7 @@ %! %! assert (deblank (s1.modestr), "-rw-rw-rw-"); %! assert (deblank (s2.modestr), "----------"); -%! # Restore original umask value +%! ## Restore original umask value %! umask (orig_umask); %!error umask () @@ -285,7 +285,7 @@ %! d1 = pwd (); %! cd (xdir); %! if (ispc () && ! isunix ()) -%! # should be a drive letter +%! ## should be a drive letter %! assert (length (d1), 3); %! assert (d1(2), ":"); %! assert (d1(3), "\\");