Mercurial > octave
diff scripts/special-matrix/gallery.m @ 28891:de5f2f9a64ff
maint: Use same coding style when checking for a minimum of 1 input.
* disp.m, __get_properties__.m, disp.m, isplaying.m, pause.m, resume.m,
stop.m, __get_properties__.m, disp.m, isrecording.m, pause.m, resume.m, stop.m,
mu2lin.m, acosd.m, acot.m, acotd.m, acoth.m, acsc.m, acscd.m, acsch.m, asec.m,
asecd.m, asech.m, asind.m, atand.m, cosd.m, cot.m, cotd.m, coth.m, csc.m,
cscd.m, csch.m, sec.m, secd.m, sech.m, sind.m, tand.m, cell2mat.m, deg2rad.m,
fliplr.m, flipud.m, int2str.m, nextpow2.m, num2str.m, rad2deg.m, subsindex.m,
rotx.m, roty.m, rotz.m, voronoin.m, __unimplemented__.m, frame2im.m, hsv2rgb.m,
iscolormap.m, __imfinfo__.m, rgb2gray.m, rgb2hsv.m, fileread.m,
is_valid_file_id.m, usejava.m, argnames.m, char.m, formula.m, vectorize.m,
isdir.m, vectorize.m, condeig.m, duplication_matrix.m, expm.m, isdiag.m,
istril.m, istriu.m, normest.m, planerot.m, trace.m, vech.m, fieldnames.m,
fileparts.m, grabcode.m, isfile.m, isfolder.m, mustBeFinite.m, mustBeInteger.m,
mustBeNegative.m, mustBeNonNan.m, mustBeNonempty.m, mustBeNonnegative.m,
mustBeNonpositive.m, mustBeNonsparse.m, mustBeNonzero.m, mustBeNumeric.m,
mustBeNumericOrLogical.m, mustBePositive.m, mustBeReal.m, namedargs2cell.m,
open.m, run.m, swapbytes.m, pareto.m, allchild.m, colstyle.m, hdl2struct.m,
isaxes.m, isfigure.m, ishandle.m, compan.m, poly.m, polyreduce.m, ppjumps.m,
roots.m, unmkpp.m, profexplore.m, profile.m, bartlett.m, fftshift.m, hurst.m,
ifftshift.m, sinc.m, spencer.m, yulewalker.m, colperm.m, nonzeros.m,
spconvert.m, spones.m, sprandsym.m, cosint.m, expint.m, factor.m, factorial.m,
isprime.m, perms.m, primes.m, reallog.m, realsqrt.m, sinint.m, gallery.m,
hadamard.m, hilb.m, invhilb.m, magic.m, wilkinson.m, center.m, iqr.m, meansq.m,
median.m, runlength.m, bin2dec.m, blanks.m, deblank.m, hex2dec.m, isletter.m,
isstring.m, str2num.m, strtrim.m, asctime.m, ctime.m:
Replace "if (nargin != 1)" formulations with "if (nargin < 1)" to match
the rest of Octave.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 10 Oct 2020 16:32:20 -0700 |
parents | 0fa21907e54c |
children | 90fea9cc9caa |
line wrap: on
line diff
--- a/scripts/special-matrix/gallery.m Sat Oct 10 17:59:19 2020 +0200 +++ b/scripts/special-matrix/gallery.m Sat Oct 10 16:32:20 2020 -0700 @@ -1436,7 +1436,7 @@ ## of involutory and of idempotent matrices, Numer. Math. 5 (1963), ## pp. 234-237. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for invol matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for invol matrix."); @@ -1700,7 +1700,7 @@ ## J. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra, ## Birkhauser, Basel, and Academic Press, New York, 1977, p. 154. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for lehmer matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for lehmer matrix."); @@ -1731,7 +1731,7 @@ ## Mathematics, volume 260, Longman Scientific and Technical, Essex, ## UK, 1992, pp. 234-266. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for lesp matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for lesp matrix."); @@ -1751,7 +1751,7 @@ ## Reference: ## M. Lotkin, A set of test matrices, MTAC, 9 (1955), pp. 153-161. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for lotkin matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for lotkin matrix."); @@ -1779,7 +1779,7 @@ ## chemistry---II, Proc. Royal Soc. Edin., 63, A (1952), pp. 232-241. ## (For the eigenvalues of Givens' matrix.) - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for minij matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for minij matrix."); @@ -1826,7 +1826,7 @@ ## R.J. Plemmons, Regular splittings and the discrete Neumann ## problem, Numer. Math., 25 (1976), pp. 153-161. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for neumann matrix."); elseif (! isnumeric (n) || all (numel (n) != [1 2]) || fix (n) != n) error ("gallery: N must be a 1 or 2 element integer for neumann matrix."); @@ -1992,7 +1992,7 @@ ## E.E. Tyrtyshnikov, Cauchy-Toeplitz matrices and some applications, ## Linear Algebra and Appl., 149 (1991), pp. 1-18. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for parter matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for parter matrix."); @@ -2034,7 +2034,7 @@ ## Johns Hopkins University Press, Baltimore, Maryland, 1989 ## (Section 4.5.4). - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for poisson matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for poisson matrix."); @@ -2095,7 +2095,7 @@ ## W.B. Gragg, The QR algorithm for unitary Hessenberg matrices, ## J. Comp. Appl. Math., 16 (1986), pp. 1-8. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for randhess matrix."); elseif (! isnumeric (x) || ! isreal (x)) error ("gallery: N or X must be numeric real values for randhess matrix."); @@ -2305,7 +2305,7 @@ ## Spectral Properties of a Matrix of Redheffer, ## Linear Algebra and Appl., 162 (1992), pp. 673-683. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for redheff matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for redheff matrix."); @@ -2335,7 +2335,7 @@ ## F. Roesler, Riemann's hypothesis as an eigenvalue problem, ## Linear Algebra and Appl., 81 (1986), pp. 153-198. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for riemann matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for riemann matrix."); @@ -2361,7 +2361,7 @@ ## Algebra and Function Minimisation, second edition, Adam Hilger, ## Bristol, 1990 (Appendix 1). - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for ris matrix."); elseif (! isnumeric (n) || ! isscalar (n) || fix (n) != n) error ("gallery: N must be an integer for ris matrix."); @@ -2762,7 +2762,7 @@ ## J.H. Wilkinson, The Algebraic Eigenvalue Problem, Oxford University ## Press, 1965. - if (nargin != 1) + if (nargin < 1) error ("gallery: 1 argument is required for wilk matrix."); elseif (! isnumeric (n) || ! isscalar (n)) error ("gallery: N must be a numeric scalar for wilk matrix.");