Mercurial > matrix-functions
comparison toolbox/lehmer.m @ 0:8f23314345f4 draft
Create local repository for matrix toolboxes. Step #0 done.
author | Antonio Pino Robles <data.script93@gmail.com> |
---|---|
date | Wed, 06 May 2015 14:56:53 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8f23314345f4 |
---|---|
1 function A = lehmer(n) | |
2 %LEHMER Lehmer matrix - symmetric positive definite. | |
3 % A = LEHMER(N) is the symmetric positive definite N-by-N matrix with | |
4 % A(i,j) = i/j for j >= i. | |
5 % A is totally nonnegative. INV(A) is tridiagonal, and explicit | |
6 % formulas are known for its entries. | |
7 % N <= COND(A) <= 4*N*N. | |
8 | |
9 % References: | |
10 % M. Newman and J. Todd, The evaluation of matrix inversion | |
11 % programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476. | |
12 % Solutions to problem E710 (proposed by D.H. Lehmer): The inverse | |
13 % of a matrix, Amer. Math. Monthly, 53 (1946), pp. 534-535. | |
14 % J. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra, | |
15 % Birkhauser, Basel, and Academic Press, New York, 1977, p. 154. | |
16 | |
17 A = ones(n,1)*(1:n); | |
18 A = A./A'; | |
19 A = tril(A) + tril(A,-1)'; |