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 assumed to have first been decomposed into triangular factors

using routines from Chapter F07.

$$A=LU\text{,}$$ |

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

where $id$ is an integer and

$$\mathrm{det}A=d\times {2}^{id}$$ |

$$\frac{1}{16}\le \left|d\right|<1\text{.}$$ |

For complex valued determinants the real and imaginary parts are scaled separately.

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, $d$ and $id$, given the triangular decomposition of the matrix from a suitable routine from Chapter F07.

4

Decision Trees

Is $A$ a real matrix? | Is $A$ a symmetric positive definite matrix? | Is $A$ a band matrix? | f07hdf and f03bhf | |||||||

yes | yes | yes | ||||||||

no | no | no | ||||||||

f07fdf and f03bff | ||||||||||

f07adf and f03baf | ||||||||||

f07arf and f03bnf | ||||||||||

5

Functionality Index

6

Auxiliary Routines Associated with Library Routine Arguments

None.

7

Routines Withdrawn or Scheduled for Withdrawal

The following lists all those routines that have been withdrawn since Mark 19 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 |

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