Mercurial > octave
changeset 20735:418ae0cb752f
Replace ++,-- with in-place operators for performance.
* inputParser.m, int2str.m, interp2.m, interp3.m, interpn.m, __isequal__.m,
voronoi.m, imshow.m, jet.m, __imread__.m, __imwrite__.m, imwrite_filename.m,
dlmwrite.m, importdata.m, strread.m, krylov.m, fact.m, genvarname.m, fminbnd.m,
fminsearch.m, fminunc.m, fsolve.m, fzero.m, lsqnonneg.m, pqpnonneg.m, qp.m,
sqp.m, annotation.m, legend.m, orient.m, __bar__.m, __contour__.m, __patch__.m,
__plt__.m, __scatter__.m, rectangle.m, surfc.m, figure.m, hdl2struct.m, pan.m,
__gnuplot_draw_axes__.m, __gnuplot_ginput__.m, rotate3d.m, struct2hdl.m,
zoom.m, freqz.m, periodogram.m, gmres.m, pcg.m, pcr.m, __sprand__.m,
sprandsym.m, treelayout.m, treeplot.m, hadamard.m, hilb.m, iqr.m, assert.m,
test.m: Replace ++,-- with in-place operators for performance.
line wrap: on
line diff
--- a/scripts/general/inputParser.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/general/inputParser.m Sun Nov 22 20:25:17 2015 -0800 @@ -357,8 +357,8 @@ ## 2) it's a ParamValue or Switch name and we should use the ## the default for the rest. if (ischar (in)) - idx--; - vidx--; + idx -= 1; + vidx -= 1; break else this.error (sprintf ("failed validation of %s",
--- a/scripts/general/int2str.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/general/int2str.m Sun Nov 22 20:25:17 2015 -0800 @@ -105,7 +105,7 @@ tfw = floor (log10 (double (abs (t)))) + 1 + sep; fw = max (tfw); if (any (t(tfw == fw) < 0)) - fw++; + fw += 1; endif fmt = sprintf ("%%%dd", max (fw, min_fw)); endif
--- a/scripts/general/interp2.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/general/interp2.m Sun Nov 22 20:25:17 2015 -0800 @@ -98,7 +98,7 @@ nargs -= 2; elseif (ischar (varargin{end})) method = varargin{end}; - nargs--; + nargs -= 1; endif if (method(1) == "*") warning ("interp2: ignoring unsupported '*' flag to METHOD");
--- a/scripts/general/interp3.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/general/interp3.m Sun Nov 22 20:25:17 2015 -0800 @@ -101,7 +101,7 @@ nargs -= 2; elseif (ischar (varargin{end})) method = varargin{end}; - nargs--; + nargs -= 1; endif if (method(1) == "*")
--- a/scripts/general/interpn.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/general/interpn.m Sun Nov 22 20:25:17 2015 -0800 @@ -91,7 +91,7 @@ nargs -= 2; elseif (ischar (varargin{end})) method = varargin{end}; - nargs--; + nargs -= 1; endif if (method(1) == "*")
--- a/scripts/general/private/__isequal__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/general/private/__isequal__.m Sun Nov 22 20:25:17 2015 -0800 @@ -99,7 +99,7 @@ idx = 0; s_fn_x = sort (fn_x); while (t && idx < l_v) - idx++; + idx += 1; ## We'll allow the fieldnames to be in a different order. t = all (strcmp (s_fn_x, sort (fn_v{idx}))); endwhile @@ -107,7 +107,7 @@ idx = 0; while (t && idx < l_fn_x) ## Test that all field values are equal. - idx++; + idx += 1; args = cell (1, 2+l_v); args(1:2) = {nans_compare_equal, {x.(fn_x{idx})}}; for argn = 1:l_v @@ -122,7 +122,7 @@ l_x = numel (x); idx = 0; while (t && idx < l_x) - idx++; + idx += 1; args = cell (1, 2+l_v); args(1:2) = {nans_compare_equal, x{idx}}; args(3:end) = [cellindexmat(varargin, idx){:}];
--- a/scripts/geometry/voronoi.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/geometry/voronoi.m Sun Nov 22 20:25:17 2015 -0800 @@ -83,7 +83,7 @@ if (! isaxes (hax)) error ("voronoi: HAX argument must be an axes object"); endif - narg++; + narg += 1; endif if (nargin < 1 + narg || nargin > 3 + narg) @@ -99,7 +99,7 @@ opts = varargin(narg++); elseif (isnumeric (varargin{narg})) ## Accept, but ignore, the triangulation - narg++; + narg += 1; endif endif
--- a/scripts/image/imshow.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/image/imshow.m Sun Nov 22 20:25:17 2015 -0800 @@ -126,7 +126,7 @@ switch (tolower (arg)) case "border" warning ("imshow: border argument is not implemented"); - narg++; + narg += 1; case "colormap" map = varargin{narg++}; if (iscolormap (map) && min (map) >= 0 || max (map) <= 1) @@ -138,7 +138,7 @@ display_range = varargin{narg++}; case {"initialmagnification"} warning ("imshow: zoom argument ignored -- use GUI features"); - narg++; + narg += 1; case "parent" prop_val_args(end+(1:2)) = {"parent", varargin{narg++}}; if (! isaxes (prop_val_args{end})) @@ -146,7 +146,7 @@ endif case "reduce" warning ("imshow: reduce argument is not implemented"); - narg++; + narg += 1; case "xdata" xdata = varargin{narg++}; if (! isvector (xdata)) @@ -161,7 +161,7 @@ ydata = [ydata(1) ydata(end)]; otherwise warning ("imshow: unrecognized property %s", arg); - narg++; + narg += 1; endswitch else error ("imshow: argument number %d is invalid", narg);
--- a/scripts/image/jet.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/image/jet.m Sun Nov 22 20:25:17 2015 -0800 @@ -49,7 +49,7 @@ nel = ceil (n/4); # number of elements idx1 = ceil (3/8 * n) + 1; # ~3/8*n for large n if (mod (n, 8) == 2) - idx1++; + idx1 += 1; endif idx2 = idx1 + nel - 1; # ~5/8*n for large n idx3 = min (idx2 + nel, n); # ~7/8*n for large n
--- a/scripts/image/private/__imread__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/image/private/__imread__.m Sun Nov 22 20:25:17 2015 -0800 @@ -59,7 +59,7 @@ error ("imread: IDX must be a numeric vector"); endif options.index = varargin{offset}; - offset++; + offset += 1; endif if (rem (numel (varargin) - offset + 1, 2) != 0)
--- a/scripts/image/private/__imwrite__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/image/private/__imwrite__.m Sun Nov 22 20:25:17 2015 -0800 @@ -146,7 +146,7 @@ if (isinf (options.loopcount)) options.loopcount = 0; elseif (options.loopcount == 0 || options.loopcount == 1) - options.loopcount++; + options.loopcount += 1; endif options.loopcount = floor (options.loopcount);
--- a/scripts/image/private/imwrite_filename.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/image/private/imwrite_filename.m Sun Nov 22 20:25:17 2015 -0800 @@ -52,7 +52,7 @@ && rem (length (varargin) - filename_idx, 2) != 0 && ischar (varargin{filename_idx + 1})) ext = varargin{filename_idx + 1}; - options_idx++; + options_idx += 1; else [~, ~, ext] = fileparts (filename); if (! isempty (ext))
--- a/scripts/io/dlmwrite.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/io/dlmwrite.m Sun Nov 22 20:25:17 2015 -0800 @@ -107,7 +107,7 @@ ## process the input arguments i = 0; while (i < length (varargin)) - i++; + i += 1; if (strcmpi (varargin{i}, "delimiter")) delim = varargin{++i}; elseif (strcmpi (varargin{i}, "newline")) @@ -131,7 +131,7 @@ elseif (strcmpi (varargin{i}, "-append")) opentype = "at"; elseif (strcmpi (varargin{i}, "append")) - i++; + i += 1; if (strcmpi (varargin{i}, "on")) opentype = "at"; elseif (strcmpi (varargin{i}, "off"))
--- a/scripts/io/importdata.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/io/importdata.m Sun Nov 22 20:25:17 2015 -0800 @@ -191,7 +191,7 @@ endif row_data = str2double (row_entries); if (all (isnan (row_data)) || header_rows < num_header_rows) - header_rows++; + header_rows += 1; output.textdata{end+1, 1} = row; else if (! isempty (output.textdata))
--- a/scripts/io/strread.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/io/strread.m Sun Nov 22 20:25:17 2015 -0800 @@ -389,7 +389,7 @@ c2len = length (comment_end); if (cstop + c2len == len) ## Ignore last char of to-the-end-of-line comments - c2len++; + c2len += 1; end str = cellslices (str, [1, cstop + c2len], [cstart - 1, len]); str = [str{:}]; @@ -727,7 +727,7 @@ data(end+1:num_lines) = {""}; endif varargout{k} = data'; - k++; + k += 1; case {"%d", "%u", "%f", "%n"} n = cellfun ("isempty", data); ### FIXME: Erroneously formatted data lead to NaN, not an error @@ -742,7 +742,7 @@ data(end+1:num_lines) = numeric_fill_value; endif varargout{k} = data.'; - k++; + k += 1; case {"%0", "%1", "%2", "%3", "%4", "%5", "%6", "%7", "%8", "%9"} sw = regexp (fmt_words{m}, '\d', "once"); ew = regexp (fmt_words{m}, '[nfudsq]') - 1; @@ -767,13 +767,13 @@ data = int32 (data); endif varargout{k} = data.'; - k++; + k += 1; case "s" if (pad_out) data(end+1:num_lines) = {""}; endif varargout{k} = strtrunc (data, swidth)'; - k++; + k += 1; otherwise endswitch case {"%*", "%*s"}
--- a/scripts/linear-algebra/krylov.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/linear-algebra/krylov.m Sun Nov 22 20:25:17 2015 -0800 @@ -115,7 +115,7 @@ alpha = []; nh = 0; while (length (alpha) < na) && (columns (V) > 0) && (iter < k) - iter++; + iter += 1; ## Get orthogonal basis of V. jj = 1; @@ -137,7 +137,7 @@ endif V = V(:,1:(nv-1)); ## One less reflection. - nu--; + nu -= 1; else ## New householder reflection. if (pflg) @@ -171,7 +171,7 @@ endif ## Advance to next column of V. - jj++; + jj += 1; endif endwhile
--- a/scripts/miscellaneous/fact.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/miscellaneous/fact.m Sun Nov 22 20:25:17 2015 -0800 @@ -278,10 +278,10 @@ while (i < numwords && length (newline = [line " " wc{i+1}]) < ncol) line = newline; - i++; + i += 1; endwhile out = [out, line, "\n"]; - i++; + i += 1; endwhile out = [out, "\n"]; endfunction
--- a/scripts/miscellaneous/genvarname.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/miscellaneous/genvarname.m Sun Nov 22 20:25:17 2015 -0800 @@ -160,7 +160,7 @@ varname(i) = str(i); idx = 0; while (excluded) - idx++; + idx += 1; varname{i} = sprintf ("%s%d", str{i}, idx); excluded = any (strcmp (varname{i}, exclusions)); endwhile
--- a/scripts/optimization/fminbnd.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/fminbnd.m Sun Nov 22 20:25:17 2015 -0800 @@ -106,7 +106,7 @@ w = x = v; e = 0; fv = fw = fval = fun (x); - nfev++; + nfev += 1; ## Only for display purposes. iter(1).funccount = nfev; @@ -169,7 +169,7 @@ u = x + max (abs (d), tol) * (sign (d) + (d == 0)); fu = fun (u); - niter++; + niter += 1; iter(niter).funccount = nfev++; iter(niter).x = u;
--- a/scripts/optimization/fminsearch.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/fminsearch.m Sun Nov 22 20:25:17 2015 -0800 @@ -211,7 +211,7 @@ alpha = 1; beta = 1/2; gamma = 2; while (1) # Outer (and only) loop. - k++; + k += 1; if (k > maxiter) msg = "Exceeded maximum iterations...quitting\n";
--- a/scripts/optimization/fminunc.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/fminunc.m Sun Nov 22 20:25:17 2015 -0800 @@ -296,7 +296,7 @@ x += s; xn = norm (dg .* x); fval = fval1; - nsuciter++; + nsuciter += 1; suc = true; endif
--- a/scripts/optimization/fsolve.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/fsolve.m Sun Nov 22 20:25:17 2015 -0800 @@ -236,7 +236,7 @@ updating = false; endif fvec = fvec(:); - nfev++; + nfev += 1; else fjac = __fdjac__ (fcn, reshape (x, xsiz), fvec, typicalx, cdif); nfev += (1 + cdif) * length (x); @@ -311,7 +311,7 @@ fvec1 = fcn (reshape (x + s, xsiz)) (:); fn1 = norm (fvec1); - nfev++; + nfev += 1; if (fn1 < fn) ## Scaled actual reduction. @@ -333,7 +333,7 @@ ## Update delta. if (ratio < min (max (0.1, 0.8*lastratio), 0.9)) nsuc = 0; - nfail++; + nfail += 1; delta *= decfac; decfac ^= 1.4142; if (delta <= 1e1*macheps*xn) @@ -345,7 +345,7 @@ lastratio = ratio; decfac = 0.5; nfail = 0; - nsuc++; + nsuc += 1; if (abs (1-ratio) <= 0.1) delta = 1.4142*sn; elseif (ratio >= 0.5 || nsuc > 1) @@ -359,10 +359,10 @@ xn = norm (dg .* x); fvec = fvec1; fn = fn1; - nsuciter++; + nsuciter += 1; endif - niter++; + niter += 1; ## FIXME: should outputfcn be only called after a successful iteration? if (! isempty (outfcn))
--- a/scripts/optimization/fzero.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/fzero.m Sun Nov 22 20:25:17 2015 -0800 @@ -276,7 +276,7 @@ ## Calculate new point. x = c; fval = fc = fun (c); - niter++; nfev++; + niter += 1; nfev += 1; ## Modification 2: skip inverse cubic interpolation if ## nonmonotonicity is detected.
--- a/scripts/optimization/lsqnonneg.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/lsqnonneg.m Sun Nov 22 20:25:17 2015 -0800 @@ -117,7 +117,7 @@ ## LH3: test for completion. while (iter < max_iter) while (iter < max_iter) - iter++; + iter += 1; ## LH6: compute the positive matrix and find the min norm solution ## of the positive problem.
--- a/scripts/optimization/pqpnonneg.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/pqpnonneg.m Sun Nov 22 20:25:17 2015 -0800 @@ -111,7 +111,7 @@ ## LH3: test for completion. while (iter < max_iter) while (iter < max_iter) - iter++; + iter += 1; ## LH6: compute the positive matrix and find the min norm solution ## of the positive problem.
--- a/scripts/optimization/qp.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/qp.m Sun Nov 22 20:25:17 2015 -0800 @@ -124,7 +124,7 @@ nargs = nargin; if (nargs > 2 && isstruct (varargin{end})) options = varargin{end}; - nargs--; + nargs -= 1; else options = struct (); endif
--- a/scripts/optimization/sqp.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/optimization/sqp.m Sun Nov 22 20:25:17 2015 -0800 @@ -540,7 +540,7 @@ if (isempty (obj)) obj = feval (obj_fun, x); - globals.nfun++; + globals.nfun += 1; endif merit = obj;
--- a/scripts/plot/appearance/annotation.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/appearance/annotation.m Sun Nov 22 20:25:17 2015 -0800 @@ -161,7 +161,7 @@ if (isfigure (varargin{1})) hf = varargin{1}; varargin = varargin(2:end); - nargin--; + nargin -= 1; endif ## Annotation type @@ -170,7 +170,7 @@ if (ischar (varargin{1})) objtype = varargin{1}; varargin(1) = []; - nargin--; + nargin -= 1; else print_usage (); endif
--- a/scripts/plot/appearance/legend.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/appearance/legend.m Sun Nov 22 20:25:17 2015 -0800 @@ -195,7 +195,7 @@ if (pos >= -1 && pos <= 4) location = [{"northeastoutside", "best", "northeast", "northwest", "southwest", "southeast"}] {pos + 2}; - nargs--; + nargs -= 1; else error ("legend: invalid location specified"); endif @@ -255,7 +255,7 @@ delete_leg = true; case "hide" show = "off"; - nargs--; + nargs -= 1; case "show" if (! isempty (hlegend)) show = "on"; @@ -263,7 +263,7 @@ show = "create"; textpos = "right"; endif - nargs--; + nargs -= 1; case "toggle" if (isempty (hlegend)) show = "create"; @@ -273,19 +273,19 @@ else show = "off"; endif - nargs--; + nargs -= 1; case "boxon" box = "on"; - nargs--; + nargs -= 1; case "boxoff" box = "off"; - nargs--; + nargs -= 1; case "left" textpos = "left"; - nargs--; + nargs -= 1; case "right" textpos = "right"; - nargs--; + nargs -= 1; endswitch else ## Character matrix of labels @@ -931,16 +931,16 @@ [(txoffset + xk * xstep) / lpos(3), ... (lpos(4) - yoffset - yk * ystep) / lpos(4)]); if (strcmp (orientation, "vertical")) - yk++; + yk += 1; if (yk > num1) yk = 0; - xk++; + xk += 1; endif else - xk++; + xk += 1; if (xk > num1) xk = 0; - yk++; + yk += 1; endif endif endfor
--- a/scripts/plot/appearance/orient.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/appearance/orient.m Sun Nov 22 20:25:17 2015 -0800 @@ -54,7 +54,7 @@ if (nargs > 0 && numel (varargin{1}) == 1 && isfigure (varargin{1})) cf = varargin{1}; varargin(1) = []; - nargs--; + nargs -= 1; else cf = gcf (); endif
--- a/scripts/plot/draw/private/__bar__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/private/__bar__.m Sun Nov 22 20:25:17 2015 -0800 @@ -69,18 +69,18 @@ while (idx <= nargin) if (ischar (varargin{idx}) && strcmpi (varargin{idx}, "grouped")) group = true; - idx++; + idx += 1; elseif (ischar (varargin{idx}) && strcmpi (varargin{idx}, "stacked")) group = false; - idx++; + idx += 1; elseif (ischar (varargin{idx}) && strcmpi (varargin{idx}, "histc")) group = true; histc = true; - idx++; + idx += 1; elseif (ischar (varargin{idx}) && strcmpi (varargin{idx}, "hist")) group = true; histc = false; - idx++; + idx += 1; else if ((ischar (varargin{idx}) || iscellstr (varargin{idx})) && ! have_line_spec) @@ -90,7 +90,7 @@ ## FIXME: strange parse error requires semicolon to be spaced ## away from closing ']' on next line. newargs = [{"facecolor", linespec.color}, newargs] ; - idx++; + idx += 1; continue; endif endif
--- a/scripts/plot/draw/private/__contour__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/private/__contour__.m Sun Nov 22 20:25:17 2015 -0800 @@ -64,7 +64,7 @@ endif else # skip numeric arguments - i++; + i += 1; endif endwhile @@ -233,7 +233,7 @@ i = 1; ncont = 0; while (i < columns (c)) - ncont++; + ncont += 1; cont_lev(ncont) = c(1, i); cont_len(ncont) = c(2, i); cont_idx(ncont) = i+1; @@ -264,7 +264,7 @@ in = inpolygon (next_ct_pt_vec(1,:), next_ct_pt_vec(2,:), curr_ct(1, :), curr_ct(2, :)); mark(b_vec(in)) = ! mark(b_vec(in)); - a++; + a += 1; endwhile if (numel (mark) > 0) ## All marked contours describe a hole in a larger contour of
--- a/scripts/plot/draw/private/__patch__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/private/__patch__.m Sun Nov 22 20:25:17 2015 -0800 @@ -75,7 +75,7 @@ iarg = 3; if (rem (nargin - iarg, 2) == 1) c = varargin{iarg}; - iarg++; + iarg += 1; else c = []; endif
--- a/scripts/plot/draw/private/__plt__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/private/__plt__.m Sun Nov 22 20:25:17 2015 -0800 @@ -86,7 +86,7 @@ error ("%s: plot arrays must have less than 2 dimensions", caller) endif - nargs--; + nargs -= 1; if (ischar (next_arg) || iscellstr (next_arg)) if (x_set) @@ -96,7 +96,7 @@ error ("%s: properties must appear followed by a value", caller); endif properties = [properties, [next_cell, varargin(k++)]]; - nargs--; + nargs -= 1; continue; else while (nargs > 0 && ischar (varargin{k}))
--- a/scripts/plot/draw/private/__scatter__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/private/__scatter__.m Sun Nov 22 20:25:17 2015 -0800 @@ -42,7 +42,7 @@ s = 6; endif if (! ischar (varargin{istart})) - istart++; + istart += 1; endif else s = 6; @@ -79,7 +79,7 @@ && ! ( strcmpi (varargin{istart}, "filled") || strcmpi (varargin{istart}, "fill"))) c = varargin{istart}; - firstnonnumeric++; + firstnonnumeric += 1; else c = []; endif
--- a/scripts/plot/draw/rectangle.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/rectangle.m Sun Nov 22 20:25:17 2015 -0800 @@ -119,10 +119,10 @@ parent = varargin{iarg+1}; varargin(iarg:iarg+1) = []; else - iarg++; + iarg += 1; endif else - iarg++; + iarg += 1; endif endwhile
--- a/scripts/plot/draw/surfc.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/draw/surfc.m Sun Nov 22 20:25:17 2015 -0800 @@ -93,7 +93,7 @@ if (isempty (stop_idx)) stop_idx = nargin; else - stop_idx--; + stop_idx -= 1; endif if (stop_idx - 1 == 1 || stop_idx - 1 == 3)
--- a/scripts/plot/util/figure.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/figure.m Sun Nov 22 20:25:17 2015 -0800 @@ -57,12 +57,12 @@ f = arg; init_new_figure = false; varargin(1) = []; - nargs--; + nargs -= 1; elseif (isscalar (arg) && isnumeric (arg) && arg > 0 && arg == fix (arg)) f = arg; init_new_figure = true; varargin(1) = []; - nargs--; + nargs -= 1; else error ("figure: N must be figure handle or figure number"); endif
--- a/scripts/plot/util/hdl2struct.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/hdl2struct.m Sun Nov 22 20:25:17 2015 -0800 @@ -59,10 +59,10 @@ while (nkids) if (! any (kids (nkids) == lg) && ! any (kids (nkids) == cb) && ! any (kids (nkids) == ui) && ! strcmp (main.type, "hggroup")) - ii++; + ii += 1; s.children(ii) = hdl2struct (kids(nkids)); endif - nkids--; + nkids -= 1; endwhile ## add non "children" children objects (title, xlabel, ...) and @@ -74,10 +74,10 @@ special = [special getspecial(h)]; nsp = length (special); while (nsp) - ii++; + ii += 1; s.children(ii) = hdl2struct (special(nsp)); s.special(nsp) = ii; - nsp--; + nsp -= 1; endwhile ## look for legends and colorbars among "main"'s brothers and add them @@ -91,7 +91,7 @@ endif nlg = length (lg); if (nlg == 1) - ii++; + ii += 1; s.children(ii) = hdl2struct (lg); elseif (nlg > 1) error ("hdl2struct: more than one legend found"); @@ -105,7 +105,7 @@ ncb = length (cb); if (ncb == 1) - ii++; + ii += 1; s.children(ii) = hdl2struct (cb); elseif (nlg > 1) error ("hdl2struct: more than one colorbar found"); @@ -152,11 +152,11 @@ while (nflds) prop = fields{nflds}; val = obj.(fields{nflds}); - ii++; + ii += 1; if (! any (strcmp (prop, forbid))) prpstr.(prop) = val; endif - nflds--; + nflds -= 1; endwhile ## hidden properties
--- a/scripts/plot/util/pan.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/pan.m Sun Nov 22 20:25:17 2015 -0800 @@ -57,7 +57,7 @@ hfig = varargin{1}; if (isfigure (hfig)) varargin(1) = []; - nargs--; + nargs -= 1; else error ("pan: invalid figure handle HFIG"); endif
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m Sun Nov 22 20:25:17 2015 -0800 @@ -494,7 +494,7 @@ elseif (strcmpi (obj.cdatamapping, "direct")) cdatadirect = true; endif - data_idx++; + data_idx += 1; is_image_data(data_idx) = true; parametric(data_idx) = false; have_cdata(data_idx) = false; @@ -564,7 +564,7 @@ && strcmp (obj.marker, "none")))) continue; endif - data_idx++; + data_idx += 1; is_image_data(data_idx) = false; parametric(data_idx) = true; have_cdata(data_idx) = false; @@ -608,7 +608,7 @@ style{1}, data_idx); if (length (style) > 1) - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = have_cdata(data_idx - 1); @@ -620,7 +620,7 @@ style{2}, data_idx); endif if (length (style) > 2) - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = have_cdata(data_idx - 1); @@ -671,7 +671,7 @@ error ("__gnuplot_draw_axes__: gnuplot (as of v4.2) only supports 3-D filled triangular patches"); else if (isnan (data_3d_idx)) - data_idx++; + data_idx += 1; data_3d_idx = data_idx; is_image_data(data_idx) = false; parametric(data_idx) = false; @@ -685,7 +685,7 @@ ccdat = NaN; endif else - data_idx++; + data_idx += 1; local_idx = data_idx; is_image_data(data_idx) = false; parametric(data_idx) = false; @@ -807,7 +807,7 @@ || (strcmp (obj.markeredgecolor, "none") && strcmp (obj.markerfacecolor, "none"))))) - data_idx++; + data_idx += 1; is_image_data(data_idx) = false; parametric(data_idx) = false; have_cdata(data_idx) = false; @@ -964,7 +964,7 @@ tmpwith{sidx} = sprintf ("with %s %s %s %s", style, lw, lt, colorspec); - sidx++; + sidx += 1; endif if (isnumeric (obj.markerfacecolor) && ! mono) colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", @@ -1019,7 +1019,7 @@ style, lw, lt, colorspec); endif - sidx++; + sidx += 1; endif if (! isempty (pt)) @@ -1095,7 +1095,7 @@ endif if (length (tmpwith) > 1) - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = have_cdata(data_idx - 1); @@ -1106,7 +1106,7 @@ withclause{data_idx} = tmpwith{2}; endif if (length (tmpwith) > 2) - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = have_cdata(data_idx - 1); @@ -1123,7 +1123,7 @@ view_map = true; if (! (strcmp (obj.edgecolor, "none") && strcmp (obj.facecolor, "none"))) - data_idx++; + data_idx += 1; is_image_data(data_idx) = false; parametric(data_idx) = false; have_cdata(data_idx) = true; @@ -1183,7 +1183,7 @@ zz(:,kk+1) = ydat(:,k); zz(:,kk+2) = zdat(:,k); zz(:,kk+3) = cdat(:,k); - k++; + k += 1; endfor data{data_idx} = zz.'; endif @@ -1270,11 +1270,11 @@ zz(:,kk) = xdat(:,k); zz(:,kk+1) = ydat(:,k); zz(:,kk+2) = zdat(:,k); - k++; + k += 1; endfor zz = zz.'; - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = false; @@ -1287,7 +1287,7 @@ endif if (length (style) > 2) - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = false; @@ -1307,11 +1307,11 @@ zz(:,kk) = xdat(:,k); zz(:,kk+1) = ydat(:,k); zz(:,kk+2) = zdat(:,k); - k++; + k += 1; endfor zz = zz.'; endif - data_idx++; + data_idx += 1; is_image_data(data_idx) = is_image_data(data_idx - 1); parametric(data_idx) = parametric(data_idx - 1); have_cdata(data_idx) = false; @@ -1879,8 +1879,8 @@ endif fputs (plot_stream, ";\n"); if (! isempty (style{sidx})) - sidx++; - idx++; + sidx += 1; + idx += 1; else fputs (plot_stream, ";\n"); endif @@ -1922,8 +1922,8 @@ endif fputs (plot_stream, ";\n"); if (! isempty (style{sidx})) - sidx++; - idx++; + sidx += 1; + idx += 1; else fputs (plot_stream, ";\n"); endif @@ -2439,9 +2439,9 @@ if (li == si) break; endif - li++; + li += 1; else - si++; + si += 1; endif endwhile l1 = l1(min (length (l1), si)); @@ -2456,9 +2456,9 @@ if (li == si) break; endif - li++; + li += 1; else - si++; + si += 1; endif endwhile l2 = l2(min (length (l2), si)); @@ -2477,22 +2477,22 @@ str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+2:end)]; endif i += 2; - p++; + p += 1; else - i++; + i += 1; endif else if (s(i+1) == s(i) + 2) ## Shortest already first! str = [str(1:s(i)+p-1) "@" str(s(i)+p:end)]; - p++; + p += 1; i += 2; else - i++; + i += 1; endif endif else - i++; + i += 1; endif endwhile
--- a/scripts/plot/util/private/__gnuplot_ginput__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/private/__gnuplot_ginput__.m Sun Nov 22 20:25:17 2015 -0800 @@ -74,7 +74,7 @@ k = 0; while (true) - k++; + k += 1; ## Notes: MOUSE_* can be undefined if user closes gnuplot by "q" ## or Alt-F4. Further, this abrupt close also requires the leading
--- a/scripts/plot/util/rotate3d.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/rotate3d.m Sun Nov 22 20:25:17 2015 -0800 @@ -52,7 +52,7 @@ hfig = varargin{1}; if (isfigure (hfig)) varargin(1) = []; - nargs--; + nargs -= 1; else error ("rotate3d: invalid figure handle HFIG"); endif
--- a/scripts/plot/util/struct2hdl.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/struct2hdl.m Sun Nov 22 20:25:17 2015 -0800 @@ -162,11 +162,11 @@ nkids = length (kids); ii = 0; while (nkids) - ii++; + ii += 1; if (! any (ii == s.special)) [h2, p] = struct2hdl (s.children(ii), [p [s.handle; h]], hilev); endif - nkids--; + nkids -= 1; endwhile ## paste properties @@ -587,7 +587,7 @@ h2 = get (h , field); set (h2, spec.properties); endif - nf--; + nf -= 1; endwhile ## If hggroup children were created by high level functions, @@ -607,7 +607,7 @@ catch sprintf ("struct2hdl: couldn't set hggroup children #%d props.", ii); end_try_catch - ii++; + ii += 1; endwhile else
--- a/scripts/plot/util/zoom.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/plot/util/zoom.m Sun Nov 22 20:25:17 2015 -0800 @@ -73,7 +73,7 @@ hfig = varargin{1}; if (isfigure (hfig)) varargin(1) = []; - nargs--; + nargs -= 1; else error ("zoom: invalid figure handle HFIG"); endif
--- a/scripts/signal/freqz.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/signal/freqz.m Sun Nov 22 20:25:17 2015 -0800 @@ -165,7 +165,7 @@ else N = 2*n; if (plot_output) - n++; + n += 1; endif f = Fs * (0:n-1).' / N; endif
--- a/scripts/signal/periodogram.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/signal/periodogram.m Sun Nov 22 20:25:17 2015 -0800 @@ -98,7 +98,7 @@ case 4 fs = varargin{k}; endswitch - j++; + j += 1; endif endfor
--- a/scripts/sparse/gmres.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/gmres.m Sun Nov 22 20:25:17 2015 -0800 @@ -179,8 +179,8 @@ break; endif - restart_it++ ; - iter++; + restart_it += 1; + iter += 1; endwhile if (nargout > 1)
--- a/scripts/sparse/pcg.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/pcg.m Sun Nov 22 20:25:17 2015 -0800 @@ -319,7 +319,7 @@ ## fprintf (stderr,"PCG condest: %g (iteration: %d)\n", max (EVS)/min (EVS),iter); endif resvec(iter,1) = norm (r); - iter++; + iter += 1; endwhile if (nargout > 5)
--- a/scripts/sparse/pcr.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/pcr.m Sun Nov 22 20:25:17 2015 -0800 @@ -275,7 +275,7 @@ b_bot_old = b_bot; resvec(iter) = abs (norm (r)); - iter++; + iter += 1; endwhile flag = 0;
--- a/scripts/sparse/private/__sprand__.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/private/__sprand__.m Sun Nov 22 20:25:17 2015 -0800 @@ -70,7 +70,7 @@ k = min (length (idx), k); j = floor ((idx(1:k) - 1) / m); i = idx(1:k) - j * m; - j++; + j += 1; else idx = randperm (mn, k); [i, j] = ind2sub ([m, n], idx);
--- a/scripts/sparse/sprandsym.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/sprandsym.m Sun Nov 22 20:25:17 2015 -0800 @@ -134,7 +134,7 @@ ## order to avoid overflow (underflow is fine, just means effectively ## zero probabilities). [~, midx] = max (cumsum (log (q))) ; - midx++; + midx += 1; lc = fliplr (cumprod (1./q(midx-1:-1:1))); rc = cumprod (q(midx:end));
--- a/scripts/sparse/treelayout.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/treelayout.m Sun Nov 22 20:25:17 2015 -0800 @@ -144,14 +144,14 @@ ## We are in top level separator when we have one child and the ## flag is 1 if (columns (idx) == 1 && top_level == 1) - s++; + s += 1; else ## We aren't in top level separator now. top_level = 0; endif ## If there is not any descendant of "parent node": if (stk(end,2) != par_number) - left_most++; + left_most += 1; x_coordinate_r(par_number) = left_most; max_ht = min (max_ht, level); if (length (stk) > 1 && find ((shift (stk,1) - stk) == 0) > 1 @@ -189,7 +189,7 @@ ## There were descendants of "parent nod" choose the last of ## them and go on through it. - level--; + level -= 1; par_number = stk(end,1); y_coordinate(par_number) = level; x_coordinate_l(par_number) = left_most + 1;
--- a/scripts/sparse/treeplot.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/sparse/treeplot.m Sun Nov 22 20:25:17 2015 -0800 @@ -118,7 +118,7 @@ ## If there is not any descendant of "parent node": if (stk(end,2) != par_number) - left_most++; + left_most += 1; x_coordinate_r(par_number) = left_most; max_ht = min (max_ht, level); if (length (stk) > 1 && find ((shift (stk,1) - stk) == 0) > 1 @@ -150,7 +150,7 @@ else ## There were descendants of "parent nod" choose the last of ## them and go on through it. - level--; + level -= 1; par_number = stk(end,1); y_coordinate(par_number) = level; x_coordinate_l(par_number) = left_most + 1;
--- a/scripts/special-matrix/hadamard.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/special-matrix/hadamard.m Sun Nov 22 20:25:17 2015 -0800 @@ -68,7 +68,7 @@ ## Find k if n = 2^k*p. k = 0; while (n > 1 && fix (n/2) == n/2) - k++; + k += 1; n /= 2; endwhile
--- a/scripts/special-matrix/hilb.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/special-matrix/hilb.m Sun Nov 22 20:25:17 2015 -0800 @@ -65,7 +65,7 @@ tmp = 1:n; for i = 1:n retval(i, :) = 1.0 ./ tmp; - tmp++; + tmp += 1; endfor endfunction
--- a/scripts/statistics/base/iqr.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/statistics/base/iqr.m Sun Nov 22 20:25:17 2015 -0800 @@ -73,7 +73,7 @@ offset2 = 0; while (offset > stride) offset -= stride; - offset2++; + offset2 += 1; endwhile offset += offset2 * stride * n; rng = [0 : n-1] * stride + offset;
--- a/scripts/testfun/assert.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/testfun/assert.m Sun Nov 22 20:25:17 2015 -0800 @@ -77,7 +77,7 @@ unwind_protect - call_depth++; + call_depth += 1; if (call_depth == 0) errmsg = ""; @@ -399,7 +399,7 @@ endif unwind_protect_cleanup - call_depth--; + call_depth -= 1; end_unwind_protect if (call_depth == -1)
--- a/scripts/testfun/test.m Sun Nov 22 19:15:42 2015 -0800 +++ b/scripts/testfun/test.m Sun Nov 22 20:25:17 2015 -0800 @@ -537,7 +537,7 @@ __istest = true; __code = __code(__e + 1 : end); else - __xskip++; + __xskip += 1; __istest = false; __code = ""; # Skip the code. __msg = [__signal_skip "skipped test\n"]; @@ -588,7 +588,7 @@ catch if (strcmp (__type, "xtest")) __msg = [__signal_fail "known failure\n" lasterr()]; - __xfail++; + __xfail += 1; __success = false; else __msg = [__signal_fail "test failed\n" lasterr()]; @@ -702,7 +702,7 @@ if (isempty (left)) return; endif - left++; + left += 1; ## Return the end points of the name. pos = [left, right];