hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox Chapter Introduction

F03 — Determinants

Scope of the Chapter

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

Background to the Problems

The functions in this chapter compute the determinant of a square matrix AA. The matrix is assumued to have first been decomposed into triangular factors
A = LU ,
A=LU ,
using functions from Chapter F07.
If AA is positive definite, then U = LTU=LT, and the determinant is the product of the squares of the diagonal elements of LL. Otherwise, the functions in this chapter use the Dolittle form of the LULU decomposition, where LL has unit elements on its diagonal. The determinant is then the product of the diagonal elements of UU, 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
detA = d1 × 2d2
where d2d2 is an integer and
(1/16)|d1| < 1 .
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.

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 AA 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 AA is positive definite, i.e., all eigenvalues of A > 0A>0. A real symmetric matrix AA not known to be positive definite must be treated as a general real matrix. In all other cases either the band function or the general functions must be used.
The functions in this chapter are general purpose functions. These give the value of the determinant in its scaled form, d1d1 and d2d2, given the triangular decomposition of the matrix from a suitable function from Chapter F07.

Decision Tree

Tree 1

Is AA a real matrix? _
Is AA a symmetric positive definite matrix? _
Is AA a band matrix? _
nag_lapack_dpbtrf (f07hd) and nag_det_real_band_sym (f03bh)
| | no
| | nag_lapack_dpotrf (f07fd) and nag_det_real_sym (f03bf)
| no
| nag_lapack_dgetrf (f07ad) and nag_det_real_gen (f03ba)
nag_lapack_zgetrf (f07ar) and nag_det_complex_gen (f03bn)

Functionality Index

Determinants of factorized matrices, 
    complex matrix nag_det_complex_gen (f03bn)
    real matrix nag_det_real_gen (f03ba)
    real symmetric band positive definite matrix nag_det_real_band_sym (f03bh)
    real symmetric positive definite matrix nag_det_real_sym (f03bf)


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

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013