GENERIC INTERFACE EigenN(VRep, MRep); (* Eigenvalues of square matrices. In-place ("destructive") eigenvalue and eigenvector computation for finite-dimensional linear maps "MRep.T"s. It is assumed that each "VRep.T" value is an element of a finite-dimensional vector space, and each "MRep.T" is a linear map from some finite-dimensional subset of "VRep.T" to itself. Conceptually, an "MRep.T" is a two-dimensional array of floats, but concretely it could be something else --- say, a triangular matrix, a quaternion, a procedure, etc. Created by J. Stolfi, with contributions by Marcellus R. Macêdo. *) PROCEDURE SymEigen( VAR m: MRep.T; (* IN: symmetric matrix. OUT: garbage *) VAR val: ARRAY OF LONGREAL; (* OUT: eigenvalues of "M". *) VAR vec: ARRAY OF VRep.T; (* OUT: eigenvectors of "M". *) VAR b: ARRAY OF LONGREAL; (* WORK *) VAR z: ARRAY OF LONGREAL; (* WORK *) ); (* Computes the eigenvalues and eigenvectors of the matrix "m", which is assumed to be square ("N" by "N") and symmetric. The "N" unordered eigenvalues are returned in "val", and the corresponding eigenvectors in "vec". Matrix "m" is destroyed in the process. Parameters "b" AND "z" are work vectors of size "N". Uses the Jacobi algorithm from Numerical Recipes. *) END EigenN.