home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / electronic / rlab / TestMatrix / pei_r < prev    next >
Encoding:
Text File  |  1994-06-07  |  843 b   |  30 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:    Pei matrix.
  4.  
  5. // Syntax:      pei ( N , ALPHA )
  6.  
  7. // Description:
  8.  
  9. //      pei(N, ALPHA), where ALPHA is a scalar, is the symmetric
  10. //      matrix ALPHA*EYE(N) + ONES(N). If ALPHA is omitted then 
  11. //      ALPHA = 1 is used. 
  12.  
  13. //      The matrix is singular for ALPHA = 0, -N.
  14.  
  15. //      Reference:
  16. //      M.L. Pei, A test matrix for inversion procedures,
  17. //      Comm. ACM, 5 (1962), p. 508.
  18.  
  19. //    This file is a translation of pei.m from version 2.0 of
  20. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  21. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  22.  
  23. //-------------------------------------------------------------------//
  24.  
  25. pei = function ( n, alpha )
  26. {
  27.   if (!exist (alpha)) { alpha = 1; }
  28.   return alpha*eye(n,n) + ones(n,n);
  29. };
  30.