home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------//
-
- // Synopsis: Eigenvalue condition numbers.
-
- // Syntax: eigsens ( A )
-
- // Description:
-
- // Returns a vector of condition numbers for the eigenvalues of A
- // (reciprocals of the Wilkinson s(lambda) numbers). These
- // condition numbers are the reciprocals of the cosines of the
- // angles between the left and right eigenvectors.
-
- // Eigsens returns a list containing elements:
- // vec eigenvectors
- // val eigenvalues
- // sens sensitivities
-
- // Reference:
- // G.H. Golub and C.F. Van Loan, Matrix Computations, Second
- // Edition, Johns Hopkins University Press, Baltimore, Maryland,
- // 1989, sec. 7.2.2.
-
- // This file is a translation of eigsens.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.
-
- //-------------------------------------------------------------------//
-
- eigsens = function ( A )
- {
- n = max(size(A));
- s = zeros(n,1);
-
- e = eig (A);
- Y = inv(e.vec);
-
- for (i in 1:n)
- {
- s[i] = norm(Y[i;],"2") * norm(e.vec[i;],"2") / abs( Y[i;]*e.vec[;i] );
- }
-
- return << vec = e.vec; val = e.val; sens = s >>;
- };
-