home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / RLaB 1.18c / testmatrix / rq.r < prev    next >
Encoding:
Text File  |  1994-05-25  |  538 b   |  23 lines  |  [TEXT/RLAB]

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:    Rayleigh quotient.
  4.  
  5. // Syntax:    rq ( A , x )
  6.  
  7. // Description:
  8.  
  9. //    R is the Rayleigh quotient of A and x, x'*A*x/(x'*x).
  10.  
  11. //      Called by FV.
  12.  
  13. //    This file is a translation of rq.m from version 2.0 of
  14. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  15. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  16.  
  17. //-------------------------------------------------------------------//
  18.  
  19. rq = function ( A , x )
  20. {
  21.   return x'*A*x/(x'*x);
  22. };
  23.