Mercurial > matrix-functions
comparison toolbox/grcar.m @ 2:c124219d7bfa draft
Re-add the 1995 toolbox after noticing the statement in the ~higham/mctoolbox/ webpage.
author | Antonio Pino Robles <data.script93@gmail.com> |
---|---|
date | Thu, 07 May 2015 18:36:24 +0200 |
parents | 8f23314345f4 |
children |
comparison
equal
deleted
inserted
replaced
1:e471a92d17be | 2:c124219d7bfa |
---|---|
1 function G = grcar(n, k) | |
2 %GRCAR Grcar matrix - a Toeplitz matrix with sensitive eigenvalues. | |
3 % GRCAR(N, K) is an N-by-N matrix with -1s on the | |
4 % subdiagonal, 1s on the diagonal, and K superdiagonals of 1s. | |
5 % The default is K = 3. The eigenvalues of this matrix form an | |
6 % interesting pattern in the complex plane (try PS(GRCAR(32))). | |
7 | |
8 % References: | |
9 % J.F. Grcar, Operator coefficient methods for linear equations, | |
10 % Report SAND89-8691, Sandia National Laboratories, Albuquerque, | |
11 % New Mexico, 1989 (Appendix 2). | |
12 % N.M. Nachtigal, L. Reichel and L.N. Trefethen, A hybrid GMRES | |
13 % algorithm for nonsymmetric linear systems, SIAM J. Matrix Anal. | |
14 % Appl., 13 (1992), pp. 796-825. | |
15 | |
16 if nargin == 1, k = 3; end | |
17 | |
18 G = tril(triu(ones(n)), k) - diag(ones(n-1,1), -1); |