f03 Chapter Contents
NAG C Library Manual

NAG Library Chapter Introductionf03 – Determinants

1  Scope of the Chapter

This chapter is concerned with the calculation of determinants of square matrices.

2  Background to the Problems

The functions in this chapter compute the determinant of a square matrix $A$. The matrix is assumued to have first been decomposed into triangular factors
 $A=LU ,$
using functions from Chapter f07.
If $A$ is positive definite, then $U={L}^{\mathrm{T}}$, and the determinant is the product of the squares of the diagonal elements of $L$. Otherwise, the functions in this chapter use the Dolittle form of the $LU$ decomposition, where $L$ has unit elements on its diagonal. The determinant is then the product of the diagonal elements of $U$, taking account of possible sign changes due to row interchanges.
To avoid overflow or underflow in the computation of the determinant, some scaling is associated with each multiplication in the product of the relevant diagonal elements. The final value is represented by
 $det⁡A=d1×2d2$
where $d2$ is an integer and
 $116≤d1<1 .$
For complex valued determinants the real and imaginary parts are scaled separately.
Most of the original functions of the chapter were based on those published in the book edited by Wilkinson and Reinsch (1971). We are very grateful to the late Dr J H Wilkinson FRS for his help and interest during the implementation of this chapter of the Library.

3  Recommendations on Choice and Use of Available Functions

It is extremely wasteful of computer time and storage to use an inappropriate function, for example to use a function requiring a complex matrix when $A$ is real. Most programmers will know whether their matrix is real or complex, but may be less certain whether or not a real symmetric matrix $A$ is positive definite, i.e., all eigenvalues of $A>0$. A real symmetric matrix $A$ not known to be positive definite must be treated as a general real matrix.

4  Decision Trees

Tree 1

 Is $A$ a real matrix? _yes Is $A$ a symmetric positive definite matrix? _yes Is $A$ a banded matrix? _yes f07hdc and f03bhc | | no| | | f07fdc and f03bfc | no| | f07adc and f03bac no| f07arc and f03bnc
Note: if at any stage the answer to a question is ‘Don't know’ this should be read as ‘No’.

5  Functionality Index

 Determinants of factorized matrices:
 complex matrix nag_det_complex_gen (f03bnc)
 real matrix nag_det_real_gen (f03bac)
 real symmetric band positive definite matrix nag_det_real_band_sym (f03bhc)
 real symmetric positive definite matrix nag_det_real_sym (f03bfc)

6  Functions Withdrawn or Scheduled for Withdrawal

 WithdrawnFunction Mark ofWithdrawal Replacement Function(s) nag_real_cholesky (f03aec) 25 nag_dpotrf (f07fdc) and nag_det_real_sym (f03bfc) nag_real_lu (f03afc) 25 nag_dgetrf (f07adc) and nag_det_real_gen (f03bac) nag_complex_lu (f03ahc) 25 nag_zgetrf (f07arc) and nag_det_complex_gen (f03bnc)

7  References

Fox L (1964) An Introduction to Numerical Linear Algebra Oxford University Press
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag

f03 Chapter Contents