nag_det_real_sym (f03bf) computes the determinant of a real
by
symmetric positive definite matrix
.
nag_lapack_dpotrf (f07fd) must be called first to supply the symmetric matrix
in Cholesky factorized form. The storage (upper or lower triangular) used by
nag_lapack_dpotrf (f07fd) is not relevant to
nag_det_real_sym (f03bf) since only the diagonal elements of the factorized
are referenced.
nag_det_real_sym (f03bf) computes the determinant of a real
by
symmetric positive definite matrix
that has been factorized as
, where
is upper triangular, or
, where
is lower triangular. The determinant is the product of the squares of the diagonal elements of
or
. The Cholesky factorized form of the matrix must be supplied; this is returned by a call to
nag_lapack_dpotrf (f07fd).
The accuracy of the determinant depends on the conditioning of the original matrix. For a detailed error analysis see page 25 of
Wilkinson and Reinsch (1971).
This example computes a Cholesky factorization and calculates the determinant of the real symmetric positive definite matrix
function f03bf_example
fprintf('f03bf example results\n\n');
a = [6, 7, 6, 5;
7, 11, 8, 7;
6, 8, 11, 9;
5, 7, 9, 11];
[a, info] = f07fd('l', a);
fprintf('\n');
[ifail] = x04ca('l', 'n', a, 'Array a after factorization');
[d, id, ifail] = f03bf(a);
fprintf('\nd = %13.5f id = %d\n', d, id);
fprintf('Value of determinant = %13.5e\n', d*2^id);