void trideig(double* dfirst, double* dlast, double* e);
Algorithm to determine the eigenvalues of a real, symetric, tridiagonal matrix, or of a real, symmetric matrix previously reduced by tridred(). On input, [dfirst, dlast) contains the diagonal elements of the tridaigonal matrix. On output, it returns the eigenvalues. e inputs the subdiagonal elements of the tridiagonal matrix, with e[0] arbitrary. On output, e is destroyed.
Parameters:
dfirst | Beginning iterator for the diagonal elements of reduced matrix |
---|---|
dlast | Ending iterator for the diagonal elements of reduced matrix |
e | Off-diagonal element of reduced matrix |
Returns:
d is destroyed and on output contains the eigenvalues of the original matrix.
Usage:
double** a = dmatrix(0, 4, 0, 4);
double d[5];
double e[5];
// set the values of a
// a[i][j] = ...
tridred(a, 5, d, e);
trideig(d, d + 5, e);
free_dmatrix(a, 0, 4, 0);
Header:
#include "eigensys.h"