Language Reference

GENEIG Call

CALL GENEIG (eval, evecs, sym-matrix1, sym-matrix2) ;

This subroutine is supported by the IML procedure and the iml action.

The GENEIG subroutine computes eigenvalues and eigenvectors of a generalized eigenvalue problem.

The input arguments to the GENEIG subroutine are as follows:

sym-matrix1

is a symmetric numeric matrix.

sym-matrix2

is a positive definite symmetric matrix.

The subroutine returns the following output arguments:

evals

names a vector in which the eigenvalues are returned.

evecs

names a matrix in which the corresponding eigenvectors are returned.

The GENEIG subroutine computes eigenvalues and eigenvectors of the generalized eigenvalue problem. If bold upper A and bold upper B are symmetric and bold upper B is positive definite, then the vector bold upper M and the matrix bold upper E solve the generalized eigenvalue problem provided that

bold upper A asterisk bold upper E equals bold upper B asterisk bold upper E asterisk diag left-parenthesis bold upper M right-parenthesis

The vector bold upper M contains the eigenvalues arranged in descending order, and the matrix bold upper E contains the corresponding eigenvectors in the columns.

The following example is from Wilkinson and Reinsch (1971):

A = {10   2   3   1   1,
      2  12   1   2   1,
      3   1  11   1  -1,
      1   2   1   9   1,
      1   1  -1   1  15};

B = {12   1  -1   2    1,
      1  14   1  -1    1,
     -1   1  16  -1    1,
      2  -1  -1  12   -1,
      1   1   1  -1   11};

call geneig(M, E, A, B);
print M, E;

Figure 167: Solution of a Generalized Eigenproblem

M
1.4923532
1.1092845
0.943859
0.6636627
0.4327872

E
-0.0763870.1420120.19171-0.08292-0.134591
0.0170980.14242-0.158991-0.1531480.0612947
-0.0666650.12099760.07483910.11860370.1579026
0.0860480.125531-0.1374690.182813-0.109466
0.28943340.00769220.0889779-0.0035620.041473


Last updated: July 20, 2026