Mercurial > octave
changeset 30330:01de0045b2e3
maint: Shorten some long lines to <= 80 characters (bug #57599)
* audiorecorder.m, disable_diagonal_matrix.m, disable_permutation_matrix.m,
disable_range.m, atan2d.m, accumdim.m, bitcmp.m, blkdiag.m, cplxpair.m,
dblquad.m, integral2.m, integral3.m, interp2.m, interpn.m, logspace.m,
delaunayn.m, griddata3.m, imread.m, genvarname.m, strread.m, nthargout.m,
parseparams.m, lsqnonneg.m, qp.m, sqp.m, material.m, __gnuplot_legend__.m,
plot.m, __gnuplot_drawnow__.m, polygcd.m, polyvalm.m, setdiff.m, fftfilt.m,
eigs.m, betainc.m, cosint.m, factor.m, gallery.m, toeplitz.m, discrete_cdf.m,
discrete_inv.m, discrete_pdf.m, iqr.m, kurtosis.m, quantile.m, bin2dec.m,
isstrprop.m, mat2str.m, strchr.m, strsplit.m, __have_feature__.m, datenum.m,
datevec.m, eomday.m, weboptions.m:
maint: Shorten some long lines to <= 80 characters.
line wrap: on
line diff
--- a/scripts/audio/@audiorecorder/audiorecorder.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/audio/@audiorecorder/audiorecorder.m Tue Nov 23 13:28:34 2021 -0800 @@ -89,7 +89,8 @@ %!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0 %! recorder = audiorecorder (); -%! set (recorder, {"SampleRate", "Tag", "UserData"}, {8000, "tag", [1, 2; 3, 4]}); +%! set (recorder, {"SampleRate", "Tag", "UserData"}, +%! {8000, "tag", [1, 2; 3, 4]}); %! assert (recorder.SampleRate, 8000); %! assert (recorder.Tag, "tag"); %! assert (recorder.UserData, [1, 2; 3, 4]);
--- a/scripts/deprecated/disable_diagonal_matrix.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/deprecated/disable_diagonal_matrix.m Tue Nov 23 13:28:34 2021 -0800 @@ -30,12 +30,12 @@ ## Query or set whether storing diagonal matrices in a special space-efficient ## format is disabled. ## -## The default value is false. If this option is set to true, Octave will store -## ranges as full matrices. +## The default value is false. If this option is set to true, Octave will +## store ranges as full matrices. ## -## When called from inside a function with the @qcode{"local"} option, the setting -## is changed locally for the function and any subroutines it calls. The original -## setting is restored when exiting the function. +## When called from inside a function with the @qcode{"local"} option, the +## setting is changed locally for the function and any subroutines it calls. +## The original setting is restored when exiting the function. ## @seealso{disable_diagonal_matrix, disable_permutation_matrix} ## @end deftypefn
--- a/scripts/deprecated/disable_permutation_matrix.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/deprecated/disable_permutation_matrix.m Tue Nov 23 13:28:34 2021 -0800 @@ -30,12 +30,12 @@ ## Query or set whether storing permutation matrices in a special ## space-efficient format is disabled. ## -## The default value is false. If this option is set to true, Octave will store -## ranges as full matrices. +## The default value is false. If this option is set to true, Octave will +## store ranges as full matrices. ## -## When called from inside a function with the @qcode{"local"} option, the setting -## is changed locally for the function and any subroutines it calls. The original -## setting is restored when exiting the function. +## When called from inside a function with the @qcode{"local"} option, the +## setting is changed locally for the function and any subroutines it calls. +## The original setting is restored when exiting the function. ## @seealso{disable_diagonal_matrix, disable_permutation_matrix} ## @end deftypefn
--- a/scripts/deprecated/disable_range.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/deprecated/disable_range.m Tue Nov 23 13:28:34 2021 -0800 @@ -30,12 +30,12 @@ ## Query or set whether storing ranges in a special space-efficient format is ## disabled. ## -## The default value is false. If this option is set to true, Octave will store -## ranges as full matrices. +## The default value is false. If this option is set to true, Octave will +## store ranges as full matrices. ## -## When called from inside a function with the @qcode{"local"} option, the setting -## is changed locally for the function and any subroutines it calls. The original -## setting is restored when exiting the function. +## When called from inside a function with the @qcode{"local"} option, the +## setting is changed locally for the function and any subroutines it calls. +## The original setting is restored when exiting the function. ## @seealso{disable_diagonal_matrix, disable_permutation_matrix} ## @end deftypefn
--- a/scripts/elfun/atan2d.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/elfun/atan2d.m Tue Nov 23 13:28:34 2021 -0800 @@ -41,7 +41,8 @@ endfunction -%!assert (atan2d (-1:.1:1, 1:-.1:-1), 180/pi * atan2 (-1:.1:1, 1:-.1:-1), -10*eps) +%!assert (atan2d (-1:.1:1, 1:-.1:-1), +%! 180/pi * atan2 (-1:.1:1, 1:-.1:-1), -10*eps) %!error <Invalid call> atan2d () %!error <Invalid call> atan2d (1)
--- a/scripts/general/accumdim.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/accumdim.m Tue Nov 23 13:28:34 2021 -0800 @@ -162,9 +162,12 @@ %! a = rand (5, 5, 5); %!assert (accumdim ([1;3;1;3;3], a)(:,2,3), accumarray ([1;3;1;3;3], a(:,2,3))) -%!assert (accumdim ([2;3;2;2;2], a, 2, 4)(4,:,2), accumarray ([2;3;2;2;2], a(4,:,2), [1,4])) -%!assert (accumdim ([2;3;2;1;2], a, 3, 3, @min)(1,5,:), accumarray ([2;3;2;1;2], a(1,5,:), [1,1,3], @min)) -%!assert (accumdim ([1;3;2;2;1], a, 2, 3, @median)(4,:,5), accumarray ([1;3;2;2;1], a(4,:,5), [1,3], @median)) +%!assert (accumdim ([2;3;2;2;2], a, 2, 4)(4,:,2), +%! accumarray ([2;3;2;2;2], a(4,:,2), [1,4])) +%!assert (accumdim ([2;3;2;1;2], a, 3, 3, @min)(1,5,:), +%! accumarray ([2;3;2;1;2], a(1,5,:), [1,1,3], @min)) +%!assert (accumdim ([1;3;2;2;1], a, 2, 3, @median)(4,:,5), +%! accumarray ([1;3;2;2;1], a(4,:,5), [1,3], @median)) ## Test fillval %!assert (accumdim ([1;3;1;3;3], a)(2,:,:), zeros (1,5,5))
--- a/scripts/general/bitcmp.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/bitcmp.m Tue Nov 23 13:28:34 2021 -0800 @@ -93,35 +93,40 @@ %! Amax = 24; %! Bmax = flintmax ("single") - 1; %! A = bitshift (Bmax,-2); -%! assert (bitcmp (A,Amax),bitor (bitshift (single (1),Amax-1), bitshift (single (1),Amax-2))); +%! assert (bitcmp (A,Amax), +%! bitor (bitshift (single (1),Amax-1), bitshift (single (1),Amax-2))); %! assert (bitcmp (A,Amax-1), bitshift (single (1),Amax-2)); %! assert (bitcmp (A,Amax-2), single (0)); %!test %! Amax = 8; %! Bmax = intmax ("uint8"); %! A = bitshift (Bmax,-2); -%! assert (bitcmp (A,Amax),bitor (bitshift (uint8 (1),Amax-1), bitshift (uint8 (1),Amax-2))); +%! assert (bitcmp (A,Amax), +%! bitor (bitshift (uint8 (1),Amax-1), bitshift (uint8 (1),Amax-2))); %! assert (bitcmp (A,Amax-1), bitshift (uint8 (1),Amax-2)); %! assert (bitcmp (A,Amax-2), uint8 (0)); %!test %! Amax = 16; %! Bmax = intmax ("uint16"); %! A = bitshift (Bmax,-2); -%! assert (bitcmp (A,Amax),bitor (bitshift (uint16 (1),Amax-1), bitshift (uint16 (1),Amax-2))); +%! assert (bitcmp (A,Amax), +%! bitor (bitshift (uint16 (1),Amax-1), bitshift (uint16 (1),Amax-2))); %! assert (bitcmp (A,Amax-1), bitshift (uint16 (1),Amax-2)); %! assert (bitcmp (A,Amax-2), uint16 (0)); %!test %! Amax = 32; %! Bmax = intmax ("uint32"); %! A = bitshift (Bmax,-2); -%! assert (bitcmp (A,Amax),bitor (bitshift (uint32 (1),Amax-1), bitshift (uint32 (1),Amax-2))); +%! assert (bitcmp (A,Amax), +%! bitor (bitshift (uint32 (1),Amax-1), bitshift (uint32 (1),Amax-2))); %! assert (bitcmp (A,Amax-1), bitshift (uint32 (1),Amax-2)); %! assert (bitcmp (A,Amax-2), uint32 (0)); %!test %! Amax = 64; %! Bmax = intmax ("uint64"); %! A = bitshift (Bmax,-2); -%! assert (bitcmp (A,Amax),bitor (bitshift (uint64 (1),Amax-1), bitshift (uint64 (1),Amax-2))); +%! assert (bitcmp (A,Amax), +%! bitor (bitshift (uint64 (1),Amax-1), bitshift (uint64 (1),Amax-2))); %! assert (bitcmp (A,Amax-1), bitshift (uint64 (1),Amax-2)); %! assert (bitcmp (A,Amax-2), uint64 (0));
--- a/scripts/general/blkdiag.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/blkdiag.m Tue Nov 23 13:28:34 2021 -0800 @@ -71,15 +71,19 @@ ## regular tests %!assert (blkdiag (1,ones (2),1), [1,0,0,0;0,1,1,0;0,1,1,0;0,0,0,1]) %!assert (blkdiag ([1,2],[3,4],[5,6]), [1,2,0,0,0,0;0,0,3,4,0,0;0,0,0,0,5,6]) -%!assert (blkdiag ([1,2],[3;4],[5,6]), [1,2,0,0,0;0,0,3,0,0;0,0,4,0,0;0,0,0,5,6]) +%!assert (blkdiag ([1,2],[3;4],[5,6]), +%! [1,2,0,0,0;0,0,3,0,0;0,0,4,0,0;0,0,0,5,6]) %!assert (blkdiag ([1,2;3,4],[5,6,7]), [1,2,0,0,0;3,4,0,0,0;0,0,5,6,7]) ## tests involving empty matrices %!assert (blkdiag ([],[],[]), []) %!assert (blkdiag ([],[1,2;3,4],[],5,[]), [1,2,0;3,4,0;0,0,5]) -%!assert (blkdiag (zeros (1,0,1),[1,2,3],1,0,5,zeros (0,1,1)), [0,0,0,0,0,0,0;1,2,3,0,0,0,0;0,0,0,1,0,0,0;0,0,0,0,0,0,0;0,0,0,0,0,5,0]) +%!assert (blkdiag (zeros (1,0,1),[1,2,3],1,0,5,zeros (0,1,1)), +%! [0,0,0,0,0,0,0;1,2,3,0,0,0,0;0,0,0,1,0,0,0;0,0,0,0,0,0,0;0,0,0,0,0,5,0]) ## tests involving sparse matrices -%!assert (blkdiag (sparse ([1,2;3,4]),[5,6;7,8]), sparse ([1,2,0,0;3,4,0,0;0,0,5,6;0,0,7,8])) -%!assert (blkdiag (sparse ([1,2;3,4]),[5,6]), sparse ([1,2,0,0;3,4,0,0;0,0,5,6])) +%!assert (blkdiag (sparse ([1,2;3,4]),[5,6;7,8]), +%! sparse ([1,2,0,0;3,4,0,0;0,0,5,6;0,0,7,8])) +%!assert (blkdiag (sparse ([1,2;3,4]),[5,6]), +%! sparse ([1,2,0,0;3,4,0,0;0,0,5,6])) ## sanity checks %!test %! A = rand (round (rand (1, 2) * 10));
--- a/scripts/general/cplxpair.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/cplxpair.m Tue Nov 23 13:28:34 2021 -0800 @@ -164,10 +164,11 @@ %!assert (cplxpair ([z(randperm (7)).'; z(randperm (7)).'],[],2), [z.';z.']) %! y = [ -1-1i; -1+1i;-3; -2; 1; 2; 3]; %!assert (cplxpair ([z(randperm (7)), y(randperm (7))]), [z,y]) -%!assert (cplxpair ([z(randperm (7)), y(randperm (7)),z(randperm (7))]), [z,y,z]) +%!assert (cplxpair ([z(randperm (7)), y(randperm (7)),z(randperm (7))]), +%! [z,y,z]) ## Test tolerance -%!assert (cplxpair ([2000 * (1+eps) + 4j; 2000 * (1-eps) - 4j]), ... +%!assert (cplxpair ([2000 * (1+eps) + 4j; 2000 * (1-eps) - 4j]), %! [(2000 - 4j); (2000 + 4j)], 100*eps(200)) %!error <could not pair> %! cplxpair ([2000 * (1+eps) + 4j; 2000 * (1-eps) - 4j], 0);
--- a/scripts/general/dblquad.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/dblquad.m Tue Nov 23 13:28:34 2021 -0800 @@ -87,6 +87,9 @@ ## Nasty integrand to show quadcc off %!assert (dblquad (@(x,y) 1 ./ (x+y), 0, 1, 0, 1), 2*log (2), 1e-6) -%!assert (dblquad (@(x,y) exp (-x.^2 - y.^2) , -1, 1, -1, 1, 1e-6, @quadgk), pi * erf (1).^2, 1e-6) -%!assert (dblquad (@(x,y) exp (-x.^2 - y.^2) , -1, 1, -1, 1, 1e-6, @quadl), pi * erf (1).^2, 1e-6) -%!assert (dblquad (@(x,y) exp (-x.^2 - y.^2) , -1, 1, -1, 1, 1e-6, @quadv), pi * erf (1).^2, 1e-6) +%!assert (dblquad (@(x,y) exp (-x.^2 - y.^2) , -1, 1, -1, 1, 1e-6, @quadgk), +%! pi * erf (1).^2, 1e-6) +%!assert (dblquad (@(x,y) exp (-x.^2 - y.^2) , -1, 1, -1, 1, 1e-6, @quadl), +%! pi * erf (1).^2, 1e-6) +%!assert (dblquad (@(x,y) exp (-x.^2 - y.^2) , -1, 1, -1, 1, 1e-6, @quadv), +%! pi * erf (1).^2, 1e-6)
--- a/scripts/general/integral2.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/integral2.m Tue Nov 23 13:28:34 2021 -0800 @@ -271,7 +271,8 @@ %! f = @(x, y) 9 * x.^2 + 15 * y.^2; %!assert (integral2 (f, 0, 5, -5, 0, "AbsTol", 1e-9), 5000, 1e-9) %!assert (integral2 (f, 0, 5, -5, 0, "RelTol", 1e-5), 5000, -1e-5) -%!assert (integral2 (f, 0, 5, -5, 0, "RelTol", 1e-6, "AbsTol", 1e-9), 5000, 1e-9) +%!assert (integral2 (f, 0, 5, -5, 0, "RelTol", 1e-6, "AbsTol", 1e-9), +%! 5000, 1e-9) ## tests from dblquad %!test
--- a/scripts/general/integral3.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/integral3.m Tue Nov 23 13:28:34 2021 -0800 @@ -310,7 +310,8 @@ %! f = @(x,y,z) 1 ./ (x + y + z); %! ymax = @(x) 1 - x; %! zmax = @(x, y) 1 - x - y; -%! assert (integral3 (f, 0, 1, 0, ymax, 0, zmax, "method", "tiled"), 0.25, 1e-6); +%! assert (integral3 (f, 0, 1, 0, ymax, 0, zmax, "method", "tiled"), +%! 0.25, 1e-6); ## Test input validation %!error integral3
--- a/scripts/general/interp2.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/interp2.m Tue Nov 23 13:28:34 2021 -0800 @@ -541,10 +541,14 @@ %!assert (interp2 (z, "pchip"), zout, tol) %!assert (interp2 (z, "cubic"), zout, 10 * tol) %!assert (interp2 (z, "spline"), zout, tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "linear"), repmat ([5, 7, 3], [3, 1]), tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "pchip"), repmat ([5, 7, 3], [3, 1]), tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "cubic"), repmat ([5, 7, 3], [3, 1]), 10 * tol) -%!assert (interp2 (z, [2 3 1], [2 2 2]', "spline"), repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "linear"), +%! repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "pchip"), +%! repmat ([5, 7, 3], [3, 1]), tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "cubic"), +%! repmat ([5, 7, 3], [3, 1]), 10 * tol) +%!assert (interp2 (z, [2 3 1], [2 2 2]', "spline"), +%! repmat ([5, 7, 3], [3, 1]), tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "linear"), [5 7 3], tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "pchip"), [5 7 3], tol) %!assert (interp2 (z, [2 3 1], [2 2 2], "cubic"), [5 7 3], 10 * tol)
--- a/scripts/general/interpn.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/interpn.m Tue Nov 23 13:28:34 2021 -0800 @@ -304,7 +304,8 @@ %! [x,y,z] = ndgrid (0:2); %! f = x + y + z; %! assert (interpn (x,y,z,f,[.5 1.5],[.5 1.5],[.5 1.5]), [1.5, 4.5]); -%! assert (interpn (x,y,z,f,[.51 1.51],[.51 1.51],[.51 1.51],"nearest"), [3, 6]); +%! assert (interpn (x,y,z,f,[.51 1.51],[.51 1.51],[.51 1.51],"nearest"), +%! [3, 6]); %! assert (interpn (x,y,z,f,[.5 1.5],[.5 1.5],[.5 1.5],"spline"), [1.5, 4.5]); %! assert (interpn (x,y,z,f,x,y,z), f); %! assert (interpn (x,y,z,f,x,y,z,"nearest"), f);
--- a/scripts/general/logspace.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/general/logspace.m Tue Nov 23 13:28:34 2021 -0800 @@ -92,28 +92,39 @@ endfunction - %!test %! x1 = logspace (1, 2); %! x2 = logspace (1, 2, 10.1); %! x3 = logspace (1, -2, 10); %! x4 = logspace (1, pi, 10); -%! assert (size (x1) == [1, 50] && abs (x1(1) - 10) < eps && abs (x1(50) - 100) < eps); -%! assert (size (x2) == [1, 10] && abs (x2(1) - 10) < eps && abs (x2(10) - 100) < eps); -%! assert (size (x3) == [1, 10] && abs (x3(1) - 10) < eps && abs (x3(10) - 0.01) < eps); -%! assert (size (x4) == [1, 10] && abs (x4(1) - 10) < eps && abs (x4(10) - pi) < sqrt (eps)); +%! assert (size (x1) == [1, 50]); +%! assert (abs (x1(1) - 10) < eps); +%! assert (abs (x1(50) - 100) < eps); +%! assert (size (x2) == [1, 10]); +%! assert (abs (x2(1) - 10) < eps); +%! assert (abs (x2(10) - 100) < eps); +%! assert (size (x3) == [1, 10]); +%! assert (abs (x3(1) - 10) < eps); +%! assert (abs (x3(10) - 0.01) < eps); +%! assert (size (x4) == [1, 10]); +%! assert (abs (x4(1) - 10) < eps); +%! assert (abs (x4(10) - pi) < sqrt (eps)); ## Edge cases %!assert (logspace (Inf, Inf, 3), [Inf, Inf, Inf]) %!assert (logspace (-Inf, Inf, 3), [0, 1, Inf]) %!testif ; ! ismac () -%! assert (logspace (Inf + 1i, Inf + 1i, 3), repmat (complex (-Inf,Inf), [1, 3])) +%! assert (logspace (Inf + 1i, Inf + 1i, 3), +%! repmat (complex (-Inf,Inf), [1, 3])) %!testif ; ismac () <55538> -%! assert (logspace (Inf + 1i, Inf + 1i, 3), repmat (complex (-Inf,Inf), [1, 3])) +%! assert (logspace (Inf + 1i, Inf + 1i, 3), +%! repmat (complex (-Inf,Inf), [1, 3])) %!testif ; ! ismac () -%! assert (logspace (-Inf + 1i, Inf + 1i, 3), [0, NaN + NaN * 1i, complex(-Inf, Inf)]) +%! assert (logspace (-Inf + 1i, Inf + 1i, 3), +%! [0, NaN + NaN * 1i, complex(-Inf, Inf)]) %!testif ; ismac () <55538> -%! assert (logspace (-Inf + 1i, Inf + 1i, 3), [0, NaN + NaN * 1i, complex(-Inf, Inf)]) +%! assert (logspace (-Inf + 1i, Inf + 1i, 3), +%! [0, NaN + NaN * 1i, complex(-Inf, Inf)]) %!assert (logspace (0, Inf, 3), [1, Inf, Inf]) %!assert (logspace (0, -Inf, 3), [1, 0, 0]) %!assert (logspace (Inf, -Inf, 3), [Inf, 1, 0])
--- a/scripts/geometry/delaunayn.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/geometry/delaunayn.m Tue Nov 23 13:28:34 2021 -0800 @@ -130,7 +130,8 @@ ## Test 3-D input %!testif HAVE_QHULL %! x = [-1, -1, 1, 0, -1]; y = [-1, 1, 1, 0, -1]; z = [0, 0, 0, 1, 1]; -%! assert (sortrows (sort (delaunayn ([x(:) y(:) z(:)]), 2)), [1,2,3,4;1,2,4,5]); +%! assert (sortrows (sort (delaunayn ([x(:) y(:) z(:)]), 2)), +%! [1,2,3,4;1,2,4,5]); ## FIXME: Need tests for delaunayn
--- a/scripts/geometry/griddata3.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/geometry/griddata3.m Tue Nov 23 13:28:34 2021 -0800 @@ -90,7 +90,8 @@ error ("griddata3: XI, YI, and ZI must be vectors or matrices of the same size"); endif - vi = griddatan ([x(:), y(:), z(:)], v(:), [xi(:), yi(:), zi(:)], method, varargin{:}); + vi = griddatan ([x(:), y(:), z(:)], v(:), [xi(:), yi(:), zi(:)], method, ... + varargin{:}); vi = reshape (vi, size (xi)); endfunction
--- a/scripts/image/imread.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/image/imread.m Tue Nov 23 13:28:34 2021 -0800 @@ -192,7 +192,8 @@ %! extra_inputs = {"some", 89, i, {6 7 8}}; %! assert (imread (fname, extra_inputs{:}), {fname, extra_inputs{:}}); %! assert (imread (fname, "jpg", extra_inputs{:}), {fname, extra_inputs{:}}); -%! assert (imread (fname(1:end-4), "jpg", extra_inputs{:}), {fname, extra_inputs{:}}); +%! assert (imread (fname(1:end-4), "jpg", extra_inputs{:}), +%! {fname, extra_inputs{:}}); %! unwind_protect_cleanup %! fclose (fid); %! unlink (fname);
--- a/scripts/legacy/genvarname.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/legacy/genvarname.m Tue Nov 23 13:28:34 2021 -0800 @@ -208,7 +208,8 @@ %!assert (genvarname ({"a";"b"}), {"a";"b"}) %!assert (genvarname ({"a" "a"}), {"a" "a1"}) %!assert (genvarname ({"a" "b";"c" "d"}), {"a" "b";"c" "d"}) -%!assert (genvarname ({"a" "a" "a";"a" "a" "a"}), {"a" "a2" "a4";"a1" "a3" "a5"}) +%!assert (genvarname ({"a" "a" "a";"a" "a" "a"}), +%! {"a" "a2" "a4";"a1" "a3" "a5"}) ## more than one repetition %!assert (genvarname ({"a" "a" "a"}), {"a" "a1" "a2"}) %!assert (genvarname ({"a" "a" "a"}, {"a" "a1" "a2"}), {"a3" "a4" "a5"})
--- a/scripts/legacy/strread.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/legacy/strread.m Tue Nov 23 13:28:34 2021 -0800 @@ -1129,7 +1129,8 @@ %!error <no valid format conversion specifiers> strread ("1.0", "%z") ## Test for false positives in check for non-supported format specifiers -%!assert (strread ("Total: 32.5 % (of cm values)","Total: %f % (of cm values)"), 32.5, 1e-5) +%!assert (strread ("Total: 32.5 % (of cm values)","Total: %f % (of cm values)"), +%! 32.5, 1e-5) ## Test various forms of string format specifiers %!test <*45712>
--- a/scripts/miscellaneous/nthargout.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/miscellaneous/nthargout.m Tue Nov 23 13:28:34 2021 -0800 @@ -117,5 +117,6 @@ %!shared m %! m = magic (5); -%!assert (nthargout ([1,2], @ind2sub, size (m), nthargout (2, @max, m(:))), {5,3}) +%!assert (nthargout ([1,2], @ind2sub, size (m), nthargout (2, @max, m(:))), +%! {5,3}) %!assert (nthargout (3, @find, m(m>20)), [23, 24, 25, 21, 22]')
--- a/scripts/miscellaneous/parseparams.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/miscellaneous/parseparams.m Tue Nov 23 13:28:34 2021 -0800 @@ -130,7 +130,7 @@ %! assert (isempty (reg)); %! assert (prop1, 5); %!test <*58533> -%! [foo, bar1, bar2] = parseparams({ 0, "model", 1, "N", 2},"model", 4, "N", 5, "d", 6); +%! [foo, bar1, bar2] = parseparams ({ 0, "model", 1, "N", 2},"model", 4, "N", 5, "d", 6); %! assert (foo, {0}); %! assert (bar1, 1); %! assert (bar2, 2);
--- a/scripts/optimization/lsqnonneg.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/optimization/lsqnonneg.m Tue Nov 23 13:28:34 2021 -0800 @@ -81,9 +81,7 @@ ## This is implemented from Lawson and Hanson's 1973 algorithm on page 161 of ## Solving Least Squares Problems. -function [x, resnorm, residual, exitflag, output, lambda] = lsqnonneg (c, d, - x0 = [], - options = struct ()) +function [x, resnorm, residual, exitflag, output, lambda] = lsqnonneg (c, d, x0 = [], options = struct ()) ## Special case: called to find default optimization options if (nargin == 1 && ischar (c) && strcmp (c, "defaults"))
--- a/scripts/optimization/qp.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/optimization/qp.m Tue Nov 23 13:28:34 2021 -0800 @@ -395,8 +395,8 @@ ctype = repmat ("L", n_in, 1); [P, FMIN, status] = glpk (ctmp, Atmp, btmp, lb, ub, ctype); ## FIXME: Test based only on rtol occasionally fails (Bug #38353). - ## This seems to be a problem in glpk in which return value XOPT(1) is the - ## same as FMIN. Workaround this by explicit test + ## This seems to be a problem in glpk in which return value XOPT(1) + ## is the same as FMIN. Workaround this by explicit test if (status != 0) info = 6; # The problem is infeasible else
--- a/scripts/optimization/sqp.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/optimization/sqp.m Tue Nov 23 13:28:34 2021 -0800 @@ -573,7 +573,7 @@ function [x_new, alpha, obj, globals] = ... - linesearch_L1 (x, p, obj_fun, obj_grd, ce_fun, ci_fun, lambda, obj, c, globals) + linesearch_L1 (x, p, obj_fun, obj_grd, ce_fun, ci_fun, lambda, obj, c, globals) ## Choose parameters ##
--- a/scripts/plot/appearance/material.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/plot/appearance/material.m Tue Nov 23 13:28:34 2021 -0800 @@ -241,16 +241,26 @@ %! assert (get (hp, "specularcolorreflectance"), 1.0); %! assert (get (hs, "specularcolorreflectance"), 1.0); %! material default -%! assert (get (hp, "ambientstrength"), get (0, "defaultpatchambientstrength")); -%! assert (get (hs, "ambientstrength"), get (0, "defaultsurfaceambientstrength")); -%! assert (get (hp, "diffusestrength"), get (0, "defaultpatchdiffusestrength")); -%! assert (get (hs, "diffusestrength"), get (0, "defaultsurfacediffusestrength")); -%! assert (get (hp, "specularstrength"), get (0, "defaultpatchspecularstrength")); -%! assert (get (hs, "specularstrength"), get (0, "defaultsurfacespecularstrength")); -%! assert (get (hp, "specularexponent"), get (0, "defaultpatchspecularexponent")); -%! assert (get (hs, "specularexponent"), get (0, "defaultsurfacespecularexponent")); -%! assert (get (hp, "specularcolorreflectance"), get (0, "defaultpatchspecularcolorreflectance")); -%! assert (get (hs, "specularcolorreflectance"), get (0, "defaultsurfacespecularcolorreflectance")); +%! assert (get (hp, "ambientstrength"), +%! get (0, "defaultpatchambientstrength")); +%! assert (get (hs, "ambientstrength"), +%! get (0, "defaultsurfaceambientstrength")); +%! assert (get (hp, "diffusestrength"), +%! get (0, "defaultpatchdiffusestrength")); +%! assert (get (hs, "diffusestrength"), +%! get (0, "defaultsurfacediffusestrength")); +%! assert (get (hp, "specularstrength"), +%! get (0, "defaultpatchspecularstrength")); +%! assert (get (hs, "specularstrength"), +%! get (0, "defaultsurfacespecularstrength")); +%! assert (get (hp, "specularexponent"), +%! get (0, "defaultpatchspecularexponent")); +%! assert (get (hs, "specularexponent"), +%! get (0, "defaultsurfacespecularexponent")); +%! assert (get (hp, "specularcolorreflectance"), +%! get (0, "defaultpatchspecularcolorreflectance")); +%! assert (get (hs, "specularcolorreflectance"), +%! get (0, "defaultsurfacespecularcolorreflectance")); %! material ([0.5 0.6 0.7 20 0.8]) %! assert (get (hp, "ambientstrength"), 0.5); %! assert (get (hs, "ambientstrength"), 0.5);
--- a/scripts/plot/appearance/private/__gnuplot_legend__.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/plot/appearance/private/__gnuplot_legend__.m Tue Nov 23 13:28:34 2021 -0800 @@ -1366,7 +1366,8 @@ if (! strcmp (marker, "none")) hl = __go_line__ (hlegend, "xdata", xpos2, "ydata", ypos2, ... "color", get (h, "color"), ... - "marker", marker, "markeredgecolor", get (h, "markeredgecolor"), ... + "marker", marker, ... + "markeredgecolor", get (h, "markeredgecolor"), ... "markerfacecolor", get (h, "markerfacecolor"), ... "markersize", min (get (h, "markersize"), 10), ... "linestyle", "none", ...
--- a/scripts/plot/draw/plot.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/plot/draw/plot.m Tue Nov 23 13:28:34 2021 -0800 @@ -214,7 +214,8 @@ ## or PNG, use the @code{print} command. ## ## @seealso{axis, box, grid, hold, legend, title, xlabel, ylabel, xlim, ylim, -## ezplot, errorbar, fplot, line, plot3, polar, loglog, semilogx, semilogy, subplot} +## ezplot, errorbar, fplot, line, plot3, polar, loglog, semilogx, semilogy, +## subplot} ## @end deftypefn function h = plot (varargin)
--- a/scripts/plot/util/__gnuplot_drawnow__.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/plot/util/__gnuplot_drawnow__.m Tue Nov 23 13:28:34 2021 -0800 @@ -151,7 +151,8 @@ if (output_to_screen (term) && ! strcmp (term, "dumb")) fig.numbertitle = get (h, "numbertitle"); fig.name = strrep (get (h, "name"), '"', '\"'); - if (! isempty (get (h, "number")) && strcmp (get (h, "numbertitle"), "on")) + if (! isempty (get (h, "number")) + && strcmp (get (h, "numbertitle"), "on")) title_str = sprintf ("Figure %d", h); if (! isempty (fig.name)) title_str = sprintf ("%s: %s", title_str, fig.name);
--- a/scripts/polynomial/polygcd.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/polynomial/polygcd.m Tue Nov 23 13:28:34 2021 -0800 @@ -101,7 +101,8 @@ %! assert (poly3, poly2, sqrt (eps)); %!assert (polygcd (poly (1:8), poly (3:12)), poly (3:8), sqrt (eps)) -%!assert (deconv (poly (1:8), polygcd (poly (1:8), poly (3:12))), poly (1:2), sqrt (eps)) +%!assert (deconv (poly (1:8), polygcd (poly (1:8), poly (3:12))), +%! poly (1:2), sqrt (eps)) %!test %! for ii=1:100
--- a/scripts/polynomial/polyvalm.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/polynomial/polyvalm.m Tue Nov 23 13:28:34 2021 -0800 @@ -64,6 +64,7 @@ %!assert (! any (polyvalm ([], [1, 2; 3, 4]))(:)) -%!assert (polyvalm ([1, 2, 3, 4], [3, -4, 1; -2, 0, 2; -1, 4, -3]), [117, -124, 11; -70, 36, 38; -43, 92, -45]) +%!assert (polyvalm ([1, 2, 3, 4], [3, -4, 1; -2, 0, 2; -1, 4, -3]), +%! [117, -124, 11; -70, 36, 38; -43, 92, -45]) %!error <must be a square matrix> polyvalm ([1, 1, 1], [1, 2; 3, 4; 5, 6])
--- a/scripts/set/setdiff.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/set/setdiff.m Tue Nov 23 13:28:34 2021 -0800 @@ -130,7 +130,8 @@ %!assert (setdiff ([1, 1; 2, 2; 3, 3; 4, 4], [1, 1; 2, 2; 4, 4], "rows"), [3 3]) %!assert (setdiff ([1; 2; 3; 4], [1; 2; 4], "rows"), 3) %!assert (setdiff ([1, 2; 3, 4], [1, 2; 3, 6], "rows"), [3, 4]) -%!assert (setdiff ({"one","two";"three","four"}, {"one","two";"three","six"}), {"four"}) +%!assert (setdiff ({"one","two";"three","four"}, {"one","two";"three","six"}), +%! {"four"}) ## Test multi-dimensional input %!test
--- a/scripts/signal/fftfilt.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/signal/fftfilt.m Tue Nov 23 13:28:34 2021 -0800 @@ -143,7 +143,8 @@ %! assert (fftfilt (b.',x ), [1 1 0 0 0 0 0 0 0 0] ); %! assert (fftfilt (b.',x.'), [1 1 0 0 0 0 0 0 0 0].'); %! assert (fftfilt (b, [x.' x.']), [1 1 0 0 0 0 0 0 0 0].'*[1 1]); -%! assert (fftfilt (b, [x.'+2*eps x.']) == [1 1 0 0 0 0 0 0 0 0].'*[1 1], [false(10, 1) true(10, 1)]); +%! assert (fftfilt (b, [x.'+2*eps x.']) == [1 1 0 0 0 0 0 0 0 0].'*[1 1], +%! [false(10, 1) true(10, 1)]); %!testif HAVE_FFTW %! r = sqrt (1/2) * (1+i);
--- a/scripts/sparse/eigs.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/sparse/eigs.m Tue Nov 23 13:28:34 2021 -0800 @@ -659,7 +659,8 @@ %!testif HAVE_ARPACK, HAVE_UMFPACK %! assert (abs (eigs (A, k, 4.1)), abs (eigs (A, speye (n), k, 4.1)), 1e-11); %!testif HAVE_ARPACK, HAVE_UMFPACK -%! assert (sort (imag (eigs (A, k, 4.1))), sort (imag (eigs (A, speye (n), k, 4.1))), 1e-11); +%! assert (sort (imag (eigs (A, k, 4.1))), +%! sort (imag (eigs (A, speye (n), k, 4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 1; @@ -790,7 +791,8 @@ %!testif HAVE_ARPACK, HAVE_UMFPACK %! assert (abs (eigs (A, k, 4.1)), abs (eigs (A, speye (n), k, 4.1)), 1e-11); %!testif HAVE_ARPACK, HAVE_UMFPACK -%! assert (sort (imag (eigs (A, k, 4.1))), sort (imag (eigs (A, speye (n), k, 4.1))), 1e-11); +%! assert (sort (imag (eigs (A, k, 4.1))), +%! sort (imag (eigs (A, speye (n), k, 4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 0; @@ -1151,7 +1153,8 @@ %!testif HAVE_ARPACK %! assert (abs (eigs (A, k, 4.1)), abs (eigs (A, eye (n), k, 4.1)), 1e-11); %!testif HAVE_ARPACK -%! assert (sort (imag (eigs (A, k, 4.1))), sort (imag (eigs (A, eye (n), k, 4.1))), 1e-11); +%! assert (sort (imag (eigs (A, k, 4.1))), +%! sort (imag (eigs (A, eye (n), k, 4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 1; @@ -1281,7 +1284,8 @@ %!testif HAVE_ARPACK %! assert (abs (eigs (A, k, 4.1)), abs (eigs (A, eye (n), k, 4.1)), 1e-11); %!testif HAVE_ARPACK -%! assert (sort (imag (eigs (A, k, 4.1))), sort (imag (eigs (A, eye (n), k, 4.1))), 1e-11); +%! assert (sort (imag (eigs (A, k, 4.1))), +%! sort (imag (eigs (A, eye (n), k, 4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 0;
--- a/scripts/specfun/betainc.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/specfun/betainc.m Tue Nov 23 13:28:34 2021 -0800 @@ -234,7 +234,8 @@ %!assert (betainc (0.001, 20, 30), 2.750687665855991e-47, -3e-14) %!assert (betainc (0.0001, 20, 30), 2.819953178893307e-67, -7e-14) -%!assert <*54383> (betainc (0.99, 20, 30, "upper"), 1.5671643161872703e-47, -7e-14) +%!assert <*54383> (betainc (0.99, 20, 30, "upper"), +%! 1.5671643161872703e-47, -7e-14) %!assert (betainc (0.999, 20, 30, "upper"), 1.850806276141535e-77, -7e-14) %!assert (betainc (0.5, 200, 300), 0.9999964565197356, -1e-15) %!assert (betainc (0.5, 200, 300, "upper"), 3.54348026439253e-06, -3e-13)
--- a/scripts/specfun/cosint.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/specfun/cosint.m Tue Nov 23 13:28:34 2021 -0800 @@ -140,7 +140,7 @@ ssum = - xx .^ 2 / 4; # First term of the series expansion ## FIXME: This is way more precision than a double value can hold. gma = 0.57721566490153286060651209008; # Euler gamma constant - yy = gma + log (complex (xx)) + ssum; # log (complex (...) handles signed zero + yy = gma + log (complex (xx)) + ssum; # log (complex (Z)) handles signed zero flag_sum = true (nnz (todo), 1); it = 0; maxit = 300;
--- a/scripts/specfun/factor.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/specfun/factor.m Tue Nov 23 13:28:34 2021 -0800 @@ -51,8 +51,9 @@ error ("factor: Q must be a real non-negative integer"); endif - ## Special case if q is prime, because isprime() is now much faster than factor(). - ## This also absorbs the case of q < 4, where there are no primes less than sqrt(q). + ## Special case if q is prime, because isprime() is now much faster than + ## factor(). This also absorbs the case of q < 4, where there are no primes + ## less than sqrt(q). if (q < 4 || isprime (q)) pf = q; n = 1;
--- a/scripts/special-matrix/gallery.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/special-matrix/gallery.m Tue Nov 23 13:28:34 2021 -0800 @@ -2468,7 +2468,8 @@ error ("gallery: 1 to 6 arguments are required for toeppen matrix"); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be a numeric integer for toeppen matrix"); - elseif (any (! cellfun ("isnumeric", {a b c d e})) || any (cellfun ("numel", {a b c d e}) != 1)) + elseif (any (! cellfun ("isnumeric", {a b c d e})) + || any (cellfun ("numel", {a b c d e}) != 1)) error ("gallery: A, B, C, D and E must be numeric scalars for toeppen matrix"); endif
--- a/scripts/special-matrix/toeplitz.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/special-matrix/toeplitz.m Tue Nov 23 13:28:34 2021 -0800 @@ -130,7 +130,8 @@ %!assert (toeplitz (1), [1]) %!assert (toeplitz ([1, 2, 3], [1; -3; -5]), [1, -3, -5; 2, 1, -3; 3, 2, 1]) -%!assert (toeplitz ([1, 2, 3], [1; -3i; -5i]), [1, -3i, -5i; 2, 1, -3i; 3, 2, 1]) +%!assert (toeplitz ([1, 2, 3], [1; -3i; -5i]), +%! [1, -3i, -5i; 2, 1, -3i; 3, 2, 1]) ## Test input validation %!error <Invalid call> toeplitz ()
--- a/scripts/statistics/discrete_cdf.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/statistics/discrete_cdf.m Tue Nov 23 13:28:34 2021 -0800 @@ -69,9 +69,12 @@ %!assert (discrete_cdf ([x, NaN], v, p), [y, NaN], eps) ## Test class of input preserved -%!assert (discrete_cdf (single ([x, NaN]), v, p), single ([y, NaN]), 2*eps ("single")) -%!assert (discrete_cdf ([x, NaN], single (v), p), single ([y, NaN]), 2*eps ("single")) -%!assert (discrete_cdf ([x, NaN], v, single (p)), single ([y, NaN]), 2*eps ("single")) +%!assert (discrete_cdf (single ([x, NaN]), v, p), +%! single ([y, NaN]), 2*eps ("single")) +%!assert (discrete_cdf ([x, NaN], single (v), p), +%! single ([y, NaN]), 2*eps ("single")) +%!assert (discrete_cdf ([x, NaN], v, single (p)), +%! single ([y, NaN]), 2*eps ("single")) ## Test input validation %!error <Invalid call> discrete_cdf ()
--- a/scripts/statistics/discrete_inv.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/statistics/discrete_inv.m Tue Nov 23 13:28:34 2021 -0800 @@ -81,9 +81,12 @@ %!assert (discrete_inv ([x, NaN], v, p), [y, NaN], eps) ## Test class of input preserved -%!assert (discrete_inv (single ([x, NaN]), v, p), single ([y, NaN]), eps ("single")) -%!assert (discrete_inv ([x, NaN], single (v), p), single ([y, NaN]), eps ("single")) -%!assert (discrete_inv ([x, NaN], v, single (p)), single ([y, NaN]), eps ("single")) +%!assert (discrete_inv (single ([x, NaN]), v, p), +%! single ([y, NaN]), eps ("single")) +%!assert (discrete_inv ([x, NaN], single (v), p), +%! single ([y, NaN]), eps ("single")) +%!assert (discrete_inv ([x, NaN], v, single (p)), +%! single ([y, NaN]), eps ("single")) ## Test input validation %!error <Invalid call> discrete_inv ()
--- a/scripts/statistics/discrete_pdf.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/statistics/discrete_pdf.m Tue Nov 23 13:28:34 2021 -0800 @@ -70,9 +70,12 @@ %!assert (discrete_pdf ([x, NaN], v, p), [y, NaN], 5*eps) ## Test class of input preserved -%!assert (discrete_pdf (single ([x, NaN]), v, p), single ([y, NaN]), 5*eps ("single")) -%!assert (discrete_pdf ([x, NaN], single (v), p), single ([y, NaN]), 5*eps ("single")) -%!assert (discrete_pdf ([x, NaN], v, single (p)), single ([y, NaN]), 5*eps ("single")) +%!assert (discrete_pdf (single ([x, NaN]), v, p), +%! single ([y, NaN]), 5*eps ("single")) +%!assert (discrete_pdf ([x, NaN], single (v), p), +%! single ([y, NaN]), 5*eps ("single")) +%!assert (discrete_pdf ([x, NaN], v, single (p)), +%! single ([y, NaN]), 5*eps ("single")) ## Test input validation %!error <Invalid call> discrete_pdf ()
--- a/scripts/statistics/iqr.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/statistics/iqr.m Tue Nov 23 13:28:34 2021 -0800 @@ -91,10 +91,10 @@ endif else - if (isvector (dim) && isnumeric (dim) && all (dim > 0) && all (rem (dim, 1) == 0)) + if (isvector (dim) && isnumeric (dim) + && all (dim > 0) && all (rem (dim, 1) == 0)) - if (((num_vecdims = numel (dim)) > 1) ... - && all (diff (sort (dim)))) + if (((num_vecdims = numel (dim)) > 1) && all (diff (sort (dim)))) ## DIM must be 1D and non repeating. ## Detect trivial case of DIM being all dimensions (same as "all").
--- a/scripts/statistics/kurtosis.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/statistics/kurtosis.m Tue Nov 23 13:28:34 2021 -0800 @@ -147,9 +147,12 @@ %!assert (kurtosis (ones (3, 5)), NaN (1, 5)) %!assert (kurtosis (1, [], 3), NaN) -%!assert (kurtosis ([1:5 10; 1:5 10], 0, 2), 5.4377317925288901 * [1; 1], 8 * eps) -%!assert (kurtosis ([1:5 10; 1:5 10], 1, 2), 2.9786509002956195 * [1; 1], 8 * eps) -%!assert (kurtosis ([1:5 10; 1:5 10], [], 2), 2.9786509002956195 * [1; 1], 8 * eps) +%!assert (kurtosis ([1:5 10; 1:5 10], 0, 2), +%! 5.4377317925288901 * [1; 1], 8 * eps) +%!assert (kurtosis ([1:5 10; 1:5 10], 1, 2), +%! 2.9786509002956195 * [1; 1], 8 * eps) +%!assert (kurtosis ([1:5 10; 1:5 10], [], 2), +%! 2.9786509002956195 * [1; 1], 8 * eps) ## Test behavior on single input %!assert (kurtosis (single ([1:5 10])), single (2.9786513), eps ("single"))
--- a/scripts/statistics/quantile.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/statistics/quantile.m Tue Nov 23 13:28:34 2021 -0800 @@ -361,11 +361,14 @@ %! 0.933100, 0.931200, 0.963500, 0.779600, 0.846100]; %! tol = 0.00001; %! x(5,5) = NaN; -%! assert (quantile (x, p, 1), [0.27950, 0.79780, 0.32960, 0.55670, 0.44460], tol); +%! assert (quantile (x, p, 1), +%! [0.27950, 0.79780, 0.32960, 0.55670, 0.44460], tol); %! x(1,1) = NaN; -%! assert (quantile (x, p, 1), [0.35415, 0.79780, 0.32960, 0.55670, 0.44460], tol); +%! assert (quantile (x, p, 1), +%! [0.35415, 0.79780, 0.32960, 0.55670, 0.44460], tol); %! x(3,3) = NaN; -%! assert (quantile (x, p, 1), [0.35415, 0.79780, 0.42590, 0.55670, 0.44460], tol); +%! assert (quantile (x, p, 1), +%! [0.35415, 0.79780, 0.42590, 0.55670, 0.44460], tol); %!test %! sx = [2, 3, 4];
--- a/scripts/strings/bin2dec.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/strings/bin2dec.m Tue Nov 23 13:28:34 2021 -0800 @@ -68,7 +68,8 @@ %!assert (bin2dec ("0000"), 0) %!assert (bin2dec ("1110"), 14) -%!assert (bin2dec ("11111111111111111111111111111111111111111111111111111"), 2^53-1) +%!assert (bin2dec ("11111111111111111111111111111111111111111111111111111"), +%! 2^53-1) %!assert (bin2dec ({"1110", "1111"}), [14; 15]) %!assert (bin2dec ("1 0 1"), 5) %!assert (bin2dec (char ("1 0 1", " 1111")), [5; 15])
--- a/scripts/strings/isstrprop.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/strings/isstrprop.m Tue Nov 23 13:28:34 2021 -0800 @@ -134,7 +134,8 @@ %!assert (isstrprop ("Hello World", "wspace"), isspace ("Hello World")) %!assert (isstrprop ("Hello World", "graphic"), isgraph ("Hello World")) %!assert (isstrprop (char ("AbC", "123"), "upper"), logical ([1 0 1; 0 0 0])) -%!assert (isstrprop ({"AbC", "123"}, "lower"), {logical([0 1 0]), logical([0 0 0])}) +%!assert (isstrprop ({"AbC", "123"}, "lower"), +%! {logical([0 1 0]), logical([0 0 0])}) ## Test input validation %!error <Invalid call> isstrprop ()
--- a/scripts/strings/mat2str.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/strings/mat2str.m Tue Nov 23 13:28:34 2021 -0800 @@ -142,8 +142,10 @@ %!assert (mat2str (pi), "3.14159265358979") %!assert (mat2str (pi, 5), "3.1416") %!assert (mat2str (single (pi), 5, "class"), "single(3.1416)") -%!assert (mat2str ([-1/3 + i/7; 1/3 - i/7], [4 2]), "[-0.3333+0.14i;0.3333-0.14i]") -%!assert (mat2str ([-1/3 +i/7; 1/3 -i/7], [4 2]), "[-0.3333+0i 0+0.14i;0.3333+0i -0-0.14i]") +%!assert (mat2str ([-1/3 + i/7; 1/3 - i/7], [4 2]), +%! "[-0.3333+0.14i;0.3333-0.14i]") +%!assert (mat2str ([-1/3 +i/7; 1/3 -i/7], [4 2]), +%! "[-0.3333+0i 0+0.14i;0.3333+0i -0-0.14i]") %!assert (mat2str (int16 ([1 -1]), "class"), "int16([1 -1])") %!assert (mat2str (true), "true") %!assert (mat2str (false), "false")
--- a/scripts/strings/strchr.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/strings/strchr.m Tue Nov 23 13:28:34 2021 -0800 @@ -78,8 +78,10 @@ %!assert (strchr ("Octave is the best software", ""), zeros (1,0)) -%!assert (strchr ("Octave is the best software", "best"), [3, 6, 9, 11, 13, 15, 16, 17, 18, 20, 23, 27]) -%!assert (strchr ("Octave is the best software", "software"), [3, 4, 6, 9, 11, 13, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27]) +%!assert (strchr ("Octave is the best software", "best"), +%! [3, 6, 9, 11, 13, 15, 16, 17, 18, 20, 23, 27]) +%!assert (strchr ("Octave is the best software", "software"), +%! [3, 4, 6, 9, 11, 13, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27]) ## Test input validation %!error <Invalid call> strchr ()
--- a/scripts/strings/strsplit.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/strings/strsplit.m Tue Nov 23 13:28:34 2021 -0800 @@ -261,20 +261,29 @@ %!assert (strsplit ("road to hell", " "), {"road", "to", "hell"}) %!assert (strsplit ("road to^hell", {" ","^"}), {"road", "to", "hell"}) %!assert (strsplit ("road to--hell", {" ","-"}, true), {"road", "to", "hell"}) -%!assert (strsplit (["a,bc,,de"], ",", false, "delimitertype", "s"), {"a", "bc", "", "de"}) +%!assert (strsplit (["a,bc,,de"], ",", false, "delimitertype", "s"), +%! {"a", "bc", "", "de"}) %!assert (strsplit (["a,bc,,de"], ",", false), {"a", "bc", "", "de"}) %!assert (strsplit (["a,bc,de"], ",", true), {"a", "bc", "de"}) %!assert (strsplit (["a,bc,de"], {","," "}, true), {"a", "bc", "de"}) -%!assert (strsplit ("road to hell", " ", "delimitertype", "r"), {"road", "to", "hell"}) -%!assert (strsplit ("road to^hell", '\^| ', "delimitertype", "r"), {"road", "to", "hell"}) -%!assert (strsplit ("road to^hell", "[ ^]", "delimitertype", "r"), {"road", "to", "hell"}) -%!assert (strsplit ("road to--hell", "[ -]", false, "delimitertype", "r"), {"road", "", "", "to", "", "hell"}) +%!assert (strsplit ("road to hell", " ", "delimitertype", "r"), +%! {"road", "to", "hell"}) +%!assert (strsplit ("road to^hell", '\^| ', "delimitertype", "r"), +%! {"road", "to", "hell"}) +%!assert (strsplit ("road to^hell", "[ ^]", "delimitertype", "r"), +%! {"road", "to", "hell"}) +%!assert (strsplit ("road to--hell", "[ -]", false, "delimitertype", "r"), +%! {"road", "", "", "to", "", "hell"}) %!assert (strsplit (["a,bc,de"], ",", "delimitertype", "r"), {"a", "bc", "de"}) -%!assert (strsplit (["a,bc,,de"], ",", false, "delimitertype", "r"), {"a", "bc", "", "de"}) -%!assert (strsplit (["a,bc,de"], ",", true, "delimitertype", "r"), {"a", "bc", "de"}) -%!assert (strsplit (["a,bc,de"], "[, ]", true, "delimitertype", "r"), {"a", "bc", "de"}) -%!assert (strsplit ("hello \t world", true, "delimitertype", "r"), {"hello", "world"}) +%!assert (strsplit (["a,bc,,de"], ",", false, "delimitertype", "r"), +%! {"a", "bc", "", "de"}) +%!assert (strsplit (["a,bc,de"], ",", true, "delimitertype", "r"), +%! {"a", "bc", "de"}) +%!assert (strsplit (["a,bc,de"], "[, ]", true, "delimitertype", "r"), +%! {"a", "bc", "de"}) +%!assert (strsplit ("hello \t world", true, "delimitertype", "r"), +%! {"hello", "world"}) %!assert (strsplit ("foo\tbar", '\t', "delimitertype", "r"), {"foo", "bar"}) %!assert (strsplit ("foo\tbar", '\t', "delimitertype", "s"), {"foo", "bar"})
--- a/scripts/testfun/__have_feature__.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/testfun/__have_feature__.m Tue Nov 23 13:28:34 2021 -0800 @@ -50,7 +50,7 @@ %!assert (islogical (__have_feature__ ("MAGICK"))) %!assert (isscalar (__have_feature__ ("MAGICK"))) -%!assert (__have_feature__ ("MAGICK") == __have_feature__ ({"MAGICK", "MAGICK"})) +%!assert (__have_feature__ ("MAGICK"), __have_feature__ ({"MAGICK", "MAGICK"})) ## Test that an empty feature set returns true %!assert (__have_feature__ ({}))
--- a/scripts/time/datenum.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/time/datenum.m Tue Nov 23 13:28:34 2021 -0800 @@ -230,15 +230,19 @@ %!assert (datenum ([2008;2009],1,1), [datenum(2008,1,1);datenum(2009,1,1)]) %!assert (datenum (2008, [1;2], 1), [datenum(2008,1,1);datenum(2008,2,1)]) %!assert (datenum (2008, 1, [1;2]), [datenum(2008,1,1);datenum(2008,1,2)]) -%!assert (datenum ([2008;2009], [1;2], 1), [datenum(2008,1,1);datenum(2009,2,1)]) -%!assert (datenum ([2008;2009], 1, [1;2]), [datenum(2008,1,1);datenum(2009,1,2)]) +%!assert (datenum ([2008;2009], [1;2], 1), +%! [datenum(2008,1,1);datenum(2009,2,1)]) +%!assert (datenum ([2008;2009], 1, [1;2]), +%! [datenum(2008,1,1);datenum(2009,1,2)]) %!assert (datenum (2008, [1;2], [1;2]), [datenum(2008,1,1);datenum(2008,2,2)]) ## And the other orientation %!assert (datenum ([2008 2009], 1, 1), [datenum(2008,1,1) datenum(2009,1,1)]) %!assert (datenum (2008, [1 2], 1), [datenum(2008,1,1) datenum(2008,2,1)]) %!assert (datenum (2008, 1, [1 2]), [datenum(2008,1,1) datenum(2008,1,2)]) -%!assert (datenum ([2008 2009], [1 2], 1), [datenum(2008,1,1) datenum(2009,2,1)]) -%!assert (datenum ([2008 2009], 1, [1 2]), [datenum(2008,1,1) datenum(2009,1,2)]) +%!assert (datenum ([2008 2009], [1 2], 1), +%! [datenum(2008,1,1) datenum(2009,2,1)]) +%!assert (datenum ([2008 2009], 1, [1 2]), +%! [datenum(2008,1,1) datenum(2009,1,2)]) %!assert (datenum (2008, [1 2], [1 2]), [datenum(2008,1,1) datenum(2008,2,2)]) ## Test string and cellstr inputs
--- a/scripts/time/datevec.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/time/datevec.m Tue Nov 23 13:28:34 2021 -0800 @@ -412,8 +412,10 @@ %!test %! t = linspace (-2e5, 2e5, 10993); %! assert (all (abs (datenum (datevec (t)) - t') < 1e-5)); -%!assert (double (datevec (int64 (datenum ([2014 6 1])))), datevec (datenum ([2014 6 1]))) -%!assert (double (datevec (int64 (datenum ([2014 6 18])))), datevec (datenum ([2014 6 18]))) +%!assert (double (datevec (int64 (datenum ([2014 6 1])))), +%! datevec (datenum ([2014 6 1]))) +%!assert (double (datevec (int64 (datenum ([2014 6 18])))), +%! datevec (datenum ([2014 6 18]))) ## Test parsing of date strings that fall within daylight saving transition %!testif ; isunix () <*36954>
--- a/scripts/time/eomday.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/time/eomday.m Tue Nov 23 13:28:34 2021 -0800 @@ -57,7 +57,8 @@ %!assert (eomday (2001,1:12), [31,28,31,30,31,30,31,31,30,31,30,31]) %!assert (eomday (1:3,1:3), [31,28,31]) %!assert (eomday (1:2000,2)', datevec (datenum (1:2000,3,0))(:,3)) -%!assert ([1900:1999](find(eomday(1900:1999,2*ones(1,100))==29)), [1904,1908,1912,1916,1920,1924,1928,1932,1936,1940,1944,1948,1952,1956,1960,1964,1968,1972,1976,1980,1984,1988,1992,1996]) +%!assert ([1900:1999](find (eomday (1900:1999,2*ones(1,100))==29)), +%! [1904,1908,1912,1916,1920,1924,1928,1932,1936,1940,1944,1948,1952,1956,1960,1964,1968,1972,1976,1980,1984,1988,1992,1996]) %!assert (eomday ([2004;2005], [2;2]), [29;28]) ## Test input validation
--- a/scripts/web/weboptions.m Tue Nov 23 11:26:38 2021 -0800 +++ b/scripts/web/weboptions.m Tue Nov 23 13:28:34 2021 -0800 @@ -71,8 +71,8 @@ ## @samp{Password} --- User authentication password for HTTP connection. ## ## Default is NULL@. It must be a string or character vector. - ## Programming Note: If you display a @code{weboption} object with the Password - ## property set, the value is displayed as a string containing + ## Programming Note: If you display a @code{weboption} object with the + ## Password property set, the value is displayed as a string containing ## @qcode{'*'}. However, the object stores the value of the Password ## property as plain text. ## @@ -98,8 +98,8 @@ ## @example ## @group ## weboptions ("HeaderFields", @{"Content-Length" "78";"Content-Type" "application/json"@}) - ## Creates a weboptions object that contains two header fields: Content-Length - ## with value 78 and Content-Type with value application/json. + ## Creates a weboptions object that contains two header fields: + ## Content-Length with value 78 and Content-Type with value application/json. ## @end group ## @end example ## @@ -127,8 +127,8 @@ ## The following methods are available: ## @samp{get}, @samp{put}, @samp{post}, @samp{delete}, @samp{patch} ## - ## @code{webread} uses the HTTP GET method. @code{webwrite} uses the HTTP POST - ## method as default. + ## @code{webread} uses the HTTP GET method. @code{webwrite} uses the HTTP + ## POST method as default. ## ## @item ## @samp{ArrayFormat} -- Not yet implemented. Only for @sc{matlab}