Mercurial > octave-nkf
diff scripts/special-matrix/gallery.m @ 19630:0e1f5a750d00
maint: Periodic merge of gui-release to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Jan 2015 10:24:46 -0500 |
parents | cdfc8bc9ab62 446c46af4b42 |
children | 4197fc428c7d |
line wrap: on
line diff
--- a/scripts/special-matrix/gallery.m Tue Jan 20 09:55:41 2015 -0500 +++ b/scripts/special-matrix/gallery.m Tue Jan 20 10:24:46 2015 -0500 @@ -1296,7 +1296,7 @@ ## So take s = sign(x(1))*norm(x) (which avoids cancellation). ## v'v = (x(1)+s)^2 + x(2)^2 + ... + x(n)^2 ## = 2*norm(x)*(norm(x) + |x(1)|). - ## + ## ## References: ## G.H. Golub and C.F. Van Loan, Matrix Computations, second edition, ## Johns Hopkins University Press, Baltimore, Maryland, 1989. @@ -1345,7 +1345,7 @@ jidx = varargin{end-1}; svec = [varargin{1:end-1}]; varargin(end-1) = []; - else + else error (["gallery: J must be an integer in the range [0, 2^32-1] " ... "for integerdata matrix"]); endif @@ -1359,7 +1359,7 @@ ## Save and restore random state. Initialization done so that reproducible ## data is available from gallery depending on the jidx and size vector. - randstate = rand ("state"); + randstate = rand ("state"); unwind_protect rand ("state", svec); A = randi (varargin{:}); @@ -1463,7 +1463,7 @@ ## [A, d] = IPJFACT(N, K); ## ## Suggested by P. R. Graves-Morris. - ## + ## ## Reference: ## M.J.C. Gover, The explicit inverse of factorial Hankel matrices, ## Dept. of Mathematics, University of Bradford, 1993. @@ -1864,7 +1864,7 @@ jidx = varargin{end-1}; svec = [varargin{1:end-1}]; varargin(end-1) = []; - else + else error (["gallery: J must be an integer in the range [0, 2^32-1] " ... "for normaldata matrix"]); endif @@ -1878,7 +1878,7 @@ ## Save and restore random state. Initialization done so that reproducible ## data is available from gallery depending on the jidx and size vector. - randstate = randn ("state"); + randstate = randn ("state"); unwind_protect randn ("state", svec); A = randn (varargin{:}); @@ -1983,7 +1983,7 @@ ## 1985, Cleve Moler noted that most of the singular values of ## PARTER(N) are very close to PI. An explanation of the phenomenon ## was given by Parter; see also the paper by Tyrtyshnikov. - ## + ## ## References: ## The MathWorks Newsletter, Volume 1, Issue 1, March 1986, page 2. ## S.V. Parter, On the distribution of the singular values of Toeplitz @@ -2089,7 +2089,7 @@ ## This M-file handles the real case only and is intended simply as a ## convenient way to generate random or non-random orthogonal Hessenberg ## matrices. - ## + ## ## Reference: ## W.B. Gragg, The QR algorithm for unitary Hessenberg matrices, ## J. Comp. Appl. Math., 16 (1986), pp. 1-8. @@ -2585,7 +2585,7 @@ jidx = varargin{end-1}; svec = [varargin{1:end-1}]; varargin(end-1) = []; - else + else error (["gallery: J must be an integer in the range [0, 2^32-1] " ... "for uniformdata matrix"]); endif @@ -2599,7 +2599,7 @@ ## Save and restore random state. Initialization done so that reproducible ## data is available from gallery depending on the jidx and size vector. - randstate = rand ("state"); + randstate = rand ("state"); unwind_protect rand ("state", svec); A = rand (varargin{:}); @@ -2715,9 +2715,9 @@ for j = 1:ny for i = 1:nx - ## + ## ## For the element (I,J), determine the indices of the 8 nodes. - ## + ## nn(1) = 3*j*nx + 2*i + 2*j + 1; nn(2) = nn(1) - 1; nn(3) = nn(2) - 1; @@ -2817,7 +2817,7 @@ ## This is a `standard' reduction. Cf. reduction to bidiagonal form ## prior to computing the SVD. This code is a little wasteful in that ## it computes certain elements which are immediately set to zero! - ## + ## ## Reference: ## G.H. Golub and C.F. Van Loan, Matrix Computations, second edition, ## Johns Hopkins University Press, Baltimore, Maryland, 1989.