home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------//
-
- // Synopsis: Lehmer matrix - symmetric positive definite.
-
- // Syntax: A = lehmer ( N )
-
- // Description:
-
- // A is the symmetric positive definite N-by-N matrix with
- // A(i,j) = i/j for j >= i.
- // A is totally nonnegative. INV(A) is tridiagonal, and explicit
- // formulas are known for its entries.
-
- // N <= COND(A) <= 4*N*N.
-
- // References:
- // M. Newman and J. Todd, The evaluation of matrix inversion
- // programs, J. Soc. Indust. Appl. Math., 6 (1958), pp. 466-476.
- // Solutions to problem E710 (proposed by D.H. Lehmer): The inverse
- // of a matrix, Amer. Math. Monthly, 53 (1946), pp. 534-535.
- // J. Todd, Basic Numerical Mathematics, Vol. 2: Numerical Algebra,
- // Birkhauser, Basel, and Academic Press, New York, 1977, p. 154.
-
- // This file is a translation of lehmer.m from version 2.0 of
- // "The Test Matrix Toolbox for Matlab", described in Numerical
- // Analysis Report No. 237, December 1993, by N. J. Higham.
-
- //-------------------------------------------------------------------//
-
- lehmer = function ( n )
- {
- local (n)
-
- A = ones(n,1)*(1:n);
- A = A./A';
- A = tril(A) + tril(A,-1)';
-
- return A;
- };
-