|
NAG[f02abc] NAG[nag_real_symm_eigensystem] - All eigenvalues and eigenvectors of real symmetric matrix
|
|
Calling Sequence
f02abc(a, r, v, 'n'=n, 'tda'=tda, 'tdv'=tdv, 'fail'=fail)
nag_real_symm_eigensystem(. . .)
Parameters
|
a - Matrix(1..n, 1..tda, datatype=float[8], order=C_order);
|
|
|
|
r - Vector(1..n, datatype=float[8]);
|
|
|
On exit: the eigenvalues in ascending order.
|
|
|
v - Matrix(1..n, 1..tdv, datatype=float[8], order=C_order);
|
|
|
On exit: the normalized eigenvectors, stored by columns; the th column corresponds to the th eigenvalue. The eigenvectors are normalized so that the sum of squares of the elements is equal to 1.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the arrays a, r, v and the second dimension of the arrays a, r, vthe arrays a, v.
|
|
On entry: , the order of the matrix .
|
|
Constraint: . .
|
|
|
'tda'=tda - integer; (optional)
|
|
|
On entry: the second dimension of the array a as declared in the function from which nag_real_symm_eigensystem (f02abc) is called.
|
|
Constraint: . .
|
|
|
'tdv'=tdv - integer; (optional)
|
|
|
On entry: the second dimension of the array v as declared in the function from which nag_real_symm_eigensystem (f02abc) is called.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_real_symm_eigensystem (f02abc) calculates all the eigenvalues and eigenvectors of a real symmetric matrix.
|
|
Description
|
|
nag_real_symm_eigensystem (f02abc) reduces the real symmetric matrix to a real symmetric tridiagonal matrix by Householder's method. The eigenvalues and eigenvectors are calculated using the algorithm.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_INT_ARG_LT"
On entry, n must not be less than 1: .
"NE_TOO_MANY_ITERATIONS"
More than iterations are required to isolate all the eigenvalues.
|
|
Accuracy
|
|
The eigenvectors are always accurately orthogonal but the accuracy of the individual eigenvectors is dependent on their inherent sensitivity to changes in the original matrix. For a detailed error analysis see pages 222 and 235 of Wilkinson and Reinsch (1971).
|
|
Further Comments
|
|
The time taken by nag_real_symm_eigensystem (f02abc) is approximately proportional to .
The function may be called with the same actual array supplied for arguments a and v, in which case the eigenvectors will overwrite the original matrix.
|
|
|
Examples
|
|
>
|
n := 4:
tda := 4:
tdv := 4:
a := Matrix([[0.5, 0, 2.3, -2.6], [0, 0.5, -1.4, -0.7], [2.3, -1.4, 0.5, 0], [-2.6, -0.7, 0, 0.5]], datatype=float[8], order='C_order'):
r := Vector(4, datatype=float[8]):
v := Matrix(4, 4, datatype=float[8], order='C_order'):
NAG:-f02abc(a, r, v, 'n' = n, 'tda' = tda, 'tdv' = tdv):
for i from 1 to 4 do
v[1..-1,i]:
end do:
|
|
|