PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zungtr (f08ft)
Purpose
nag_lapack_zungtr (f08ft) generates the complex unitary matrix
, which was determined by
nag_lapack_zhetrd (f08fs) when reducing a Hermitian matrix to tridiagonal form.
Syntax
Description
nag_lapack_zungtr (f08ft) is intended to be used after a call to
nag_lapack_zhetrd (f08fs), which reduces a complex Hermitian matrix
to real symmetric tridiagonal form
by a unitary similarity transformation:
.
nag_lapack_zhetrd (f08fs) represents the unitary matrix
as a product of
elementary reflectors.
This function may be used to generate explicitly as a square matrix.
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
This
must be the same argument
uplo as supplied to
nag_lapack_zhetrd (f08fs).
Constraint:
or .
- 2:
– complex array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
Details of the vectors which define the elementary reflectors, as returned by
nag_lapack_zhetrd (f08fs).
- 3:
– complex array
-
The dimension of the array
tau
must be at least
Further details of the elementary reflectors, as returned by
nag_lapack_zhetrd (f08fs).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a and the second dimension of the array
a.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
The by unitary matrix .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
uplo, 2:
n, 3:
a, 4:
lda, 5:
tau, 6:
work, 7:
lwork, 8:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
Accuracy
The computed matrix
differs from an exactly unitary matrix by a matrix
such that
where
is the
machine precision.
Further Comments
The total number of real floating-point operations is approximately .
The real analogue of this function is
nag_lapack_dorgtr (f08ff).
Example
This example computes all the eigenvalues and eigenvectors of the matrix
, where
Here
is Hermitian and must first be reduced to tridiagonal form by
nag_lapack_zhetrd (f08fs). The program then calls
nag_lapack_zungtr (f08ft) to form
, and passes this matrix to
nag_lapack_zsteqr (f08js) which computes the eigenvalues and eigenvectors of
.
Open in the MATLAB editor:
f08ft_example
function f08ft_example
fprintf('f08ft example results\n\n');
uplo = 'L';
n = 4;
a = [-2.28 + 0.00i, 0.00 + 0i, 0 + 0i, 0 + 0i;
1.78 + 2.03i, -1.12 + 0i, 0 + 0i, 0 + 0i;
2.26 - 0.10i, 0.01 - 0.43i, -0.37 + 0i, 0 + 0i;
-0.12 - 2.53i, -1.07 - 0.86i, 2.31 + 0.92i, -0.73 + 0i];
[QT, d, e, tau, info] = f08fs( ...
uplo, a);
[Q, info] = f08ft(uplo, QT, tau);
compz = 'V';
[w, ~, z, info] = f08js( ...
compz, d, e, Q);
for i = 1:n
[~,k] = max(abs(real(z(:,i)))+abs(imag(z(:,i))));
z(:,i) = z(:,i)*conj(z(k,i))/abs(z(k,i));
end
disp(' Eigenvalues of A:');
disp(w);
disp(' Corresponding eigenvectors:');
disp(z);
f08ft example results
Eigenvalues of A:
-6.0002
-3.0030
0.5036
3.9996
Corresponding eigenvectors:
0.7299 + 0.0000i -0.2120 + 0.1497i 0.1000 - 0.3570i 0.1991 + 0.4720i
-0.1663 - 0.2061i 0.7307 + 0.0000i 0.2863 - 0.3353i -0.2467 + 0.3751i
-0.4165 - 0.1417i -0.3291 + 0.0479i 0.6890 + 0.0000i 0.4468 + 0.1466i
0.1743 + 0.4162i 0.5200 + 0.1329i 0.0662 + 0.4347i 0.5612 + 0.0000i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015