comparison toolbox/kms.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 A = kms(n, rho)
2 %KMS Kac-Murdock-Szego Toeplitz matrix.
3 % A = KMS(N, RHO) is the N-by-N Kac-Murdock-Szego Toeplitz matrix with
4 % A(i,j) = RHO^(ABS((i-j))) (for real RHO).
5 % If RHO is complex, then the same formula holds except that elements
6 % below the diagonal are conjugated.
7 % RHO defaults to 0.5.
8 % Properties:
9 % A has an LDL' factorization with
10 % L = INV(TRIW(N,-RHO,1)'),
11 % D(i,i) = (1-ABS(RHO)^2)*EYE(N) except D(1,1) = 1.
12 % A is positive definite if and only if 0 < ABS(RHO) < 1.
13 % INV(A) is tridiagonal.
14
15 % Reference:
16 % W.F. Trench, Numerical solution of the eigenvalue problem
17 % for Hermitian Toeplitz matrices, SIAM J. Matrix Analysis and Appl.,
18 % 10 (1989), pp. 135-146 (and see the references therein).
19
20 if nargin < 2, rho = 0.5; end
21
22 A = (1:n)'*ones(1,n);
23 A = abs(A - A');
24 A = rho .^ A;
25 if imag(rho)
26 A = conj(tril(A,-1)) + triu(A);
27 end