Mercurial > hg > octave-shane
changeset 13141:e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
* bicg.m, gmres.m, pkg.m: Untabify and remove trailing whitespace.
* libcruft/Makefile.am, libcruft/blas-xtra/cdotc3.f,
libcruft/blas-xtra/cmatm3.f, libcruft/blas-xtra/ddot3.f,
libcruft/blas-xtra/dmatm3.f, libcruft/blas-xtra/sdot3.f,
libcruft/blas-xtra/smatm3.f, libcruft/blas-xtra/zdotc3.f,
libcruft/blas-xtra/zmatm3.f, libcruft/lapack-xtra/crsf2csf.f,
libcruft/lapack-xtra/zrsf2csf.f, liboctave/Array.cc,
liboctave/DASPK-opts.in, liboctave/DASRT-opts.in,
liboctave/DASSL-opts.in, liboctave/LSODE-opts.in,
liboctave/Makefile.a,mliboctave/Quad-opts.in,
liboctave/Sparse-perm-op-defs.h,
scripts/Makefile.a,mscripts/deprecated/glpkmex.m,
scripts/general/blkdiag.m, scripts/general/interp1.m,
scripts/general/profshow.m, scripts/general/quadl.m,
scripts/general/triplequad.m, scripts/help/__makeinfo__.m,
scripts/io/strread.m, scripts/io/textread.m, scripts/io/textscan.m,
scripts/linear-algebra/rank.m, scripts/miscellaneous/gzip.m,
scripts/miscellaneous/private/__xzip__.m,
scripts/miscellaneous/tempdir.m, scripts/miscellaneous/unpack.m,
scripts/pkg/pkg.m, scripts/plot/allchild.m, scripts/plot/ancestor.m,
scripts/plot/cla.m, scripts/plot/clf.m, scripts/plot/findall.m,
scripts/plot/findobj.m, scripts/plot/gca.m, scripts/plot/gcf.m,
scripts/plot/hggroup.m, scripts/plot/isfigure.m,
scripts/plot/ishghandle.m, scripts/plot/legend.m,
scripts/plot/line.m, scripts/plot/loglog.m, scripts/plot/patch.m,
scripts/plot/print.m, scripts/plot/private/__quiver__.m,
scripts/plot/private/__scatter__.m, scripts/plot/rectangle.m,
scripts/plot/semilogx.m, scripts/plot/semilogy.m,
scripts/plot/surface.m, scripts/plot/text.m, scripts/plot/title.m,
scripts/plot/trisurf.m, scripts/plot/view.m, scripts/plot/whitebg.m,
scripts/plot/xlabel.m, scripts/plot/xlim.m, scripts/plot/ylabel.m,
scripts/plot/ylim.m, scripts/plot/zlabel.m, scripts/plot/zlim.m,
scripts/polynomial/mkpp.m, scripts/polynomial/polygcd.m,
scripts/polynomial/ppint.m, scripts/polynomial/ppjumps.m,
scripts/polynomial/ppval.m, scripts/set/setxor.m,
scripts/sparse/bicgstab.m, scripts/sparse/cgs.m,
scripts/sparse/spconvert.m, scripts/specfun/nthroot.m,
scripts/strings/strmatch.m, scripts/strings/untabify.m,
scripts/testfun/demo.m, scripts/testfun/example.m,
src/DLD-FUNCTIONS/filter.cc, src/DLD-FUNCTIONS/mgorth.cc,
src/DLD-FUNCTIONS/quadcc.cc, src/DLD-FUNCTIONS/str2double.cc,
src/Makefile.a,msrc/gl-render.cc, src/gl2ps-renderer.cc,
src/graphics.cc, src/octave-config.cc.in, src/octave-config.in,
src/ov-class.h, src/ov-fcn.h, src/profiler.cc, src/profiler.h,
src/pt-binop.cc, src/pt-unop.cc, src/symtab.cc, src/txt-eng-ft.cc:
Remove trailing whitespace.
line wrap: on
line diff
--- a/libcruft/Makefile.am +++ b/libcruft/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/libcruft/blas-xtra/cdotc3.f +++ b/libcruft/blas-xtra/cdotc3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine cdotc3(m,n,k,a,b,c) -c purpose: a 3-dimensional dot product. +c purpose: a 3-dimensional dot product. c c = sum (conj (a) .* b, 2), where a and b are 3d arrays. c arguments: c m,n,k (in) the dimensions of a and b
--- a/libcruft/blas-xtra/cmatm3.f +++ b/libcruft/blas-xtra/cmatm3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine cmatm3(m,n,k,np,a,b,c) -c purpose: a 3-dimensional matrix product. +c purpose: a 3-dimensional matrix product. c given a (m,k,np) array a and (k,n,np) array b, c calculates a (m,n,np) array c such that c for i = 1:np @@ -28,8 +28,8 @@ c arguments: c m,n,k (in) the dimensions c np (in) number of multiplications -c a (in) a complex input array, size (m,k,np) -c b (in) a complex input array, size (k,n,np) +c a (in) a complex input array, size (m,k,np) +c b (in) a complex input array, size (k,n,np) c c (out) a complex output array, size (m,n,np) integer m,n,k,np complex a(m*k,np),b(k*n,np)
--- a/libcruft/blas-xtra/ddot3.f +++ b/libcruft/blas-xtra/ddot3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine ddot3(m,n,k,a,b,c) -c purpose: a 3-dimensional dot product. +c purpose: a 3-dimensional dot product. c c = sum (a .* b, 2), where a and b are 3d arrays. c arguments: c m,n,k (in) the dimensions of a and b
--- a/libcruft/blas-xtra/dmatm3.f +++ b/libcruft/blas-xtra/dmatm3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine dmatm3(m,n,k,np,a,b,c) -c purpose: a 3-dimensional matrix product. +c purpose: a 3-dimensional matrix product. c given a (m,k,np) array a and (k,n,np) array b, c calculates a (m,n,np) array c such that c for i = 1:np @@ -28,8 +28,8 @@ c arguments: c m,n,k (in) the dimensions c np (in) number of multiplications -c a (in) a double prec. input array, size (m,k,np) -c b (in) a double prec. input array, size (k,n,np) +c a (in) a double prec. input array, size (m,k,np) +c b (in) a double prec. input array, size (k,n,np) c c (out) a double prec. output array, size (m,n,np) integer m,n,k,np double precision a(m*k,np),b(k*n,np)
--- a/libcruft/blas-xtra/sdot3.f +++ b/libcruft/blas-xtra/sdot3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine sdot3(m,n,k,a,b,c) -c purpose: a 3-dimensional dot product. +c purpose: a 3-dimensional dot product. c c = sum (a .* b, 2), where a and b are 3d arrays. c arguments: c m,n,k (in) the dimensions of a and b
--- a/libcruft/blas-xtra/smatm3.f +++ b/libcruft/blas-xtra/smatm3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine smatm3(m,n,k,np,a,b,c) -c purpose: a 3-dimensional matrix product. +c purpose: a 3-dimensional matrix product. c given a (m,k,np) array a and (k,n,np) array b, c calculates a (m,n,np) array c such that c for i = 1:np @@ -28,8 +28,8 @@ c arguments: c m,n,k (in) the dimensions c np (in) number of multiplications -c a (in) a real input array, size (m,k,np) -c b (in) a real input array, size (k,n,np) +c a (in) a real input array, size (m,k,np) +c b (in) a real input array, size (k,n,np) c c (out) a real output array, size (m,n,np) integer m,n,k,np real a(m*k,np),b(k*n,np)
--- a/libcruft/blas-xtra/zdotc3.f +++ b/libcruft/blas-xtra/zdotc3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine zdotc3(m,n,k,a,b,c) -c purpose: a 3-dimensional dot product. +c purpose: a 3-dimensional dot product. c c = sum (conj (a) .* b, 2), where a and b are 3d arrays. c arguments: c m,n,k (in) the dimensions of a and b
--- a/libcruft/blas-xtra/zmatm3.f +++ b/libcruft/blas-xtra/zmatm3.f @@ -19,7 +19,7 @@ c <http://www.gnu.org/licenses/>. c subroutine zmatm3(m,n,k,np,a,b,c) -c purpose: a 3-dimensional matrix product. +c purpose: a 3-dimensional matrix product. c given a (m,k,np) array a and (k,n,np) array b, c calculates a (m,n,np) array c such that c for i = 1:np @@ -28,8 +28,8 @@ c arguments: c m,n,k (in) the dimensions c np (in) number of multiplications -c a (in) a double complex input array, size (m,k,np) -c b (in) a double complex input array, size (k,n,np) +c a (in) a double complex input array, size (m,k,np) +c b (in) a double complex input array, size (k,n,np) c c (out) a double complex output array, size (m,n,np) integer m,n,k,np double complex a(m*k,np),b(k*n,np)
--- a/libcruft/lapack-xtra/crsf2csf.f +++ b/libcruft/lapack-xtra/crsf2csf.f @@ -32,7 +32,7 @@ y = t(j+1,j) if (y /= 0) then -c 2x2 block, form Givens rotation [c, i*s; i*s, c] +c 2x2 block, form Givens rotation [c, i*s; i*s, c] x = t(j,j) z = t(j,j+1) c(j) = sqrt(z/(z-y)) @@ -42,7 +42,7 @@ c apply all rotations to t(1:j+1,j+1) call crcrot1(j+1,t(1,j+1),c,s) c apply new rotation to columns j,j+1 - call crcrot2(j+1,t(1,j),t(1,j+1),c(j),s(j)) + call crcrot2(j+1,t(1,j),t(1,j+1),c(j),s(j)) c zero subdiagonal entry, skip next row t(j+1,j) = 0 c(j+1) = 1
--- a/libcruft/lapack-xtra/zrsf2csf.f +++ b/libcruft/lapack-xtra/zrsf2csf.f @@ -32,7 +32,7 @@ y = t(j+1,j) if (y /= 0) then -c 2x2 block, form Givens rotation [c, i*s; i*s, c] +c 2x2 block, form Givens rotation [c, i*s; i*s, c] x = t(j,j) z = t(j,j+1) c(j) = sqrt(z/(z-y)) @@ -42,7 +42,7 @@ c apply all rotations to t(1:j+1,j+1) call zrcrot1(j+1,t(1,j+1),c,s) c apply new rotation to columns j,j+1 - call zrcrot2(j+1,t(1,j),t(1,j+1),c(j),s(j)) + call zrcrot2(j+1,t(1,j),t(1,j+1),c(j),s(j)) c zero subdiagonal entry, skip next row t(j+1,j) = 0 c(j+1) = 1
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -2485,7 +2485,7 @@ } else { - // Create diag matrix from vector + // Create diag matrix from vector octave_idx_type roff = 0; octave_idx_type coff = 0; if (k > 0)
--- a/liboctave/DASPK-opts.in +++ b/liboctave/DASPK-opts.in @@ -1,17 +1,17 @@ # Copyright (C) 2002-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -262,7 +262,7 @@ A vector of the same length as the state specifying the type of inequality constraint. Each element of the vector corresponds to an element of the state and should be assigned one of the following -codes +codes @table @asis @item -2
--- a/liboctave/DASRT-opts.in +++ b/liboctave/DASRT-opts.in @@ -1,17 +1,17 @@ # Copyright (C) 2002-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/DASSL-opts.in +++ b/liboctave/DASSL-opts.in @@ -1,17 +1,17 @@ # Copyright (C) 2002-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/LSODE-opts.in +++ b/liboctave/LSODE-opts.in @@ -1,17 +1,17 @@ # Copyright (C) 2002-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/liboctave/Quad-opts.in +++ b/liboctave/Quad-opts.in @@ -1,17 +1,17 @@ # Copyright (C) 2002-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -33,7 +33,7 @@ NAME = "relative tolerance" DOC_ITEM Non-negative relative tolerance. If the absolute tolerance is zero, -the relative tolerance must be greater than or equal to +the relative tolerance must be greater than or equal to @w{@code{max (50*eps, 0.5e-28)}}. END_DOC_ITEM @@ -45,7 +45,7 @@ OPTION NAME = "single precision absolute tolerance" DOC_ITEM -Absolute tolerance for single precision; may be zero for pure relative +Absolute tolerance for single precision; may be zero for pure relative error test. END_DOC_ITEM @@ -58,7 +58,7 @@ NAME = "single precision relative tolerance" DOC_ITEM Non-negative relative tolerance for single precision. If the absolute -tolerance is zero, the relative tolerance must be greater than or equal to +tolerance is zero, the relative tolerance must be greater than or equal to @w{@code{max (50*eps, 0.5e-28)}}. END_DOC_ITEM TYPE = "float"
--- a/liboctave/Sparse-perm-op-defs.h +++ b/liboctave/Sparse-perm-op-defs.h @@ -42,14 +42,14 @@ for (octave_idx_type j = 0; j < nc; j++) { octave_quit (); - + OCTAVE_LOCAL_BUFFER (octave_idx_type, sidx, r.xcidx(j+1) - r.xcidx(j)); for (octave_idx_type i = r.xcidx(j), ii = 0; i < r.xcidx(j+1); i++) { sidx[ii++]=i; r.xridx (i) = pcol[a.ridx (i)]; } - sort.sort (r.xridx() + r.xcidx(j), sidx, r.xcidx(j+1) - r.xcidx(j)); + sort.sort (r.xridx() + r.xcidx(j), sidx, r.xcidx(j+1) - r.xcidx(j)); for (octave_idx_type i = r.xcidx(j), ii = 0; i < r.xcidx(j+1); i++) r.xdata(i) = a.data (sidx[ii++]); }
--- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>.
--- a/scripts/deprecated/glpkmex.m +++ b/scripts/deprecated/glpkmex.m @@ -32,7 +32,7 @@ warning ("Octave:deprecated-function", "glpkmex is obsolete and will be removed from a future version of Octave; please use glpk instead"); endif - + ## If there is no input output the version and syntax if (nargin < 4 || nargin > 11) print_usage ();
--- a/scripts/general/blkdiag.m +++ b/scripts/general/blkdiag.m @@ -20,7 +20,7 @@ ## @deftypefn {Function File} {} blkdiag (@var{A}, @var{B}, @var{C}, @dots{}) ## Build a block diagonal matrix from @var{A}, @var{B}, @var{C}, @dots{} ## All the arguments must be numeric and are two-dimensional matrices or -## scalars. If any argument is of type sparse, the output will also be +## scalars. If any argument is of type sparse, the output will also be ## sparse. ## @seealso{diag, horzcat, vertcat, sparse} ## @end deftypefn
--- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -151,7 +151,7 @@ if (isvector (y)) y = y(:); endif - + szy = size (y); y = y(:,:); [ny, nc] = size (y); @@ -192,7 +192,7 @@ case "nearest" pp = mkpp ([x(1); (x(1:nx-1)+x(2:nx))/2; x(nx)], shiftdim (y, 1), szy(2:end)); pp.orient = "first"; - + if (ispp) yi = pp; else @@ -208,7 +208,7 @@ endif case "linear" dy = diff (y); - dx = diff (x); + dx = diff (x); dx = repmat (dx, [1 size(dy)(2:end)]); coefs = [(dy./dx).'(:), y(1:nx-1, :).'(:)]; xx = x; @@ -244,7 +244,7 @@ if (nx == 2 || starmethod) x = linspace (x(1), x(nx), ny); endif - + if (ispp) y = shiftdim (reshape (y, szy), 1); yi = pchip (x, y); @@ -256,7 +256,7 @@ if (nx == 2 || starmethod) x = linspace(x(1), x(nx), ny); endif - + if (ispp) y = shiftdim (reshape (y, szy), 1); yi = spline (x, y);
--- a/scripts/general/profshow.m +++ b/scripts/general/profshow.m @@ -43,7 +43,7 @@ n = fix (n); if (! isscalar (n) || ! isreal (n) || ! (n > 0)) - error ("profile: N must be a positive integer"); + error ("profile: N must be a positive integer"); endif m = length (data.FunctionTable);
--- a/scripts/general/quadl.m +++ b/scripts/general/quadl.m @@ -209,7 +209,7 @@ %!assert (quadl (@(x,a,b) sin (a + b*x), 0, 1, [], [], 2, 3), %! cos(2)/3 - cos(5)/3, - 3e-16) -## test different tolerances. +## test different tolerances. %!assert (quadl (@(x) sin (2 + 3*x).^2, 0, 10, 0.3, []), %! (60 + sin(4) - sin(64))/12, -0.3) %!assert (quadl (@(x) sin (2 + 3*x).^2, 0, 10, 0.1, []),
--- a/scripts/general/triplequad.m +++ b/scripts/general/triplequad.m @@ -50,7 +50,7 @@ print_usage (); endif - ## Allow use of empty matrix ([]) to indicate default + ## Allow use of empty matrix ([]) to indicate default if (isempty (tol)) tol = 1e-6; endif @@ -75,7 +75,7 @@ endfor endfunction - + %!assert (triplequad (@(x,y,z) exp(-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadcc), pi ^ (3/2) * erf(1).^3, 1e-6) %% These tests are too expensive to run normally (~30 sec each). Disable them
--- a/scripts/help/__makeinfo__.m +++ b/scripts/help/__makeinfo__.m @@ -72,11 +72,11 @@ error ("__makeinfo__: second input argument must be a string"); endif - if (nargin < 3) + if (nargin < 3) if (strcmpi (output_type, "plain text")) fsee_also = @(T) strcat ... ("\nSee also:", sprintf (" %s,", T{:})(1:end-1), "\n"); - else + else fsee_also = @(T) strcat ... ("\nSee also:", sprintf (" @ref{%s},", T{:})(1:end-1), "\n"); endif @@ -86,11 +86,11 @@ error (["__makeinfo__: third input argument must ", ... "be the empty matrix, or a function handle"]); endif - + ## It seems like makeinfo sometimes gets angry if the first character ## on a line is a space, so we remove these. - text = strrep (text, "\n ", "\n"); + text = strrep (text, "\n ", "\n"); ## Handle @seealso macro see_also_pat = '@seealso *\{([^}]*)\}';
--- a/scripts/io/strread.m +++ b/scripts/io/strread.m @@ -120,7 +120,7 @@ ## @end itemize ## ## @item "delimiter" -## Any character in @var{value} will be used to split @var{str} into words +## Any character in @var{value} will be used to split @var{str} into words ## (default value = any whitespace). ## ## @item "emptyvalue" @@ -128,7 +128,7 @@ ## ## @item "multipledelimsasone" ## Treat a series of consecutive delimiters, without whitespace in between, -## as a single delimiter. Consecutive delimiter series need not be vertically +## as a single delimiter. Consecutive delimiter series need not be vertically ## "aligned". ## ## @item "treatasempty" @@ -144,7 +144,7 @@ ## trimmed; the string defining whitespace must be enclosed in double ## quotes for proper processing of special characters like \t. ## The default value for whitespace = " \b\r\n\t" (note the space). -## +## ## @end table ## ## @seealso{textscan, textread, load, dlmread, fscanf} @@ -220,7 +220,7 @@ else ## FIXME - a user may have numeric values specified: {'//', 7} ## this will lead to an error in the warning message - error ("strread: unknown or unrecognized comment style '%s'", + error ("strread: unknown or unrecognized comment style '%s'", varargin{n+1}); endif endswitch @@ -290,7 +290,7 @@ ## Remove comments in str if (comment_flag) ## Expand 'eol_char' here, after option processing which may have set value - comment_end = regexprep (comment_end, 'eol_char', eol_char); + comment_end = regexprep (comment_end, 'eol_char', eol_char); cstart = strfind (str, comment_start); cstop = strfind (str, comment_end); ## Treat end of string as additional comment stop @@ -339,7 +339,7 @@ if (! isempty (white_spaces)) ## Check if trailing "\n" might signal padding output arrays to equal size ## before it is trimmed away below - if ((str(end) == 10) && (nargout > 1)) + if ((str(end) == 10) && (nargout > 1)) pad_out = 1; endif ## Remove repeated white_space chars. First find white_space positions @@ -384,7 +384,7 @@ words(idz) = {""}; endfor endif - + ## We now may have to cope with 3 cases: ## A: Trailing literals (%f<literal>) w/o delimiter in between. ## B: Leading literals (<literal>%f) w/o delimiter in between. @@ -398,11 +398,11 @@ idf = cellfun ("isempty", strfind (fmt_words, "%")); ## Find indices and pointers to conversion specifiers with fixed width idg = ! cellfun ("isempty", regexp (fmt_words, '%\*?\d')); - idy = find (idf | idg); + idy = find (idf | idg); ## If needed, split up columns in three steps: if (! isempty (idy)) - ## Try-catch because complexity of strings to read can be infinite + ## Try-catch because complexity of strings to read can be infinite #try ## 1. Assess "period" in the split-up words array ( < num_words_per_line). @@ -446,7 +446,7 @@ ## Word completely "used up". Next word ++iwrd; iwrdp = 0; iwrdl = length (words{iwrd}); endif - + else ## A simple format conv. specifier. Either (1) uses rest of word, or ## (2) is squeezed between current iwrdp and next literal, or (3) uses @@ -462,7 +462,7 @@ endif elseif (iwrdp < iwrdl) ## No bordering literal to the right => field occupies (rest of) word - ++iwrd; iwrdp = 0; + ++iwrd; iwrdp = 0; if (ii < numel (fmt_words)) iwrdl = length (words{iwrd}); endif @@ -478,7 +478,7 @@ tmp_lines = ceil (num_words / words_period); num_words_padded = tmp_lines * words_period - num_words; if (num_words_padded) - words = [words'; cell(num_words_padded, 1)]; + words = [words'; cell(num_words_padded, 1)]; endif words = reshape (words, words_period, tmp_lines); @@ -498,7 +498,7 @@ endif if (! strcmp (fmt_words{ii}, words{icol, 1})) ## Column doesn't exactly match literal => split needed. Insert a column - words(icol+1:end+1, :) = words(icol:end, :); + words(icol+1:end+1, :) = words(icol:end, :); ## Watch out for empty cells jptr = find (! cellfun ("isempty", words(icol, :))); @@ -523,7 +523,7 @@ wdth = floor (str2double (fmt_words{ii}(regexp(fmt_words{ii}, ... '\d') : end-1))); words(icol+1, jptr) = cellfun (@(x) x(wdth+1:end), - words(icol,jptr), "UniformOutput", false); + words(icol,jptr), "UniformOutput", false); words(icol, jptr) = strtrunc (words(icol, jptr), wdth); else ## FIXME: this assumes char(254)/char(255) won't occur in input! @@ -566,7 +566,7 @@ #end_try_catch endif - + ## For each specifier, process corresponding column k = 1; for m = 1:num_words_per_line @@ -587,7 +587,7 @@ switch fmt_words{m}(1:min (2, length (fmt_words{m}))) case "%s" if (pad_out) - data(end+1:num_lines) = {""}; + data(end+1:num_lines) = {""}; endif varargout{k} = data'; k++; @@ -596,7 +596,7 @@ ### FIXME - erroneously formatted data lead to NaN, not an error data = str2double (data); if (! isempty (regexp (fmt_words{m}, "%[du]"))) - ## Cast to integer + ## Cast to integer ## FIXME: NaNs will be transformed into zeros data = int32 (data); end @@ -623,7 +623,7 @@ sprec = str2double (nfmt{2}); data = 10^-sprec * round (10^sprec * data); elseif (! isempty (regexp (fmt_words{m}, "[du]"))) - ## Cast to integer + ## Cast to integer ## FIXME: NaNs will be transformed into zeros data = int32 (data); end @@ -682,7 +682,7 @@ if (!isempty (out) && any (sep == text(end))) out(end) = []; endif - + ## Empty cells converted to empty cellstrings. out(cellfun ("isempty", out)) = {""};
--- a/scripts/io/textread.m +++ b/scripts/io/textread.m @@ -41,7 +41,7 @@ ## delimiters. ## @end itemize ## -## The optional input @var{n} specifes the number of times to use +## The optional input @var{n} specifes the number of times to use ## @var{format} when parsing, i.e., the format repeat count. ## ## @seealso{strread, load, dlmread, fscanf, textscan} @@ -98,9 +98,9 @@ endofline = find (strcmpi (varargin, "endofline"), 1); if (! isempty (endofline)) - ## 'endofline' option set by user. - if (! ischar (varargin{endofline + 1})); - error ("textread: character value required for EndOfLine"); + ## 'endofline' option set by user. + if (! ischar (varargin{endofline + 1})); + error ("textread: character value required for EndOfLine"); endif else ## Determine EOL from file. Search for EOL candidates in first 3000 chars
--- a/scripts/io/textscan.m +++ b/scripts/io/textscan.m @@ -28,7 +28,7 @@ ## The file associated with @var{fid} is read and parsed according to ## @var{format}. The function behaves like @code{strread} except it works by ## parsing a file instead of a string. See the documentation of -## @code{strread} for details. +## @code{strread} for details. ## ## In addition to the options supported by ## @code{strread}, this function supports a few more: @@ -52,7 +52,7 @@ ## have been encountered. If set to 0 or false, return an error and no data. ## @end itemize ## -## The optional input @var{n} specifes the number of times to use +## The optional input @var{n} specifes the number of times to use ## @var{format} when parsing, i.e., the format repeat count. ## ## The output @var{C} is a cell array whose length is given by the number @@ -108,7 +108,7 @@ fmt = regexp (fmt, '[^ ]+', 'match'); fmt = strtrim (fmt(strmatch ("%", fmt))) has_str_fmt = all (cellfun ("isempty", strfind (strtrim (fmt(strmatch ("%", fmt))), 's'))); - ## If there is a format, AND whitespace value = empty, + ## If there is a format, AND whitespace value = empty, ## don't add a space (char(32)) to whitespace if (! (isempty (args{ipos+1}) && has_str_fmt)) args{ipos+1} = unique ([" ", whitespace]); @@ -116,7 +116,7 @@ endif if (! any (strcmpi (args, "delimiter"))) - ## Matlab says default delimiter = whitespace. + ## Matlab says default delimiter = whitespace. ## strread() will pick this up further args(end+1:end+2) = {'delimiter', ""}; endif @@ -156,7 +156,7 @@ ## Beware of zero valued headerline, fskipl would skip to EOF if (! isempty (headerlines) && (args{headerlines + 1} > 0)) fskipl (fid, varargin{headerlines + 1}); - args(headerlines:headerlines+1) = []; + args(headerlines:headerlines+1) = []; endif if (isfinite (nlines) && (nlines >= 0)) str = tmp_str = ""; @@ -183,13 +183,13 @@ ## Check value of 'endofline'. String or file doesn't seem to matter endofline = find (strcmpi (args, "endofline"), 1); if (! isempty (endofline)) - if (ischar (args{endofline + 1})) + if (ischar (args{endofline + 1})) eol_char = args{endofline + 1}; if (isempty (strmatch (eol_char, {"", "\n", "\r", "\r\n"}, 'exact'))) error ("textscan: illegal EndOfLine character value specified"); endif else - error ("textscan: character value required for EndOfLine"); + error ("textscan: character value required for EndOfLine"); endif else ## Determine EOL from file. Search for EOL candidates in first 3000 chars @@ -219,7 +219,7 @@ ## Call strread to make it do the real work C = cell (1, num_fields); [C{:}] = strread (str, format, args{:}); - + ## If requested, collect output columns of same class if (collop) C = colloutp (C);
--- a/scripts/linear-algebra/rank.m +++ b/scripts/linear-algebra/rank.m @@ -60,42 +60,42 @@ endfunction %!test -%! A = [1 2 3 4 5 6 7; -%! 4 5 6 7 8 9 12; -%! 1 2 3.1 4 5 6 7; -%! 2 3 4 5 6 7 8; -%! 3 4 5 6 7 8 9; -%! 4 5 6 7 8 9 10; +%! A = [1 2 3 4 5 6 7; +%! 4 5 6 7 8 9 12; +%! 1 2 3.1 4 5 6 7; +%! 2 3 4 5 6 7 8; +%! 3 4 5 6 7 8 9; +%! 4 5 6 7 8 9 10; %! 5 6 7 8 9 10 11]; %! assert(rank(A),4); %!test -%! A = [1 2 3 4 5 6 7; -%! 4 5 6 7 8 9 12; -%! 1 2 3.0000001 4 5 6 7; -%! 4 5 6 7 8 9 12.00001; -%! 3 4 5 6 7 8 9; -%! 4 5 6 7 8 9 10; +%! A = [1 2 3 4 5 6 7; +%! 4 5 6 7 8 9 12; +%! 1 2 3.0000001 4 5 6 7; +%! 4 5 6 7 8 9 12.00001; +%! 3 4 5 6 7 8 9; +%! 4 5 6 7 8 9 10; %! 5 6 7 8 9 10 11]; %! assert(rank(A),4); %!test -%! A = [1 2 3 4 5 6 7; -%! 4 5 6 7 8 9 12; -%! 1 2 3 4 5 6 7; -%! 4 5 6 7 8 9 12.00001; +%! A = [1 2 3 4 5 6 7; +%! 4 5 6 7 8 9 12; +%! 1 2 3 4 5 6 7; +%! 4 5 6 7 8 9 12.00001; %! 3 4 5 6 7 8 9; -%! 4 5 6 7 8 9 10; +%! 4 5 6 7 8 9 10; %! 5 6 7 8 9 10 11]; %! assert(rank(A),3); %!test -%! A = [1 2 3 4 5 6 7; +%! A = [1 2 3 4 5 6 7; %! 4 5 6 7 8 9 12; %! 1 2 3 4 5 6 7; -%! 4 5 6 7 8 9 12; -%! 3 4 5 6 7 8 9; -%! 4 5 6 7 8 9 10; +%! 4 5 6 7 8 9 12; +%! 3 4 5 6 7 8 9; +%! 4 5 6 7 8 9 10; %! 5 6 7 8 9 10 11]; %! assert(rank(A),3);
--- a/scripts/miscellaneous/gzip.m +++ b/scripts/miscellaneous/gzip.m @@ -31,7 +31,7 @@ if (nargin != 1 && nargin != 2) || (nargout > 1) print_usage (); endif - + if (nargout == 0) __xzip__ ("gzip", "gz", "gzip -r %s", varargin{:}); else
--- a/scripts/miscellaneous/private/__xzip__.m +++ b/scripts/miscellaneous/private/__xzip__.m @@ -36,7 +36,7 @@ if (nargin != 4 && nargin != 5) print_usage (); endif - + if (! ischar (extension) || length (extension) == 0) error ("__xzip__: EXTENSION must be a string with finite length"); endif
--- a/scripts/miscellaneous/tempdir.m +++ b/scripts/miscellaneous/tempdir.m @@ -47,9 +47,9 @@ %! old_tmpdir = getenv ("TMPDIR"); %! unwind_protect %! setenv ("TMPDIR", "__MY_TMP_DIR__"); -%! assert (tempdir (), ["__MY_TMP_DIR__" filesep()]); +%! assert (tempdir (), ["__MY_TMP_DIR__" filesep()]); %! unwind_protect_cleanup %! setenv ("TMPDIR", old_tmpdir); %! warning (old_wstate); -%! end_unwind_protect +%! end_unwind_protect
--- a/scripts/miscellaneous/unpack.m +++ b/scripts/miscellaneous/unpack.m @@ -38,12 +38,12 @@ print_usage (); endif - if (! ischar (file) && ! iscellstr (file)) + if (! ischar (file) && ! iscellstr (file)) error ("unpack: invalid input file class, %s", class(file)); endif ## character arrays of more than one string must be treated as cell strings - if (ischar (file) && ! isvector (file)) + if (ischar (file) && ! isvector (file)) file = cellstr (file); endif @@ -222,7 +222,7 @@ ## Parse the output from zip and unzip. ## Skip first line which is Archive header - output(1) = []; + output(1) = []; for i = 1:length (output) files{i} = output{i}(14:length(output{i})); endfor
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -21,7 +21,7 @@ ## @deftypefn {Command} {} pkg @var{command} @var{pkg_name} ## @deftypefnx {Command} {} pkg @var{command} @var{option} @var{pkg_name} ## Manage packages (groups of add-on functions) for Octave. Different actions -## are available depending on the value of @var{command}. +## are available depending on the value of @var{command}. ## ## Available commands: ## @@ -55,7 +55,7 @@ ## starting Octave. This overrides any setting within the package. ## ## @item -local -## A local installation (package available only to current user) is forced, +## A local installation (package available only to current user) is forced, ## even if the user has system privileges. ## ## @item -global @@ -131,7 +131,7 @@ ## If two output arguments are requested @code{pkg} splits the list of ## installed packages into those which were installed by the current user, ## and those which were installed by the system administrator. -## +## ## @example ## [user_packages, system_packages] = pkg ("list") ## @end example @@ -1355,7 +1355,7 @@ flags = cstrcat (flags, " RANLIB=\"", octave_config_info ("RANLIB"), "\""); endif [status, output] = shell (cstrcat ("cd '", src, "'; ", scenv, - "./configure --prefix=\"", + "./configure --prefix=\"", desc.dir, "\"", flags)); if (status != 0) rm_rf (desc.dir);
--- a/scripts/plot/allchild.m +++ b/scripts/plot/allchild.m @@ -51,7 +51,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! l = line; %! assert(get(allchild(hf),'type'),{'axes'; 'uimenu'; 'uimenu'; 'uimenu'}) %! unwind_protect_cleanup
--- a/scripts/plot/ancestor.m +++ b/scripts/plot/ancestor.m @@ -77,7 +77,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! l = line; %! assert (ancestor (l, "axes"), gca); %! assert (ancestor (l, "figure"), hf);
--- a/scripts/plot/cla.m +++ b/scripts/plot/cla.m @@ -91,7 +91,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! plot (1:10) %! cla () %! kids = get (gca, "children");
--- a/scripts/plot/clf.m +++ b/scripts/plot/clf.m @@ -78,7 +78,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! l = line; %! assert (!isempty (get (gcf, "children"))); %! unwind_protect_cleanup @@ -87,7 +87,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! clf; %! assert (isempty (get (gcf, "children"))); %! unwind_protect_cleanup
--- a/scripts/plot/findall.m +++ b/scripts/plot/findall.m @@ -45,7 +45,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = findall (hf); %! all_handles = {"uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "uimenu"; "figure"}; %! assert (get (h, 'type'), all_handles)
--- a/scripts/plot/findobj.m +++ b/scripts/plot/findobj.m @@ -245,7 +245,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! l = line; %! obj = findobj (hf, "type", "line"); %! assert (l, obj);
--- a/scripts/plot/gca.m +++ b/scripts/plot/gca.m @@ -53,7 +53,7 @@ %!test %! hf = figure ("visible", "off"); %! ax = axes; -%! unwind_protect +%! unwind_protect %! assert (gca, ax); %! unwind_protect_cleanup %! close (hf);
--- a/scripts/plot/gcf.m +++ b/scripts/plot/gcf.m @@ -56,7 +56,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! assert (gcf, hf); %! unwind_protect_cleanup %! close (hf);
--- a/scripts/plot/hggroup.m +++ b/scripts/plot/hggroup.m @@ -44,7 +44,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = hggroup; %! assert (findobj (hf, "type", "hggroup"), h); %! assert (get (h, "type"), "hggroup");
--- a/scripts/plot/isfigure.m +++ b/scripts/plot/isfigure.m @@ -37,7 +37,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! assert (isfigure (hf)); %! assert (!isfigure (-hf)); %! unwind_protect_cleanup
--- a/scripts/plot/ishghandle.m +++ b/scripts/plot/ishghandle.m @@ -29,7 +29,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! assert (ishghandle (hf)); %! assert (!ishghandle (-hf)); %! l = line;
--- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -288,7 +288,7 @@ if (! isempty (hlegend)) set (hlegend, "box", "off", "visible", "off"); endif - elseif (nargs == 0 && !(strcmp (position, "default") && + elseif (nargs == 0 && !(strcmp (position, "default") && strcmp (orientation, "default"))) if (! isempty (hlegend)) hax = getfield (get (hlegend, "userdata"), "handle"); @@ -298,14 +298,14 @@ h = legend (hax, hplots, text_strings, "orientation", orientation); elseif (strcmp (orientation, "default")) if (outside) - h = legend (hax, hplots, text_strings, "location", + h = legend (hax, hplots, text_strings, "location", strcat (position, "outside")); else h = legend (hax, hplots, text_strings, "location", position); endif else if (outside) - h = legend (hax, hplots, text_strings, "location", + h = legend (hax, hplots, text_strings, "location", strcat (position, "outside"), "orientation", orientation); else h = legend (hax, hplots, text_strings, "location", position,
--- a/scripts/plot/line.m +++ b/scripts/plot/line.m @@ -45,7 +45,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = line; %! assert (findobj (hf, "type", "line"), h); %! assert (get (h, "xdata"), [0 1], eps);
--- a/scripts/plot/loglog.m +++ b/scripts/plot/loglog.m @@ -71,11 +71,11 @@ %! clf (); %! a = logspace (-5, 1, 10); %! b =-logspace (-5, 1, 10); -%! +%! %! subplot (1, 2, 1) %! loglog (a, b) %! xlabel ('loglog (a, b)') -%! +%! %! subplot (1, 2, 2) %! loglog (a, abs (b)) %! set (gca, 'ydir', 'reverse') @@ -83,7 +83,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! a = logspace (-5, 1, 10); %! b = logspace (-5, 1, 10); %! loglog (a, b) @@ -95,7 +95,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! a = logspace (-5, 1, 10); %! b =-logspace (-5, 1, 10); %! loglog (a, b)
--- a/scripts/plot/patch.m +++ b/scripts/plot/patch.m @@ -154,7 +154,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = patch; %! assert (findobj (hf, "type", "patch"), h); %! assert (get (h, "xdata"), [0; 1; 1], eps);
--- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -611,7 +611,7 @@ "print.m: error closing file '%s'", latexfile); endif ## TODO - should this be fixed in GL2PS? - latex = strrep (latex, "\\includegraphics{}", + latex = strrep (latex, "\\includegraphics{}", sprintf ("\\includegraphics{%s}", graphicsfile)); else error ("print:erroropeningfile",
--- a/scripts/plot/private/__quiver__.m +++ b/scripts/plot/private/__quiver__.m @@ -125,8 +125,8 @@ sd = sqrt (dx.^2 + dy.^2 + dz.^2) / len; if (sd != 0) s = sqrt(2) * autoscale * sd; - else # special case of identical points with multiple vectors - s = autoscale; + else # special case of identical points with multiple vectors + s = autoscale; endif uu = s * u; vv = s * v;
--- a/scripts/plot/private/__scatter__.m +++ b/scripts/plot/private/__scatter__.m @@ -368,14 +368,14 @@ if (isempty (z1)) for i = 1 : length (hlist) set (hlist(i), "vertices", [x1(i), y1(i)], "cdata", - reshape(c1(i,:),[1, size(c1)(2:end)]), + reshape(c1(i,:),[1, size(c1)(2:end)]), "facevertexcdata", c1(i,:), "markersize", size1(i)); endfor else for i = 1 : length (hlist) set (hlist(i), "vertices", [x1(i), y1(i), z1(i)], "cdata", - reshape(c1(i,:),[1, size(c1)(2:end)]), + reshape(c1(i,:),[1, size(c1)(2:end)]), "facevertexcdata", c1(i,:), "markersize", size1(i)); endfor
--- a/scripts/plot/rectangle.m +++ b/scripts/plot/rectangle.m @@ -33,7 +33,7 @@ ## and may be a scalar or two-element vector with values between 0 and 1. ## A value of 0 represents no curvature of the side, whereas a value of 1 ## means that the side is entirely curved into the arc of a circle. -## If @var{curv} is a two-element vector, then the first element is the +## If @var{curv} is a two-element vector, then the first element is the ## curvature along the x-axis of the patch and the second along y-axis. ## ## If @var{curv} is a scalar, it represents the curvature of the shorter of the @@ -44,8 +44,8 @@ ## min (pos (1:2)) / max (pos (1:2)) * curv ## @end example ## -## Other properties are passed to the underlying patch command. If called -## with an output argument, @code{rectangle} returns the handle to the +## Other properties are passed to the underlying patch command. If called +## with an output argument, @code{rectangle} returns the handle to the ## rectangle. ## @end deftypefn ## @seealso{patch}
--- a/scripts/plot/semilogx.m +++ b/scripts/plot/semilogx.m @@ -69,11 +69,11 @@ %! clf (); %! a = logspace (-5, 1, 10); %! b =-logspace (-5, 1, 10); -%! +%! %! subplot (1, 2, 1) %! semilogx (b, a) %! xlabel ('semilogx (a, b)') -%! +%! %! subplot (1, 2, 2) %! semilogx (abs (b), a) %! set (gca, 'ydir', 'reverse') @@ -81,7 +81,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! a = logspace (-5, 1, 10); %! b = logspace (-5, 1, 10); %! semilogx (a, b) @@ -93,7 +93,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! a = logspace (-5, 1, 10); %! b =-logspace (-5, 1, 10); %! semilogx (a, b)
--- a/scripts/plot/semilogy.m +++ b/scripts/plot/semilogy.m @@ -70,11 +70,11 @@ %! clf (); %! a = logspace (-5, 1, 10); %! b =-logspace (-5, 1, 10); -%! +%! %! subplot (1, 2, 1) %! semilogy (a, b) %! xlabel ('semilogy (a, b)') -%! +%! %! subplot (1, 2, 2) %! semilogy (a, abs (b)) %! set (gca, 'ydir', 'reverse') @@ -82,7 +82,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! a = logspace (-5, 1, 10); %! b = logspace (-5, 1, 10); %! semilogy (a, b) @@ -94,7 +94,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! a = logspace (-5, 1, 10); %! b =-logspace (-5, 1, 10); %! semilogy (a, b)
--- a/scripts/plot/surface.m +++ b/scripts/plot/surface.m @@ -165,7 +165,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = surface; %! assert (findobj (hf, "type", "surface"), h); %! assert (get (h, "xdata"), 1:3, eps);
--- a/scripts/plot/text.m +++ b/scripts/plot/text.m @@ -220,7 +220,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = text (0.5, 0.3, "char"); %! assert ("char", class (get (h, "string"))) %! h = text (0.5, 0.4, ["char row 1"; "char row 2"]);
--- a/scripts/plot/title.m +++ b/scripts/plot/title.m @@ -54,7 +54,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! ax=axes(); %! xl = get(ax,"title"); %! title("Testing title") @@ -65,7 +65,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! plot3 ([0,1], [0,1], [0,1]); %! xl = get(gca (), "title"); %! title("Testing title")
--- a/scripts/plot/trisurf.m +++ b/scripts/plot/trisurf.m @@ -81,22 +81,22 @@ %!demo %! x = rand (100, 1); %! y = rand (100, 1); -%! z = x.^2 + y.^2; -%! tri = delaunay (x, y); +%! z = x.^2 + y.^2; +%! tri = delaunay (x, y); %! trisurf (tri, x, y, z) %!demo %! x = rand (100, 1); %! y = rand (100, 1); -%! z = x.^2 + y.^2; -%! tri = delaunay (x, y); +%! z = x.^2 + y.^2; +%! tri = delaunay (x, y); %! trisurf (tri, x, y, z, "facecolor", "interp") %!demo %! x = rand (100, 1); %! y = rand (100, 1); -%! z = x.^2 + y.^2; -%! tri = delaunay (x, y); +%! z = x.^2 + y.^2; +%! tri = delaunay (x, y); %! trisurf (tri, x, y, z, "facecolor", "interp", "edgecolor", "k")
--- a/scripts/plot/view.m +++ b/scripts/plot/view.m @@ -96,7 +96,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! plot3 ([0,1], [0,1], [0,1]); %! [az, el] = view; %! assert ([az, el], [-37.5, 30], eps); @@ -112,7 +112,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! line; %! [az, el] = view; %! assert ([az, el], [0, 90], eps);
--- a/scripts/plot/whitebg.m +++ b/scripts/plot/whitebg.m @@ -148,7 +148,7 @@ %! dac = get (0, "defaultaxescolor"); %! dfc = get (0, "defaultfigurecolor"); %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! l = line; %! assert (get (hf, "color"), dfc); %! assert (get (gca, "color"), dac);
--- a/scripts/plot/xlabel.m +++ b/scripts/plot/xlabel.m @@ -56,7 +56,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! x = xlabel ("xlabel_string"); %! assert (get(gca, "xlabel"), x); %! assert (get(x, "type"), "text");
--- a/scripts/plot/xlim.m +++ b/scripts/plot/xlim.m @@ -76,7 +76,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! plot3 ([0,1], [0,1], [0,1]); %! xlim ([0, 1.1]); %! assert (get (gca, "xlim"), [0, 1.1], eps); @@ -87,7 +87,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! h = plot3 ([0,1.1], [0,1], [0, 1]); %! assert (get (gca, "xlim"), [0, 1.4], eps); %! assert (xlim ("mode"), "auto");
--- a/scripts/plot/ylabel.m +++ b/scripts/plot/ylabel.m @@ -50,7 +50,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! y = ylabel ("ylabel_string"); %! assert (get(gca, "ylabel"), y); %! assert (get(y, "type"), "text");
--- a/scripts/plot/ylim.m +++ b/scripts/plot/ylim.m @@ -75,7 +75,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! limy = [0, 1.1]; %! plot3 ([0,1], [0,1], [0,1]); %! ylim (limy); @@ -87,7 +87,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! plot3 ([0,1], [0,1.1], [0, 1]); %! assert (get (gca, "ylim"), [0, 1.4], eps); %! assert (ylim ("mode"), "auto");
--- a/scripts/plot/zlabel.m +++ b/scripts/plot/zlabel.m @@ -50,7 +50,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! z = zlabel ("zlabel_string"); %! assert (get(gca, "zlabel"), z); %! assert (get(z, "type"), "text"); @@ -63,7 +63,7 @@ %!test %! hf = figure ("visible", "off"); %! plot3 (0, 0, 0); -%! unwind_protect +%! unwind_protect %! z = zlabel ("zlabel_string"); %! assert (get(gca, "zlabel"), z); %! assert (get(z, "type"), "text");
--- a/scripts/plot/zlim.m +++ b/scripts/plot/zlim.m @@ -75,7 +75,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! limz = [0, 1.1]; %! plot3 ([0,1], [0,1], [0,1]); %! zlim (limz); @@ -87,7 +87,7 @@ %!test %! hf = figure ("visible", "off"); -%! unwind_protect +%! unwind_protect %! plot3 ([0,1], [0,1], [0, 1.1]); %! assert (get (gca, "zlim"), [0, 1.4], eps); %! assert (zlim ("mode"), "auto");
--- a/scripts/polynomial/mkpp.m +++ b/scripts/polynomial/mkpp.m @@ -22,21 +22,21 @@ ## ## Construct a piece-wise polynomial (pp) structure from sample points ## @var{breaks} and coefficients @var{coefs}. @var{breaks} must be a vector of -## strictly increasing values. The number of intervals is given by +## strictly increasing values. The number of intervals is given by ## @code{@var{ni} = length (@var{breaks}) - 1}. -## When @var{m} is the polynomial order @var{coefs} must be of +## When @var{m} is the polynomial order @var{coefs} must be of ## size: @var{ni} x @var{m} + 1. ## ## The i-th row of @var{coefs}, ## @code{@var{coefs} (@var{i},:)}, contains the coefficients for the polynomial -## over the @var{i}-th interval, ordered from highest (@var{m}) to +## over the @var{i}-th interval, ordered from highest (@var{m}) to ## lowest (@var{0}). ## ## @var{coefs} may also be a multi-dimensional array, specifying a vector-valued ## or array-valued polynomial. In that case the polynomial order is defined ## by the length of the last dimension of @var{coefs}. ## The size of first dimension(s) are given by the scalar or -## vector @var{d}. If @var{d} is not given it is set to @code{1}. +## vector @var{d}. If @var{d} is not given it is set to @code{1}. ## In any case @var{coefs} is reshaped to a 2d matrix of ## size @code{[@var{ni}*prod(@var{d} @var{m})] } ## @@ -72,7 +72,7 @@ if (nargin == 3) pp.dim = d; pp.order /= prod (d); - endif + endif dim_vec = [pp.pieces * prod(pp.dim), pp.order]; pp.coefs = reshape (P, dim_vec);
--- a/scripts/polynomial/polygcd.m +++ b/scripts/polynomial/polygcd.m @@ -95,7 +95,7 @@ %!test %! assert (deconv (poly(1:8), polygcd (poly(1:8), poly(3:12))), poly(1:2), sqrt (eps)) -%!test +%!test %! for ii=1:10 %! p = (unique (randn (10, 1)) * 10).'; %! p1 = p(3:end);
--- a/scripts/polynomial/ppint.m +++ b/scripts/polynomial/ppint.m @@ -48,7 +48,7 @@ tmp = -cumsum (ppjumps (ppi), length (d) + 1); ppi.coefs(prod(d)+1:end, k) = tmp(:); - + endfunction %!shared x,y,pp,ppi
--- a/scripts/polynomial/ppjumps.m +++ b/scripts/polynomial/ppjumps.m @@ -28,7 +28,7 @@ if (nargin != 1) print_usage (); endif - + if (! isstruct (pp) && strcmp (pp.form, "pp")) error ("ppjumps: PP must be a structure"); endif @@ -52,7 +52,7 @@ llim .*= dx; llim += shiftdim (reshape (P(1:(n-1) * prod (d), i), [d, n-1]), nd - 1); endfor - + rlim = shiftdim (ppval (pp, x(2:end-1)), nd - 1); jumps = shiftdim (rlim - llim, 1); endfunction
--- a/scripts/polynomial/ppval.m +++ b/scripts/polynomial/ppval.m @@ -18,12 +18,12 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{yi} =} ppval (@var{pp}, @var{xi}) -## Evaluate piece-wise polynomial structure @var{pp} at the points @var{xi}. +## Evaluate piece-wise polynomial structure @var{pp} at the points @var{xi}. ## If @var{pp} describes a scalar polynomial function, the result is an ## array of the same shape as @var{xi}. ## Otherwise, the size of the result is @code{[pp.dim, length(@var{xi})]} if ## @var{xi} is a vector, or @code{[pp.dim, size(@var{xi})]} if it is a -## multi-dimensional array. +## multi-dimensional array. ## ##, the dimensions are permuted as ## in interp1, to @@ -43,13 +43,13 @@ ## Extract info. [x, P, n, k, d] = unmkpp (pp); - + ## dimension checks sxi = size (xi); if (isvector (xi)) xi = xi(:).'; endif - + nd = length (d); ## Determine intervals. @@ -60,7 +60,7 @@ P = shiftdim (P, nd); P = reshape (P, [n, k, d]); Pidx = P(idx(:), :);#2d matrix size x: coefs*prod(d) y: prod(sxi) - + if (isvector(xi)) Pidx = reshape (Pidx, [xn, k, d]); Pidx = shiftdim (Pidx, 1); @@ -83,12 +83,12 @@ if (k > 1) yi = shiftdim (reshape (Pidx(1,:), dimvec), ndv - 1); endif - + for i = 2 : k; yi .*= dx; yi += shiftdim (reshape (Pidx(i,:), dimvec), ndv - 1); endfor - + ## Adjust shape. if ((numel (xi) > 1) || (length (d) == 1)) yi = reshape (shiftdim (yi, 1), dimvec); @@ -104,7 +104,7 @@ #if (d == 1) # yi = reshape (yi, sxi); #endif - + endfunction %!shared b,c,pp,pp2,xi,abserr
--- a/scripts/set/setxor.m +++ b/scripts/set/setxor.m @@ -1,4 +1,4 @@ -## Copyright (C) 2008-2011 Jaroslav Hajek +## Copyright (C) 2008-2011 Jaroslav Hajek ## Copyright (C) 2000, 2006-2007 Paul Kienzle ## ## This file is part of Octave.
--- a/scripts/sparse/bicg.m +++ b/scripts/sparse/bicg.m @@ -15,30 +15,30 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## +## ## @deftypefn {Function File} {@var{x} =} bicg (@var{A}, @var{b}, @var{rtol}, @var{maxit}, @var{M1}, @var{M2}, @var{x0}) ## @deftypefnx {Function File} {@var{x} =} bicg (@var{A}, @var{b}, @var{rtol}, @var{maxit}, @var{P}) ## @deftypefnx {Function File} {[@var{x}, @var{flag}, @var{relres}, @var{iter}, @var{resvec}] =} bicg (@var{A}, @var{b}, ...) ## Solve @code{A x = b} using the Bi-conjugate gradient iterative method. ## ## @itemize @minus -## @item @var{rtol} is the relative tolerance, if not given +## @item @var{rtol} is the relative tolerance, if not given ## or set to [] the default value 1e-6 is used. -## @item @var{maxit} the maximum number of outer iterations, -## if not given or set to [] the default value +## @item @var{maxit} the maximum number of outer iterations, +## if not given or set to [] the default value ## @code{min (20, numel (b))} is used. -## @item @var{x0} the initial guess, if not given or set to [] -## the default value @code{zeros (size (b))} is used. +## @item @var{x0} the initial guess, if not given or set to [] +## the default value @code{zeros (size (b))} is used. ## @end itemize ## -## @var{A} can be passed as a matrix or as a function handle or +## @var{A} can be passed as a matrix or as a function handle or ## inline function @code{f} such that @code{f(x, "notransp") = A*x} ## and @code{f(x, "transp") = A'*x}. ## -## The preconditioner @var{P} is given as @code{P = M1 * M2}. -## Both @var{M1} and @var{M2} can be passed as a matrix or as -## a function handle or inline function @code{g} such that -## @code{g(x, 'notransp') = M1 \ x} or @code{g(x, 'notransp') = M2 \ x} and +## The preconditioner @var{P} is given as @code{P = M1 * M2}. +## Both @var{M1} and @var{M2} can be passed as a matrix or as +## a function handle or inline function @code{g} such that +## @code{g(x, 'notransp') = M1 \ x} or @code{g(x, 'notransp') = M2 \ x} and ## @code{g(x, 'transp') = M1' \ x} or @code{g(x, 'transp') = M2' \ x}. ## ## If colled with more than one output parameter @@ -52,7 +52,7 @@ ## @end itemize ## (the value 2 is unused but skipped for compatibility). ## @item @var{relres} is the final value of the relative residual. -## @item @var{iter} is the number of iterations performed. +## @item @var{iter} is the number of iterations performed. ## @item @var{resvec} is a vector containing the relative residual at each iteration. ## @end itemize ## @@ -64,7 +64,7 @@ function [x, flag, res1, k, resvec] = bicg (A, b, tol, maxit, M1, M2, x0) if (nargin >= 2 && isvector (full (b))) - + if (ischar (A)) fun = str2func (A); Ax = @(x) feval (fun, x, "notransp"); @@ -105,7 +105,7 @@ error (["bicg: preconditioner is expected to " ... "be a function or matrix"]); endif - + if (nargin < 6 || isempty (M2)) M2m1x = @(x, ignore) x; M2tm1x = M2m1x; @@ -144,44 +144,44 @@ res0 = Inf; if (any (r0 != 0)) - + for k = 1:maxit - a = (s0' * Pm1x (r0)) ./ (f' * Ax (d)); + a = (s0' * Pm1x (r0)) ./ (f' * Ax (d)); - x += a * d; - y += conj (a) * f; + x += a * d; + y += conj (a) * f; - r1 = r0 - a * Ax (d); - s1 = s0 - conj (a) * Atx (f); + r1 = r0 - a * Ax (d); + s1 = s0 - conj (a) * Atx (f); - beta = (s1' * Pm1x (r1)) ./ (s0' * Pm1x (r0)); + beta = (s1' * Pm1x (r1)) ./ (s0' * Pm1x (r0)); - d = Pm1x (r1) + beta * d; - f = Ptm1x (s1) + conj (beta) * f; + d = Pm1x (r1) + beta * d; + f = Ptm1x (s1) + conj (beta) * f; - r0 = r1; - s0 = s1; + r0 = r1; + s0 = s1; - res1 = norm (b - Ax (x)) / bnorm; - if (res1 < tol) + res1 = norm (b - Ax (x)) / bnorm; + if (res1 < tol) flag = 0; if (nargout < 2) - printf ("bicg converged at iteration %i ", k); + printf ("bicg converged at iteration %i ", k); printf ("to a solution with relative residual %e\n", res1); endif - break; - endif - - if (res0 <= res1) + break; + endif + + if (res0 <= res1) flag = 3; - printf ("bicg stopped at iteration %i ", k); + printf ("bicg stopped at iteration %i ", k); printf ("without converging to the desired tolerance %e\n", tol); printf ("because the method stagnated.\n"); printf ("The iterate returned (number %i) ", k-1); printf ("has relative residual %e\n", res0); - break - endif + break + endif res0 = res1; if (nargout > 4) resvec(k) = res0; @@ -190,7 +190,7 @@ if (k == maxit) flag = 1; - printf ("bicg stopped at iteration %i ", maxit); + printf ("bicg stopped at iteration %i ", maxit); printf ("without converging to the desired tolerance %e\n", tol); printf ("because the maximum number of iterations was reached. "); printf ("The iterate returned (number %i) has ", maxit); @@ -203,33 +203,33 @@ printf ("bicg converged after 0 interations\n"); endif endif - + else print_usage (); endif - + endfunction; %!test -%! n = 100; +%! n = 100; %! A = spdiags ([-2*ones(n,1) 4*ones(n,1) -ones(n,1)], -1:1, n, n); -%! b = sum (A, 2); -%! tol = 1e-8; +%! b = sum (A, 2); +%! tol = 1e-8; %! maxit = 15; -%! M1 = spdiags ([ones(n,1)/(-2) ones(n,1)],-1:0, n, n); -%! M2 = spdiags ([4*ones(n,1) -ones(n,1)], 0:1, n, n); +%! M1 = spdiags ([ones(n,1)/(-2) ones(n,1)],-1:0, n, n); +%! M2 = spdiags ([4*ones(n,1) -ones(n,1)], 0:1, n, n); %! [x, flag, relres, iter, resvec] = bicg (A, b, tol, maxit, M1, M2); %! assert (x, ones (size (b)), 1e-7); %! %!test -%! n = 100; +%! n = 100; %! A = spdiags ([-2*ones(n,1) 4*ones(n,1) -ones(n,1)], -1:1, n, n); -%! b = sum (A, 2); -%! tol = 1e-8; +%! b = sum (A, 2); +%! tol = 1e-8; %! maxit = 15; -%! M1 = spdiags ([ones(n,1)/(-2) ones(n,1)],-1:0, n, n); -%! M2 = spdiags ([4*ones(n,1) -ones(n,1)], 0:1, n, n); +%! M1 = spdiags ([ones(n,1)/(-2) ones(n,1)],-1:0, n, n); +%! M2 = spdiags ([4*ones(n,1) -ones(n,1)], 0:1, n, n); %! %! function y = afun (x, t, a) %! switch t @@ -240,15 +240,15 @@ %! endswitch %! endfunction %! -%! [x, flag, relres, iter, resvec] = bicg (@(x, t) afun (x, t, A), +%! [x, flag, relres, iter, resvec] = bicg (@(x, t) afun (x, t, A), %! b, tol, maxit, M1, M2); %! assert (x, ones (size (b)), 1e-7); %!test -%! n = 100; -%! tol = 1e-8; +%! n = 100; +%! tol = 1e-8; %! a = sprand (n, n, .1); %! A = a' * a + 100 * eye (n); -%! b = sum (A, 2); +%! b = sum (A, 2); %! [x, flag, relres, iter, resvec] = bicg (A, b, tol, [], diag (diag (A))); %! assert (x, ones (size (b)), 1e-7);
--- a/scripts/sparse/bicgstab.m +++ b/scripts/sparse/bicgstab.m @@ -18,7 +18,7 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## +## ## @deftypefn {Function File} {@var{x} =} bicgstab (@var{A}, @var{b}, @var{rtol}, @var{maxit}, @var{M1}, @var{M2}, @var{x0}) ## @deftypefnx {Function File} {@var{x} =} bicgstab (@var{A}, @var{b}, @var{rtol}, @var{maxit}, @var{P}) ## @deftypefnx {Function File} {[@var{x}, @var{flag}, @var{relres}, @var{iter}, @var{resvec}] =} bicgstab (@var{A}, @var{b}, ...) @@ -34,11 +34,11 @@ ## default value @code{zeros (size (b))} is used. ## @end itemize ## -## @var{A} can be passed as a matrix or as a function handle or +## @var{A} can be passed as a matrix or as a function handle or ## inline function @code{f} such that @code{f(x) = A*x}. ## -## The preconditioner @var{P} is given as @code{P = M1 * M2}. -## Both @var{M1} and @var{M2} can be passed as a matrix or as a function handle or +## The preconditioner @var{P} is given as @code{P = M1 * M2}. +## Both @var{M1} and @var{M2} can be passed as a matrix or as a function handle or ## inline function @code{g} such that @code{g(x) = M1 \ x} or @code{g(x) = M2 \ x}. ## ## If called with more than one output parameter @@ -52,7 +52,7 @@ ## @end itemize ## (the value 2 is unused but skipped for compatibility). ## @item @var{relres} is the final value of the relative residual. -## @item @var{iter} is the number of iterations performed. +## @item @var{iter} is the number of iterations performed. ## @item @var{resvec} is a vector containing the relative residual at each iteration. ## @end itemize ## @@ -60,11 +60,11 @@ ## ## @end deftypefn -function [x, flag, relres, iter, resvec] = bicgstab (A, b, tol, maxit, +function [x, flag, relres, iter, resvec] = bicgstab (A, b, tol, maxit, M1, M2, x0) if (nargin >= 2 && nargin <= 7 && isvector (full (b))) - + if (ischar (A)) A = str2func (A); elseif (ismatrix (A)) @@ -75,7 +75,7 @@ error (["bicgstab: first argument is expected " ... "to be a function or a square matrix"]); endif - + if (nargin < 3 || isempty (tol)) tol = 1e-6; endif @@ -96,7 +96,7 @@ error (["bicgstab: preconditioner is " ... "expected to be a function or matrix"]); endif - + if (nargin < 6 || isempty (M2)) M2m1x = @(x) x; elseif (ischar (M2)) @@ -115,7 +115,7 @@ if (nargin < 7 || isempty (x0)) x0 = zeros (size (b)); endif - + ## specifies initial estimate x0 if (nargin < 7) x = zeros (rows (b), 1); @@ -206,33 +206,33 @@ %!shared A, b, n, M1, M2 %! %!test -%! n = 100; +%! n = 100; %! A = spdiags ([-2*ones(n,1) 4*ones(n,1) -ones(n,1)], -1:1, n, n); -%! b = sum (A, 2); -%! tol = 1e-8; +%! b = sum (A, 2); +%! tol = 1e-8; %! maxit = 15; -%! M1 = spdiags ([ones(n,1)/(-2) ones(n,1)],-1:0, n, n); -%! M2 = spdiags ([4*ones(n,1) -ones(n,1)], 0:1, n, n); +%! M1 = spdiags ([ones(n,1)/(-2) ones(n,1)],-1:0, n, n); +%! M2 = spdiags ([4*ones(n,1) -ones(n,1)], 0:1, n, n); %! [x, flag, relres, iter, resvec] = bicgstab (A, b, tol, maxit, M1, M2); %! assert (x, ones (size (b)), 1e-7); %! %!test -%! tol = 1e-8; +%! tol = 1e-8; %! maxit = 15; %! %! function y = afun (x, a) %! y = a * x; %! endfunction %! -%! [x, flag, relres, iter, resvec] = bicgstab (@(x) afun (x, A), b, +%! [x, flag, relres, iter, resvec] = bicgstab (@(x) afun (x, A), b, %! tol, maxit, M1, M2); %! assert (x, ones (size (b)), 1e-7); %!test -%! n = 100; -%! tol = 1e-8; +%! n = 100; +%! tol = 1e-8; %! a = sprand (n, n, .1); %! A = a'*a + 100 * eye (n); -%! b = sum (A, 2); +%! b = sum (A, 2); %! [x, flag, relres, iter, resvec] = bicgstab (A, b, tol, [], diag (diag (A))); %! assert (x, ones (size (b)), 1e-7);
--- a/scripts/sparse/cgs.m +++ b/scripts/sparse/cgs.m @@ -18,7 +18,7 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## +## ## @deftypefn {Function File} {@var{x} =} cgs (@var{A}, @var{b}, @var{rtol}, @var{maxit}, @var{M1}, @var{M2}, @var{x0}) ## @deftypefnx {Function File} {@var{x} =} cgs (@var{A}, @var{b}, @var{rtol}, @var{maxit}, @var{P}) ## @deftypefnx {Function File} {[@var{x}, @var{flag}, @var{relres}, @var{iter}, @var{resvec}] =} cgs (@var{A}, @var{b}, ...) @@ -35,10 +35,10 @@ ## default value @code{zeros (size (b))} is used. ## @end itemize ## -## @var{A} can be passed as a matrix or as a function handle or +## @var{A} can be passed as a matrix or as a function handle or ## inline function @code{f} such that @code{f(x) = A*x}. ## -## The preconditioner @var{P} is given as @code{P = M1 * M2}. +## The preconditioner @var{P} is given as @code{P = M1 * M2}. ## Both @var{M1} and @var{M2} can be passed as a matrix or as a function ## handle or inline function @code{g} such that @code{g(x) = M1 \ x} or ## @code{g(x) = M2 \ x}. @@ -54,7 +54,7 @@ ## @end itemize ## (the value 2 is unused but skipped for compatibility). ## @item @var{relres} is the final value of the relative residual. -## @item @var{iter} is the number of iterations performed. +## @item @var{iter} is the number of iterations performed. ## @item @var{resvec} is a vector containing the relative residual at ## each iteration. ## @end itemize @@ -65,7 +65,7 @@ function [x, flag, relres, iter, resvec] = cgs (A, b, tol, maxit, M1, M2, x0) if (nargin >= 2 && nargin <= 7 && isvector (full (b))) - + if (ischar (A)) A = str2func (A); elseif (ismatrix (A)) @@ -73,18 +73,18 @@ elseif (isa (A, "function_handle")) Ax = @(x) feval (A, x); else - error (["cgs: first argument is expected to "... + error (["cgs: first argument is expected to "... "be a function or a square matrix"]); endif - + if (nargin < 3 || isempty (tol)) tol = 1e-6; endif - + if (nargin < 4 || isempty (maxit)) maxit = min (rows (b), 20); endif - + if (nargin < 5 || isempty (M1)) M1m1x = @(x) x; elseif (ischar (M1)) @@ -96,7 +96,7 @@ else error ("cgs: preconditioner is expected to be a function or matrix"); endif - + if (nargin < 6 || isempty (M2)) M2m1x = @(x) x; elseif (ischar (M2)) @@ -115,9 +115,9 @@ x0 = zeros (size (b)); endif - + x = x0; - + res = b - Ax (x); norm_b = norm (b); ## Vector of the residual norms for each iteration. @@ -192,27 +192,27 @@ %!shared A, b, n, M %! %!test -%! n = 100; +%! n = 100; %! A = spdiags ([-ones(n,1) 4*ones(n,1) -ones(n,1)], -1:1, n, n); -%! b = sum (A, 2); -%! tol = 1e-8; +%! b = sum (A, 2); +%! tol = 1e-8; %! maxit = 1000; -%! M = 4*eye (n); +%! M = 4*eye (n); %! [x, flag, relres, iter, resvec] = cgs (A, b, tol, maxit, M); %! assert (x, ones (size (b)), 1e-7); %! %!test -%! tol = 1e-8; +%! tol = 1e-8; %! maxit = 15; %! %! [x, flag, relres, iter, resvec] = cgs (@(x) A * x, b, tol, maxit, M); %! assert (x, ones (size (b)), 1e-7); %!test -%! n = 100; -%! tol = 1e-8; +%! n = 100; +%! tol = 1e-8; %! a = sprand (n, n, .1); %! A = a'*a + 100 * eye (n); -%! b = sum (A, 2); +%! b = sum (A, 2); %! [x, flag, relres, iter, resvec] = cgs (A, b, tol, [], diag (diag (A))); %! assert (x, ones (size (b)), 1e-7);
--- a/scripts/sparse/gmres.m +++ b/scripts/sparse/gmres.m @@ -1,17 +1,17 @@ ## Copyright (C) 2009-2011 Carlo de Falco -## +## ## This file is part of Octave. -## +## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 3 of the License, or (at your ## option) any later version. -## +## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. -## +## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. @@ -68,9 +68,9 @@ function [x, flag, presn, it] = gmres (A, b, restart, rtol, maxit, M1, M2, x0) if (nargin < 2 || nargin > 8) - print_usage (); + print_usage (); end - + if (ischar (A)) Ax = str2func (A); elseif (ismatrix (A)) @@ -104,7 +104,7 @@ else error ("gmres: preconditioner M1 must be a function or matrix"); endif - + if (nargin < 7 || isempty (M2)) M2m1x = @(x) x; elseif (ischar (M2)) @@ -123,57 +123,57 @@ x0 = zeros (size (b)); endif - x_old = x0; + x_old = x0; x = x_old; prec_res = Pm1x (b - Ax (x_old)); presn = norm (prec_res, 2); - + B = zeros (restart + 1, 1); V = zeros (rows (x), restart); H = zeros (restart + 1, restart); ## begin loop iter = 1; - restart_it = restart + 1; + restart_it = restart + 1; resids = zeros (maxit, 1); resids(1) = presn; prec_b_norm = norm (Pm1x (b), 2); flag = 1; while (iter <= maxit * restart && presn > rtol * prec_b_norm) - + ## restart if (restart_it > restart) restart_it = 1; - x_old = x; + x_old = x; prec_res = Pm1x (b - Ax (x_old)); presn = norm (prec_res, 2); B(1) = presn; H(:) = 0; V(:, 1) = prec_res / presn; - endif - + endif + ## basic iteration tmp = Pm1x (Ax (V(:, restart_it))); [V(:,restart_it+1), H(1:restart_it+1, restart_it)] = ... mgorth (tmp, V(:,1:restart_it)); - + Y = (H(1:restart_it+1, 1:restart_it) \ B (1:restart_it+1)); - + little_res = B(1:restart_it+1) - ... H(1:restart_it+1, 1:restart_it) * Y(1:restart_it); presn = norm (little_res, 2); - + x = x_old + V(:, 1:restart_it) * Y(1:restart_it); - + resids(iter) = presn; if (norm (x - x_old, inf) <= eps) flag = 3; break endif - restart_it++ ; + restart_it++ ; iter++; endwhile @@ -191,12 +191,12 @@ %! dim = 100; %!test %! A = spdiags ([-ones(dim,1) 2*ones(dim,1) ones(dim,1)], [-1:1], dim, dim); -%! b = ones(dim, 1); +%! b = ones(dim, 1); %! x = gmres (A, b, 10, 1e-10, dim, @(x) x./diag(A), [], b); %! assert(x, A\b, 1e-9*norm(x,inf)); %! %!test -%! x = gmres (A, b, dim, 1e-10, 1e4, @(x) diag(diag(A))\x, [], b); +%! x = gmres (A, b, dim, 1e-10, 1e4, @(x) diag(diag(A))\x, [], b); %! assert(x, A\b, 1e-7*norm(x,inf)); %! %!test
--- a/scripts/sparse/spconvert.m +++ b/scripts/sparse/spconvert.m @@ -49,7 +49,7 @@ %! i = [1; 3; 5]; %! j = [2; 4; 6]; %! v = [7; 8; 9]; -%! s = spconvert ([i, j, v]); +%! s = spconvert ([i, j, v]); %! assert (issparse (s)); %! [fi, fj, fv] = find (s); %! assert (isequal (i, fi) && isequal (j, fj) && isequal (v, fv));
--- a/scripts/specfun/nthroot.m +++ b/scripts/specfun/nthroot.m @@ -35,7 +35,7 @@ ## @end group ## @end example ## -## @var{x} must have all real entries. @var{n} must be a scalar. +## @var{x} must have all real entries. @var{n} must be a scalar. ## If @var{n} is an even integer and @var{X} has negative entries, an ## error is produced. ## @seealso{realsqrt, sqrt, cbrt}
--- a/scripts/strings/strmatch.m +++ b/scripts/strings/strmatch.m @@ -27,7 +27,7 @@ ## @var{s} only needs to match @var{A} up to the length of @var{s}. ## Trailing spaces and nulls in @var{s} and @var{A} are ignored when matching. ## option. -## +## ## For example: ## ## @example
--- a/scripts/strings/untabify.m +++ b/scripts/strings/untabify.m @@ -57,13 +57,13 @@ elseif (! (ischar (t) || iscellstr (t))) error ("untabify: T must be a string or cellstring"); endif - + if (ischar (t)) s = replace_tabs (t, tw); else s = cellfun (@(str) replace_tabs (str, tw), t, "uniformoutput", false); endif - + if (dblank) s = deblank (s); endif
--- a/scripts/testfun/demo.m +++ b/scripts/testfun/demo.m @@ -97,7 +97,7 @@ n = 0; elseif (ischar (n)) n = str2double (n); - endif + endif [code, idx] = test (name, "grabdemo"); if (isempty (idx))
--- a/scripts/testfun/example.m +++ b/scripts/testfun/example.m @@ -45,7 +45,7 @@ n = 0; elseif (ischar (n)) n = str2double (n); - endif + endif [code, idx] = test (name, "grabdemo"); if (nargout > 0)
--- a/src/DLD-FUNCTIONS/filter.cc +++ b/src/DLD-FUNCTIONS/filter.cc @@ -727,7 +727,7 @@ %! x(1,1,:,:) = [1 2 3 4; 5 6 7 8; 9 10 11 12]; %! y0 = [1 1 6 2 15 3 2 1 8 2 18 3 3 1 10 2 21 3 4 1 12 2 24 3]; %! y0 = reshape (y0, size (x)); -%! y = filter([1 1 1], 1, x, [], 3); +%! y = filter([1 1 1], 1, x, [], 3); %! assert (y, y0); */
--- a/src/DLD-FUNCTIONS/mgorth.cc +++ b/src/DLD-FUNCTIONS/mgorth.cc @@ -31,8 +31,8 @@ #include "gripes.h" template <class ColumnVector, class Matrix, class RowVector> -static void -do_mgorth (ColumnVector& x, const Matrix& V, RowVector& h) +static void +do_mgorth (ColumnVector& x, const Matrix& V, RowVector& h) { octave_idx_type Vc = V.columns (); h = RowVector (Vc + 1); @@ -71,7 +71,7 @@ if (nargin != 2 || nargout > 2) { - print_usage (); + print_usage (); return retval; } @@ -90,7 +90,7 @@ { error ("mgorth: X and V must be numeric"); } - + bool iscomplex = (arg_x.is_complex_type () || arg_v.is_complex_type ()); if (arg_x.is_single_type () || arg_v.is_single_type ()) { @@ -139,7 +139,7 @@ } /* - + %!test %! for ii=1:100; assert (abs (mgorth (randn (5, 1), eye (5, 4))), [0 0 0 0 1]', eps); endfor
--- a/src/DLD-FUNCTIONS/quadcc.cc +++ b/src/DLD-FUNCTIONS/quadcc.cc @@ -1636,7 +1636,7 @@ else { nivals = 1 + args(4).length (); - if (nivals > cquad_heapsize) + if (nivals > cquad_heapsize) { error ("quadcc: maximum number of singular points is limited to %i", cquad_heapsize-1); @@ -2243,7 +2243,7 @@ } -/* +/* %!assert (quadcc(@sin,-pi,pi), 0, 1e-6) %!assert (quadcc(inline('sin'),-pi,pi), 0, 1e-6)
--- a/src/DLD-FUNCTIONS/str2double.cc +++ b/src/DLD-FUNCTIONS/str2double.cc @@ -271,7 +271,7 @@ } else if (args(0).is_cell ()) { - const Cell cell = args(0).cell_value (); + const Cell cell = args(0).cell_value (); if (! error_state) { @@ -286,7 +286,7 @@ } else retval = NDArray (args(0).dims (), octave_NaN); - + return retval; }
--- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,17 +3,17 @@ # Copyright (C) 1993-2011 John W. Eaton # # This file is part of Octave. -# +# # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. -# +# # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. @@ -24,7 +24,7 @@ @CPPFLAGS@ -I../libgnu -I$(top_srcdir)/libgnu \ -I$(top_srcdir)/libcruft/misc \ -I../liboctave -I$(top_srcdir)/liboctave \ - -I. -I$(srcdir) + -I. -I$(srcdir) AUTOMAKE_OPTIONS = subdir-objects @@ -56,7 +56,7 @@ octave-config endif -## Order matters here. Leave builtins.cc last, because it depends on +## Order matters here. Leave builtins.cc last, because it depends on ## $(DEF_FILES), and building those requires all the sources ## (except builtins.cc) to be available. BUILT_SOURCES = \ @@ -568,7 +568,7 @@ -DMAKE_BUILTINS $< | $(srcdir)/mkdefs $(srcdir) $< > $@-t mv $@-t $@ -## Special rules: +## Special rules: ## Mostly for sources which must be built before rest of compilation. ## defaults.h and oct-conf.h must depend on Makefile. Calling configure
--- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -1270,7 +1270,7 @@ yPlaneN, yPlaneN, signum(xPlane-xPlaneN)*fx*zticklen/2, 0., 0., 2, false); - } + } } gh_manager::get_object (props.get_zlabel ()).set ("visible", "on"); @@ -2374,7 +2374,7 @@ { if (c.numel () == 0) c = props.get_color_data ().matrix_value (); - has_markerfacecolor = ((c.numel () > 0) + has_markerfacecolor = ((c.numel () > 0) && (c.rows () == f.rows ())); } }
--- a/src/gl2ps-renderer.cc +++ b/src/gl2ps-renderer.cc @@ -230,7 +230,7 @@ std::string s = sv.join ("\n"); - gl2psTextOpt (s.c_str (), fontname.c_str (), fontsize, + gl2psTextOpt (s.c_str (), fontname.c_str (), fontsize, alignment_to_mode (halign, valign), props.get_rotation ()); }
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -3396,7 +3396,7 @@ double thrshldy = 0.005*outpos(3); double minsizex = 0.2*outpos(2); double minsizey = 0.2*outpos(3); - bool updatex = true, updatey = true; + bool updatex = true, updatey = true; for (int i = 0; i < 10; i++) { double dt; @@ -3469,7 +3469,7 @@ inset(1) = pos(1)-outpos(1); inset(2) = outpos(0)+outpos(2)-pos(0)-pos(2); inset(3) = outpos(1)+outpos(3)-pos(1)-pos(3); - + tightinset = inset; } @@ -4939,7 +4939,7 @@ ext(2) = ext(2)-ext(0); ext(3) = ext(3)-ext(1); - + return ext; } @@ -5137,8 +5137,8 @@ } else { - b = static_cast<int> (gnulib::floor (std::log10 (std::abs (x)))); - a = x / std::pow (10.0, b); + b = static_cast<int> (gnulib::floor (std::log10 (std::abs (x)))); + a = x / std::pow (10.0, b); } }
--- a/src/octave-config.cc.in +++ b/src/octave-config.cc.in @@ -219,6 +219,6 @@ return 1; } } - + return 0; }
--- a/src/octave-config.in +++ b/src/octave-config.in @@ -19,7 +19,7 @@ ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. -## +## ## Original version by Rafael Laboissiere <rafael@laboissiere.net> ## distributed as free software in the public domain.
--- a/src/ov-class.h +++ b/src/ov-class.h @@ -127,14 +127,14 @@ size_t nparents (void) const { return parent_list.size (); } octave_value reshape (const dim_vector& new_dims) const - { + { octave_class retval = octave_class (*this); retval.map = retval.map_value().reshape (new_dims); return octave_value (new octave_class (retval)); } octave_value resize (const dim_vector& dv, bool = false) const - { + { octave_class retval = octave_class (*this); retval.map.resize (dv); return octave_value (new octave_class (retval));
--- a/src/ov-fcn.h +++ b/src/ov-fcn.h @@ -60,7 +60,7 @@ virtual bool is_system_fcn_file (void) const { return false; } virtual std::string fcn_file_name (void) const { return std::string (); } - + // The name to show in the profiler (also used as map-key). virtual std::string profiler_name (void) const { return name (); }
--- a/src/profiler.cc +++ b/src/profiler.cc @@ -118,7 +118,7 @@ if (fcn_id != 0) { stats& entry = data[fcn_id - 1]; - + entry.time += time; entry.calls += calls;
--- a/src/profiler.h +++ b/src/profiler.h @@ -91,7 +91,7 @@ }; typedef std::vector<stats> flat_profile; - + // Store data for one node in the call-tree of the hierarchical profiler // data we collect. class tree_node
--- a/src/pt-binop.cc +++ b/src/pt-binop.cc @@ -301,11 +301,11 @@ %!test %! x = 0; %! do_braindead_shortcircuit_evaluation (0); -%! if (1 | (x = 1)) +%! if (1 | (x = 1)) %! endif %! assert (x, 1); %! do_braindead_shortcircuit_evaluation (1); -%! if (1 | (x = 0)) +%! if (1 | (x = 0)) %! endif %! assert (x, 1);
--- a/src/pt-unop.cc +++ b/src/pt-unop.cc @@ -74,7 +74,7 @@ if (! error_state) { BEGIN_PROFILER_BLOCK ("prefix " + oper ()) - + ref.do_unary_op (etype); if (! error_state)
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -1511,10 +1511,10 @@ %!shared old_state %! old_state = ignore_function_time_stamp (); %!test -%! state = ignore_function_time_stamp ("all"); +%! state = ignore_function_time_stamp ("all"); %! assert (state, old_state); %! assert (ignore_function_time_stamp (), "all"); -%! state = ignore_function_time_stamp ("system"); +%! state = ignore_function_time_stamp ("system"); %! assert (state, "all"); %! assert (ignore_function_time_stamp (), "system"); %! ignore_function_time_stamp (old_state);
--- a/src/txt-eng-ft.cc +++ b/src/txt-eng-ft.cc @@ -202,7 +202,7 @@ ft_render::ft_render (void) : text_processor (), face (0), bbox (1, 4, 0.0), - xoffset (0), yoffset (0), multiline_halign (0), + xoffset (0), yoffset (0), multiline_halign (0), multiline_align_xoffsets(), mode (MODE_BBOX), red (0), green (0), blue (0) { @@ -285,7 +285,7 @@ { glyph_index = FT_Get_Char_Index (face, str[i]); - if (str[i] != '\n' + if (str[i] != '\n' && (! glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT))) ::warning ("ft_render: skipping missing glyph for character `%c'", @@ -301,14 +301,14 @@ if (!glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)) { ::warning ("ft_render: skipping missing glyph for character ` '"); - } - else + } + else { line_index++; xoffset = multiline_align_xoffsets[line_index]; yoffset -= (face->size->metrics.height >> 6); } - } + } else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL)) ::warning ("ft_render: unable to render glyph for character `%c'", str[i]); @@ -372,11 +372,11 @@ // Reset the pixel width for this newline, so we don't // allocate a bounding box larger than the horizontal // width of the multi-line - box_line_width = 0; + box_line_width = 0; bbox(1) -= (face->size->metrics.height >> 6); } - } - else + } + else { // width if (previous) @@ -427,19 +427,19 @@ } if (mode == MODE_BBOX) { - /* Push last the width associated with the last line */ + /* Push last the width associated with the last line */ multiline_align_xoffsets.push_back(box_line_width); for (unsigned int i = 0; i < multiline_align_xoffsets.size(); i++) { /* Center align */ - if (multiline_halign == 1) + if (multiline_halign == 1) multiline_align_xoffsets[i] = (bbox(2) - multiline_align_xoffsets[i])/2; /* Right align */ else if (multiline_halign == 2) multiline_align_xoffsets[i] = (bbox(2) - multiline_align_xoffsets[i]); /* Left align */ - else + else multiline_align_xoffsets[i] = 0; } } @@ -557,7 +557,7 @@ text_element *elt = text_parser_none ().parse (txt); Matrix extent = get_extent (elt, rotation); delete elt; - + return extent; } @@ -583,7 +583,7 @@ { // FIXME: clip "rotation" between 0 and 360 int rot_mode = rotation_to_mode (rotation); - + multiline_halign = halign; text_element *elt = text_parser_none ().parse (txt);