Oct2mat has significantly improved. Most notable, support for the
following language elements as been added:
- support for standalone ++, --,
- support of +=, -= etc operators,
- support of [blah](ix), fun(a)(ix)
- do...until,
- multiple assignments like a=b=c=d
- variable names starting with "_" (underscore)
This means, that many more functions can be converted without manual
editing. The patch that corrects known issues in about 100 files have
reduced to about 22 files (from over 3000 lines to less than 700 lines).
This revised patch is attached.
Some comments on the patch:
===========================
(i) n(k)+=1; is preferred over n(k)++ for two reasons
------------------------------------------------
1) the former is faster
octave:36> N=1e6;
octave:37> tic;n=0;for k=1:N, n++;end;toc;
Elapsed time is 0.48 seconds.
octave:38> tic;n=0;for k=1:N, n+=1;end;toc;
Elapsed time is 0.26 seconds.
2) for indexed variables, n(k)+=1 is correctly converted by oct2mat
while conversion of n(k)++ is not supported.
(ii) a+=b|c, a-=b+c etc. would be incorrectly resolved to a = a+b|c, and
a = a-b+c. For this reason, it is sometimes necessary to add paranthesis
a+=(b|c). [Remark: there is a solution to introduce always (RHS), but
this breaks another example. You can test oct2mat with this commands:
mkdir /tmp/oct2mat
cd ~/octave-forge/extra/oct2mat/inst
./oct2mat test_oct2mat.m
cat /tmp/oct2mat/test_oct2mat.m
3) increment ++ and decrement -- operators within another expression can
not be correctly converted. Therefore, manual editing is necessary.
As far as I understand the various comments, only Olaf is against the
patch. I'll leave it to the admins of octave-forge and the maintainers
of each package, whether or which parts of the patch should be applied.
Nevertheless, the changes are in my local repository and are available
upon request. Checking them in would help others on running oct2mat and
freetb4matlab.
Alois
Index: extra/control-legacy/inst/rlocus.m
===================================================================
--- extra/control-legacy/inst/rlocus.m (revision 7295)
+++ extra/control-legacy/inst/rlocus.m (working copy)
@@ -241,7 +241,8 @@
sigma_A = (sum(olpol) - sum(olzer))/n_A;
for i_A=0:n_A-1
phi_A = pi*(2*i_A + 1)/n_A;
- args{1,++kk} = [sigma_A sigma_A+len_A*cos(phi_A)];
+ kk += 1;
+ args{1,kk} = [sigma_A sigma_A+len_A*cos(phi_A)];
args{2,kk} = [0 len_A*sin(phi_A)];
if (i_A == 1)
args{3,kk} = "k--;asymptotes;";
@@ -252,7 +253,8 @@
endif
# locus next
for ii = 1:rows(rlpol)
- args{1,++kk} = real (rlpol (ii,:));
+ kk += 1;
+ args{1,kk} = real (rlpol (ii,:));
args{2,kk} = imag (rlpol (ii,:));
if (ii == 1)
args{3,kk} = "b-;locus;";
@@ -261,23 +263,28 @@
endif
endfor
# poles and zeros last
- args{1,++kk} = real (olpol);
+ kk += 1;
+ args{1,kk} = real (olpol);
args{2,kk} = imag (olpol);
args{3,kk} = "rx;open loop poles;";
if (! isempty (rlzer))
- args{1,++kk} = real (rlzer);
+ kk += 1;
+ args{1,kk} = real (rlzer);
args{2,kk} = imag (rlzer);
args{3,kk} = "go;zeros;";
endif
set (gcf,"visible","off");
hplt = plot (args{:});
- set (hplt(kk--), "markersize", 2);
+ set (hplt(kk), "markersize", 2);
+ kk -= 1;
if (! isempty (rlzer))
- set (hplt(kk--), "markersize", 2);
+ set (hplt(kk), "markersize", 2);
+ kk -= 1;
endif
for ii = 1:rows(rlpol)
- set (hplt(kk--), "linewidth", 2);
+ set (hplt(kk), "linewidth", 2);
+ kk -= 1;
endfor
legend ("boxon", 2);
grid ("on");
Index: extra/ocs/inst/prs/prs_iff.m
===================================================================
--- extra/ocs/inst/prs/prs_iff.m (revision 7295)
+++ extra/ocs/inst/prs/prs_iff.m (working copy)
@@ -207,7 +207,8 @@
[ns,cnt] = fscanf(fid,"%s","C");
if cnt
- outstruct.namesn(++nnames)=nn;
+ nnames++;
+ outstruct.namesn(nnames)=nn;
outstruct.namess{nnames}=ns;
endif
endwhile
@@ -310,4 +311,4 @@
intvar += outstruct.LCR(LCRcount).nintvar(iel);
endfor
-endfunction
\ No newline at end of file
+endfunction
Index: extra/pdb/inst/strtoz.m
===================================================================
--- extra/pdb/inst/strtoz.m (revision 7295)
+++ extra/pdb/inst/strtoz.m (working copy)
@@ -56,9 +56,11 @@
k++;
endwhile
f = "";
- f(1) = r(k++);
+ f(1) = r(k);
+ k += 1;
if (k <= L) && islower(r(k)),
- f(2) = r(k++);
+ f(2) = r(k);
+ k += 1;
end;
if (k <= L) && isdigit(r(k)),
[m,i] = sscanf(r(k:end), "%d", 1);
Index: main/control/inst/rlocus.m
===================================================================
--- main/control/inst/rlocus.m (revision 7295)
+++ main/control/inst/rlocus.m (working copy)
@@ -248,7 +248,8 @@
sigma_A = (sum(olpol) - sum(olzer))/n_A;
for i_A=0:n_A-1
phi_A = pi*(2*i_A + 1)/n_A;
- args{1,++kk} = [sigma_A sigma_A+len_A*cos(phi_A)];
+ kk = kk + 1;
+ args{1,kk} = [sigma_A sigma_A+len_A*cos(phi_A)];
args{2,kk} = [0 len_A*sin(phi_A)];
if (i_A == 1)
args{3,kk} = "k--;asymptotes;";
@@ -259,7 +260,8 @@
endif
# locus next
for ii = 1:rows(rlpol)
- args{1,++kk} = real (rlpol (ii,:));
+ kk += 1;
+ args{1,kk} = real (rlpol (ii,:));
args{2,kk} = imag (rlpol (ii,:));
if (ii == 1)
args{3,kk} = "b-;locus;";
@@ -268,23 +270,28 @@
endif
endfor
# poles and zeros last
- args{1,++kk} = real (olpol);
+ kk += 1;
+ args{1,kk} = real (olpol);
args{2,kk} = imag (olpol);
args{3,kk} = "rx;open loop poles;";
if (! isempty (rlzer))
- args{1,++kk} = real (rlzer);
+ kk += 1;
+ args{1,kk} = real (rlzer);
args{2,kk} = imag (rlzer);
args{3,kk} = "go;zeros;";
endif
set (gcf,"visible","off");
hplt = plot (args{:});
- set (hplt(kk--), "markersize", 2);
+ set (hplt(kk), "markersize", 2);
+ kk -= 1;
if (! isempty (rlzer))
- set (hplt(kk--), "markersize", 2);
+ set (hplt(kk), "markersize", 2);
+ kk -= 1;
endif
for ii = 1:rows(rlpol)
- set (hplt(kk--), "linewidth", 2);
+ set (hplt(kk), "linewidth", 2);
+ kk -= 1;
endfor
legend ("boxon", 2);
grid ("on");
Index: main/image/devel/__conditional_mark_patterns_lut_fun__.m
===================================================================
--- main/image/devel/__conditional_mark_patterns_lut_fun__.m (revision 7295)
+++ main/image/devel/__conditional_mark_patterns_lut_fun__.m (working copy)
@@ -64,40 +64,40 @@
endif
if(any(op=='K'))
- m|=(sx==8)&&( !x5 || !x7 || !x1 || !x3 ); ## bond 11
+ m|=((sx==8)&&( !x5 || !x7 || !x1 || !x3 )); ## bond 11
endif
if(any(op=='S'))
- m|=(sx==2)&&(x1||x3||x5||x7); ## bond 1
- m|=(sx==2)&&(x0||x2||x4||x6); ## bond 2
- m|=(sx==3)&&((x0&&(x1||x7))||(x2&&(x1||x3))||(x4&&(x3||x5))||(x6&&(x5||x7))); ## bond 3
+ m|=((sx==2)&&(x1||x3||x5||x7)); ## bond 1
+ m|=((sx==2)&&(x0||x2||x4||x6)); ## bond 2
+ m|=((sx==3)&&((x0&&(x1||x7))||(x2&&(x1||x3))||(x4&&(x3||x5))||(x6&&(x5||x7)))); ## bond 3
endif
if(any(op=='ST'))
- m|=(sx==4)&&((x0&&x2&&x3)||(x0&&x2&&x7)||(x1&&x2&&x4)||(x0&&x1&&x6)); ## bond 5
- m|=(sx==4)&&((x0&&x1&&x2)||(x2&&x3&&x4)||(x4&&x5&&x6)||(x6&&x7&&x0)); ## bond 5
- m|=(sx==5)&&((x0&&x2&&x3&&x7)||(x1&&x2&&x4&&x5)); ## bond 6
+ m|=((sx==4)&&((x0&&x2&&x3)||(x0&&x2&&x7)||(x1&&x2&&x4)||(x0&&x1&&x6))); ## bond 5
+ m|=((sx==4)&&((x0&&x1&&x2)||(x2&&x3&&x4)||(x4&&x5&&x6)||(x6&&x7&&x0))); ## bond 5
+ m|=((sx==5)&&((x0&&x2&&x3&&x7)||(x1&&x2&&x4&&x5))); ## bond 6
endif
if(any(op=='STK'))
- m|=(sx==4)&&(all(X(:,3))||all(X(1,:))||all(X(:,1))||all(X(3,:))); ## bond 4
- m|=(sx==5)&&( \ ## bond 6
+ m|=((sx==4)&&(all(X(:,3))||all(X(1,:))||all(X(:,1))||all(X(3,:)))); ## bond 4
+ m|=((sx==5)&&( \ ## bond 6
(all(X(1,:))&&(x0||x4)) || \
(all(X(:,3))&&(x2||x6)) || \
(all(X(:,1))&&(x2||x6)) || \
- (all(X(3,:))&&(x0||x4)) );
- m|=(sx==6)&&( !(x4||x5||x6) || !(x6||x7||x0) || !(x0||x1||x2) || \
- !(x2||x3||x4) ); ## bond 7
- m|=(sx==6)&&( !any(X(:,1)) || !any(X(3,:)) || !any(X(:,3)) || \
- !any(X(1,:)) ); ## bond 8
- m|=(sx==7)&&( !(x4||(x3&&x5)) || !(x6||(x5&&x7)) || \
- !(x0||(x7&&x1)) || !(x2||(x1&&x3)) ); ## bond 9
- m|=(sx==8)&&( !x0 || !x2 || !x4 || !x6 ); ## bond 10
+ (all(X(3,:))&&(x0||x4)) ));
+ m|=((sx==6)&&( !(x4||x5||x6) || !(x6||x7||x0) || !(x0||x1||x2) || \
+ !(x2||x3||x4) )); ## bond 7
+ m|=((sx==6)&&( !any(X(:,1)) || !any(X(3,:)) || !any(X(:,3)) || \
+ !any(X(1,:)) )); ## bond 8
+ m|=((sx==7)&&( !(x4||(x3&&x5)) || !(x6||(x5&&x7)) || \
+ !(x0||(x7&&x1)) || !(x2||(x1&&x3)) )); ## bond 9
+ m|=((sx==8)&&( !x0 || !x2 || !x4 || !x6 )); ## bond 10
endif
if(any(op=='TK'))
##bond 4
- m|=(sx==3)&&( (x0&&x2) || (x2&&x4) || (x4&&x6) || (x6&&x0) );
+ m|=((sx==3)&&( (x0&&x2) || (x2&&x4) || (x4&&x6) || (x6&&x0) ));
endif
endfunction
Index: main/image/inst/imhist.m
===================================================================
--- main/image/inst/imhist.m (revision 7295)
+++ main/image/inst/imhist.m (working copy)
@@ -62,8 +62,11 @@
if (nargout == 2)
[nn,xx] = hist (I(:), bins);
- vr_val_cnt = 1; varargout{vr_val_cnt++} = nn;
- varargout{vr_val_cnt++} = xx;
+ vr_val_cnt = 1;
+ varargout{vr_val_cnt} = nn;
+ vr_val_cnt += 1;
+ varargout{vr_val_cnt} = xx;
+ vr_val_cnt += 1;
else
hist (I(:), bins);
endif
Index: main/image/inst/imsmooth.m
===================================================================
--- main/image/inst/imsmooth.m (revision 7295)
+++ main/image/inst/imsmooth.m (working copy)
@@ -479,7 +479,8 @@
%for i = 1:10
i = 0;
while (true)
- disp(++i)
+ i+=1;
+ disp(i);
ms(ms) = ms;
#new_ms = ms(ms);
if (i >200), break; endif
Index: main/optim/inst/de_min.m
===================================================================
--- main/optim/inst/de_min.m (revision 7295)
+++ main/optim/inst/de_min.m (working copy)
@@ -147,7 +147,8 @@
if nargin > 2,
ctl = struct (varargin{:});
else
- ctl = nth (varargin, va_arg_cnt++);
+ ctl = nth (varargin, va_arg_cnt);
+ va_arg_cnt += 1;
end
if isnumeric (ctl)
if length (ctl)>=1 && !isnan (ctl(1)), XVmin = ctl(1); end
Index: main/optim/inst/nelder_mead_min.m
===================================================================
--- main/optim/inst/nelder_mead_min.m (revision 7295)
+++ main/optim/inst/nelder_mead_min.m (working copy)
@@ -100,7 +100,10 @@
if nargin >= 3, # Read control arguments
va_arg_cnt = 1;
- if nargin > 3, ctl = struct (varargin{:}); else ctl = nth (varargin, va_arg_cnt++); end
+ if nargin > 3, ctl = struct (varargin{:});
+ else ctl = nth (varargin, va_arg_cnt);
+ va_arg_cnt++;
+ end
if isnumeric (ctl)
if length (ctl)>=1 && !isnan (ctl(1)), crit = ctl(1); end
if length (ctl)>=2 && !isnan (ctl(2)), tol = ctl(2); end
@@ -181,10 +184,10 @@
# Compute stopping criterion
done = 0;
- if ! isnan (ftol), done |= (max(y)-min(y)) / max(1,max(abs(y))) < ftol;end
- if ! isnan (rtol), done |= 2*max (max (u) - min (u)) < rtol; end
+ if ! isnan (ftol), done |= ((max(y)-min(y)) / max(1,max(abs(y))) < ftol); end
+ if ! isnan (rtol), done |= (2*max (max (u) - min (u)) < rtol); end
if ! isnan (vtol)
- done |= abs (det (u(1:N,:)-ones(N,1)*u(N+1,:)))/factorial(N) < vtol;
+ done |= (abs (det (u(1:N,:)-ones(N,1)*u(N+1,:)))/factorial(N) < vtol);
end
## [ 2*max (max (u) - min (u)), abs (det (u(1:N,:)-ones(N,1)*u(N+1,:)))/factorial(N);\
## rtol, vtol]
Index: main/optim/inst/d2_min.m
===================================================================
--- main/optim/inst/d2_min.m (revision 7295)
+++ main/optim/inst/d2_min.m (working copy)
@@ -173,10 +173,12 @@
printf ( "d2_min : Initially, v=%8.3g\n",v);
end
-while niter++ <= maxout && nev(1) < maxev
+while niter <= maxout
+ niter += 1;
+ if nev(1) < maxev, break; end;
[v,d,h] = leval (d2f, splice (args, narg, 1, list (reshape (x,sz))));
- nev(2)++;
+ nev(2) += 1;
if prudent && niter <= 1 && \
(! isnumeric (v) || isnan (v) || any (size (v)>1) || \
@@ -190,7 +192,7 @@
if prudent
v2 = leval (f, splice (args, narg, 1, list (reshape (x,sz))));
- nev(1)++;
+ nev(1) += 1;
if abs(v2-v) > 0.001 * sqrt(eps) * max (abs(v2), 1)
printf ("d2_min : f and d2f disagree %8.3g\n",abs(v2-v));
end
@@ -224,11 +226,12 @@
wn = 1 ; # Weight of Newton step
wt = 1 ; # Total weight
- ninner = done_inner = 0; # 0=not found. 1=Ready to quit inner.
+ ninner = 0;
+ done_inner = 0; # 0=not found. 1=Ready to quit inner.
# ##########################################
- while ninner++ < maxinner # Inner loop ###############################
-
+ while ninner < maxinner, # Inner loop ###############################
+ ninner += 1;
# Proposed step
dx = wt*(wn*dnewton - (1-wn)*d) ;
xnew = x+dx ;
@@ -243,7 +246,7 @@
end
vnew = leval (f, splice (args, narg, 1, list (reshape (xnew,sz))));
- nev(1)++ ;
+ nev(1) += 1;
if vnew<vbest # Stash best values
dbest = dx ;
@@ -282,7 +285,7 @@
printf ("d2_min : Whoa!! any(isnan(xnew)) (2)\n");
end
vnew = leval (f, splice (args, narg, 1, list (reshape (xnew,sz))));
- nev(1)++;
+ nev(1) += 1;
while vnew < vbest,
vbest = vnew; # Stash best values
@@ -294,7 +297,7 @@
if verbose
printf ( "Looking farther : v = %8.3g\n",vnew);
end
- nev(1)++;
+ nev(1) += 1;
end
end # End of improving along dbest
# ##########################################
@@ -316,7 +319,7 @@
## "improvement found"
if prudent
tmpv = leval (f, splice (args, narg, 1, list (reshape (xbest,sz))));
- nev(1)++;
+ nev(1) += 1;
if abs (tmpv-vbest) > eps
printf ("d2_min : Whoa! Value at xbest changed by %g\n",\
@@ -339,7 +342,7 @@
# Check whether eval (code) changes value
if prudent
tmpv = leval (f, splice (args, narg, 1, list (reshape (x,sz))));
- nev(1)++;
+ nev(1) += 1;
if abs (tmpv-vbest) > max (min (100*eps,0.00001*abs(vbest)), eps) ,
printf ("d2_min : Whoa! Value changes by %g after eval (code)\n",\
abs (tmpv-vbest));
@@ -383,7 +386,7 @@
# One last check
if prudent
err = leval (f, splice (args, narg, 1, list (reshape (xbest,sz))));
- nev(1)++;
+ nev(1) += 1;
if abs (err-vbest) > eps,
printf ("d2_min : Whoa!! xbest does not eval to vbest\n");
Index: main/optim/inst/cg_min.m
===================================================================
--- main/optim/inst/cg_min.m (revision 7295)
+++ main/optim/inst/cg_min.m (working copy)
@@ -95,10 +95,10 @@
nev = [0, 0];
v = feval (f, args);
-nev(1)++;
+nev(1) += 1;
dxn = lxn = dxn_1 = -feval( dfn, args );
-nev(2)++;
+nev(2) += 1;
done = 0;
@@ -153,13 +153,13 @@
args{narg} = reshape (x, R, C);
v = feval (f, args);
- nev(1)++;
+ nev(1) += 1;
if verbose, printf("cg_min : nev=%4i, v=%8.3g\n",nev(1),v) ; end
## wiki alg 1:
dxn = -feval (dfn, args);
- nev(2)++;
+ nev(2) += 1;
# wiki alg 2:
switch method
Index: main/optim/inst/deriv.m
===================================================================
--- main/optim/inst/deriv.m (revision 7295)
+++ main/optim/inst/deriv.m (working copy)
@@ -28,17 +28,20 @@
endif
if(nargin >= 3)
va_arg_cnt = 1;
- h = nth (varargin, va_arg_cnt++);
+ h = nth (varargin, va_arg_cnt);
+ va_arg_cnt += 1;
if(!is_scalar(h))
error("h must be a scalar.");
endif
if(nargin >= 4)
- O = nth (varargin, va_arg_cnt++);
+ O = nth (varargin, va_arg_cnt);
+ va_arg_cnt += 1;
if((O != 2) && (O != 4))
error("Only order 2 or 4 is supported.\n");
endif
if(nargin >= 5)
- N = nth (varargin, va_arg_cnt++);
+ N = nth (varargin, va_arg_cnt);
+ va_arg_cnt += 1;
if((N > 4)||(N < 1))
error("Only 1st,2nd,3rd or 4th order derivatives are acceptable.\n");
endif
Index: main/optim/inst/minimize.m
===================================================================
--- main/optim/inst/minimize.m (revision 7295)
+++ main/optim/inst/minimize.m (working copy)
@@ -135,7 +135,8 @@
if nargin == 3 # Accomodation to struct and list optional
va_arg_cnt = 1; # args
- tmp = nth (varargin, va_arg_cnt++);
+ tmp = nth (varargin, va_arg_cnt);
+ va_arg_cnt++;
if isstruct (tmp)
opls = list ();
@@ -276,7 +277,7 @@
if strcmp (method, "d2_min"),
[x,v,nev,h] = leval (method, all_args);
# Eventually return inverse of Hessian
- if nargout > 3, vr_val_cnt = 1; varargout{vr_val_cnt++} = h; end
+ if nargout > 3, vr_val_cnt = 1; varargout{vr_val_cnt} = h; vr_val_cnt+=1; end
elseif strcmp (method, "bfgsmin")
nev = nan;
if is_list (args),tmp={};for i=1:length(args),tmp{i}=nth(args,i);end;args=tmp;end
Index: main/statistics/inst/pdist.m
===================================================================
--- main/statistics/inst/pdist.m (revision 7295)
+++ main/statistics/inst/pdist.m (working copy)
@@ -207,7 +207,8 @@
idx = 1;
for ii = 1:l-1
for jj = ii+1:l
- y(idx++) = feval (metric, x(ii,:), x, varargin{:})(jj);
+ y(idx) = feval (metric, x(ii,:), x, varargin{:})(jj);
+ idx += 1;
endfor
endfor
endif
Index: main/time/inst/thirdwednesday.m
===================================================================
--- main/time/inst/thirdwednesday.m (revision 7295)
+++ main/time/inst/thirdwednesday.m (working copy)
@@ -49,7 +49,7 @@
wednesdays = nweekdate (3, 4, year, month);
dates = datevec (wednesdays);
## adjust the year when the date will wrap
- dates(:,1) += dates (:,2) > 9;
+ dates(:,1) += (dates (:,2) > 9);
## adjust the month by three
dates(:,2) = mod (dates(:,2) + 2, 12) + 1;
enddate = reshape (datenum (dates), sz);
Index: main/nnet/inst/__calcjacobian.m
===================================================================
--- main/nnet/inst/__calcjacobian.m (revision 7295)
+++ main/nnet/inst/__calcjacobian.m (working copy)
@@ -124,7 +124,7 @@
## tildeSx = -dFx(n_x^x)
## use mIdentity to calculate the number of targets correctly
## for all other layers, use instead:
- ## tildeSx(-1) = dF1(n_x^(x-1)))(W^x)' * tildeSx;
+ ## tildeSx(-1) = dF1(n_x^(x-1))(W^x)' * tildeSx;
for iLayers = nLayers:-1:1 # this will count from the last
# layer to the first layer ...
Index: main/odepkg/inst/bvp4c.m
===================================================================
--- main/odepkg/inst/bvp4c.m (revision 7295)
+++ main/odepkg/inst/bvp4c.m (working copy)
@@ -174,23 +174,23 @@
endfunction
function x = __bvp4c_solve__ (t, x, h, odefun, bcfun, Nvar, Nint, s)
- fun = @( x ) ( [__bvp4c_fun_u__(t,
- reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)),
+ fun = @( x ) ( [vec(__bvp4c_fun_u__(t,
+ reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)),
reshape(x([1:Nvar*Nint*s]+Nvar*(Nint+1)),Nvar,Nint,s),
h,
s,
Nint,
- Nvar)(:) ;
- __bvp4c_fun_K__(t,
- reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)),
+ Nvar));
+ vec(__bvp4c_fun_K__(t,
+ reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)),
reshape(x([1:Nvar*Nint*s]+Nvar*(Nint+1)),Nvar,Nint,s),
odefun,
h,
s,
Nint,
- Nvar)(:);
- bcfun(reshape(x(1:Nvar*(Nint+1)),Nvar,Nint+1)(:,1),
- reshape(x(1:Nvar*(Nint+1)),Nvar,Nint+1)(:,end));
+ Nvar));
+ bcfun(vec(x(1:Nvar)),
+ vec(x(Nvar*Nint+1:Nvar*(Nint+1))));
] );
x = fsolve ( fun, x );
Index: main/signal/inst/square.m
===================================================================
--- main/signal/inst/square.m (revision 7295)
+++ main/signal/inst/square.m (working copy)
@@ -25,7 +25,7 @@
usage('v = square(t [, duty])');
endif
- t /= 2*pi;
+ t /= (2*pi);
v = ones(size(t));
v(t-floor(t) >= duty) = -1;
Index: main/plot/inst/dxfwrite.m
===================================================================
--- main/plot/inst/dxfwrite.m (revision 7295)
+++ main/plot/inst/dxfwrite.m (working copy)
@@ -118,7 +118,8 @@
nb = 0;
for i=1:nargin-1
- tmp_pl = varargin{1+nb++};
+ tmp_pl = varargin{1+nb};
+ nb++;
## Check curve dimension (1, 2 or 3)
if columns(tmp_pl) <= 3
Index: main/zenity/inst/private/zenity_options.m
===================================================================
--- main/zenity/inst/private/zenity_options.m (revision 7295)
+++ main/zenity/inst/private/zenity_options.m (working copy)
@@ -101,7 +101,7 @@
if (pipelining)
break # Move to the next while to process the input
endif
- param = varargin{narg++};
+ param = varargin{narg};narg++;
if (narg <= numel(varargin)) # Check if we are already in the last index
value = varargin{narg}; # this is only for readability later on
@@ -304,7 +304,7 @@
if (!pipelining)
break # It should have already been processed in the previous while block
endif
- param = varargin{narg++};
+ param = varargin{narg};narg++;
if (narg <= numel(varargin)) # Check if we are already in the last index
value = varargin{narg}; # this is only for readability later on
Index: main/irsa/inst/irsa_actcore.m
===================================================================
--- main/irsa/inst/irsa_actcore.m (revision 7295)
+++ main/irsa/inst/irsa_actcore.m (working copy)
@@ -128,7 +128,8 @@
rr_old=rr;
rr = r*r';
beta = rr / rr_old;
- until( rr < thresh2 || k++ >= itmax )
+ k++;
+ until( rr < thresh2 || k > itmax )
rfyp = shift( rfyp', -fmaxn );
endfunction
Index: main/io/inst/fexist.m
===================================================================
--- main/io/inst/fexist.m (revision 7295)
+++ main/io/inst/fexist.m (working copy)
@@ -69,11 +69,11 @@
for c = aspec
switch (c)
case 'r'
- at &= (mypid && mstr(1) == c) || (mygid && mstr(4) == c) || mstr(7) == c;
+ at &= ((mypid && mstr(1) == c) || (mygid && mstr(4) == c) || mstr(7) == c);
case 'w'
- at &= (mypid && mstr(2) == c) || (mygid && mstr(5) == c) || mstr(8) == c;
+ at &= ((mypid && mstr(2) == c) || (mygid && mstr(5) == c) || mstr(8) == c);
case 'x'
- at &= (mypid && mstr(3) == c) || (mygid && mstr(6) == c) || mstr(9) == c;
+ at &= ((mypid && mstr(3) == c) || (mygid && mstr(6) == c) || mstr(9) == c);
otherwise
error ("invalid access type spec: %s", c)
endswitch
Index: main/general/inst/parcellfun.m
===================================================================
--- main/general/inst/parcellfun.m (revision 7295)
+++ main/general/inst/parcellfun.m (working copy)
@@ -303,7 +303,8 @@
endif
endif
if (pjobs < njobs)
- ijob = ++pjobs;
+ pjobs += 1;
+ ijob = pjobs;
## send the next job to the process.
fwrite (cmdw(isubp), ijob, "double");
fflush (cmdw(isubp));
------------------------------------------------------------------------------
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev