diff scripts/special-matrix/gallery.m @ 16933:e39f00a32dc7

maint: Use parentheses around condition for switch(),while(),if() statements. * libinterp/corefcn/dirfns.cc, libinterp/octave-value/ov-fcn-handle.cc, liboctave/array/Sparse.cc, scripts/image/rgb2ind.m, scripts/io/importdata.m, scripts/io/strread.m, scripts/optimization/fminbnd.m, scripts/optimization/sqp.m, scripts/plot/graphics_toolkit.m, scripts/plot/hdl2struct.m, scripts/plot/legend.m, scripts/plot/print.m, scripts/plot/printd.m, scripts/plot/private/__contour__.m, scripts/plot/private/__go_draw_axes__.m, scripts/plot/struct2hdl.m, scripts/polynomial/polyeig.m, scripts/sparse/bicg.m, scripts/specfun/ellipke.m, scripts/special-matrix/gallery.m, scripts/ui/errordlg.m, scripts/ui/helpdlg.m, scripts/ui/inputdlg.m, scripts/ui/listdlg.m, scripts/ui/questdlg.m, scripts/ui/warndlg.m: Use parentheses around condition for switch(),while(),if() statements.
author Rik <rik@octave.org>
date Tue, 09 Jul 2013 14:04:05 -0700
parents 12005245b645
children 00379f9f8773
line wrap: on
line diff
--- a/scripts/special-matrix/gallery.m	Tue Jul 09 12:22:33 2013 -0700
+++ b/scripts/special-matrix/gallery.m	Tue Jul 09 14:04:05 2013 -0700
@@ -1315,7 +1315,7 @@
   x = x(:);
   y = y(:);
 
-  ##  On next line, z = x'; A = z(ones(n,1),:) would be more efficient.
+  ##  FIXME: On next line, z = x'; A = z(ones(n,1),:) would be more efficient.
   A = ones (n, 1) * x';
   for j = 2:n
     A(1:j-1,j) = y(1:j-1);
@@ -1503,16 +1503,16 @@
   if (nargin < 1 || nargin > 2)
     error ("gallery: 1 to 2 arguments are required for lauchli matrix.");
   elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n)
-    error("gallery: N must be an integer for lauchli matrix.")
+    error ("gallery: N must be an integer for lauchli matrix.")
   elseif (! isscalar (mu))
-    error("gallery: MU must be a scalar for lauchli matrix.")
+    error ("gallery: MU must be a scalar for lauchli matrix.")
   endif
 
-  A = (1:n)'*ones(1,n);
-  A = abs(A - A');
+  A = (1:n)'*ones (1,n);
+  A = abs (A - A');
   A = rho .^ A;
-  if imag(rho)
-    A = conj(tril(A,-1)) + triu(A);
+  if (imag (rho))
+    A = conj (tril (A,-1)) + triu (A);
   endif
 endfunction
 
@@ -1928,7 +1928,7 @@
   a(1)   = 2*w;
   a(2:n) = sin (2*pi*w*(1:n-1)) ./ (pi*(1:n-1));
 
-  A = toeplitz(a);
+  A = toeplitz (a);
 endfunction
 
 function H = randhess (x)
@@ -2252,8 +2252,8 @@
     error ("gallery: K must be a numeric scalar for smoke matrix.");
   endif
 
-  w = exp(2*pi*i/n);
-  A = diag( [w.^(1:n-1) 1] ) + diag(ones(n-1,1),1);
+  w = exp (2*pi*i/n);
+  A = diag ( [w.^(1:n-1) 1] ) + diag (ones (n-1,1), 1);
 
   switch (k)
     case (0), A(n,1) = 1;