F03 Chapter Contents
NAG 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 routines 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 routines 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 routines 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 routines 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 Routines

It is extremely wasteful of computer time and storage to use an inappropriate routine, for example to use a routine 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. In all other cases either the band routine or the general routines must be used.
The routines in this chapter are general purpose routines. These give the value of the determinant in its scaled form, $d1$ and $d2$, given the triangular decomposition of the matrix from a suitable routine from Chapter F07.

## 4  Decision Trees

### Tree 1

 Is $A$ a real matrix? _yes Is $A$ a symmetric positive definite matrix? _yes Is $A$ a band matrix? _yes F07HDF and F03BHF | | no| | | F07FDF and F03BFF | no| | F07ADF and F03BAF no| F07ARF and F03BNF

## 5  Functionality Index

 Determinants of factorized matrices,
 complex matrix F03BNF
 real matrix F03BAF
 real symmetric band positive definite matrix F03BHF
 real symmetric positive definite matrix F03BFF

None.

## 7  Routines Withdrawn or Scheduled for Withdrawal

The following lists all those routines that have been withdrawn since Mark 17 of the Library or are scheduled for withdrawal at one of the next two marks.
 WithdrawnRoutine Mark ofWithdrawal Replacement Routine(s) F03AAF 25 F07ADF (DGETRF) and F03BAF F03ABF 25 F07FDF (DPOTRF) and F03BFF F03ACF 25 F07HDF (DPBTRF) and F03BHF F03ADF 25 F07ARF (ZGETRF) and F03BNF F03AEF 25 F07FDF (DPOTRF) and F03BFF F03AFF 25 F07ADF (DGETRF) and F03BAF F03AGF 17 F07HDF (DPBTRF) F03AHF 17 F07ARF (ZGETRF) F03AMF 17 No replacement required; see Chapter F03

## 8  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