home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / electronic / rlab / TestMatrix / lotkin_r < prev    next >
Encoding:
Text File  |  1994-12-20  |  858 b   |  33 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:      Lotkin matrix.
  4.  
  5. // Syntax:        A = lotkin ( N )
  6.  
  7. // Description:
  8.  
  9. //      A is the Hilbert matrix with its first row altered to all
  10. //      ones.  A is unsymmetric, ill-conditioned, and has many
  11. //      negative eigenvalues of small magnitude. The inverse has
  12. //      integer entries and is known explicitly. 
  13.  
  14. //      Reference:
  15. //       M. Lotkin, A set of test matrices, MTAC, 9 (1955),
  16. //       pp. 153-161.
  17.  
  18. //    This file is a translation of lotkin.m from version 2.0 of
  19. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  20. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  21.  
  22. //-------------------------------------------------------------------//
  23.  
  24. lotkin = function ( n )
  25. {
  26.   local (n)
  27.  
  28.   A = hilb(n);
  29.   A[1;] = ones(1,n);
  30.  
  31.   return A;
  32. };
  33.