(User.programs) Item: 213 by _tasmith at hpcvbbs.UUCP Author: [Ted A Smith] Subj: Eigenvalue/Eigenvector decomposition Keyw: eigenvalues eigenvectors functions of a matrix Date: Wed Feb 06 1991 22:09 Here is a quick and dirty eigenvalue/eigenvector decomposition for real symetric matricies. I used the Jacobi method. The termination test is a hack (I just test to see if the eigenvector matrix has changed in a given pass!) I don't have any idea if there is a possibility of non-termination. Eigen takes a real symetric matrix in level 1 and returns the matrix of eigenvectors in level 2 and the eigenvalues are along the diagonal of the matrix in level 1. (The offdiagonal values should be small in relation to the diagonal values.) EClr can be used to 0 the offdiagonal values. EFun takes a real symetric matrix (M) in level 2 and a function of 1 real arg (F) in level 1 and returns F(M) in level 1. For example in analogy with 'SIN(x)^2+COS(x)^2==1': [[ 1 2 3 ] [ 2 4 5 ] [ 3 5 6 ]] DUP \<< SIN \>> EFun DUP * OVER \<< COS \>> EFun DUP * + [[ .999999999981 9.89E-12 -1.881E-11 ] [ 1.188E-11 .999999999959 -3.3E-12 ] [ -1.801E-11 -2.3E-12 .999999999962 ]]