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

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:    Chow matrix - a singular Toeplitz lower Hessenberg matrix.
  4.  
  5. // Syntax: A = chow ( N , ALPHA , DELTA )
  6.  
  7. // Description:
  8.  
  9. //    A is a Toeplitz lower Hessenberg matrix.
  10. //      A = H(ALPHA) + DELTA*EYE, where H(i,j) = ALPHA^(i-j+1).
  11. //      H(ALPHA) has p = FLOOR((N+1)/2) zero eigenvalues, the rest
  12. //    being 4*ALPHA*COS( k*PI/(N+2) )^2, k=1:N-p. 
  13.  
  14. //      Defaults: ALPHA = 1, DELTA = 0.
  15.  
  16. //        References:
  17. //        T.S. Chow, A class of Hessenberg matrices with known
  18. //           eigenvalues and inverses, SIAM Review, 11 (1969), pp. 391-395.
  19. //        G. Fairweather, On the eigenvalues and eigenvectors of a class of
  20. //           Hessenberg matrices, SIAM Review, 13 (1971), pp. 220-221.
  21.  
  22. //    This file is a translation of chow.m from version 2.0 of
  23. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  24. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  25.  
  26. // Dependencies
  27.    require toeplitz
  28.  
  29. //-------------------------------------------------------------------//
  30.  
  31. chow = function ( n , alpha , delta )
  32. {
  33.   if (!exist (delta)) { delta = 0; }
  34.   if (!exist (alpha)) { alpha = 1; }
  35.  
  36.   return toeplitz( alpha.^[1:n], [alpha, 1, zeros(1,n-2)] ) + delta*eye(n,n);
  37. };
  38.