Language Reference

DET Function

computes the determinant of a square matrix

DET( square-matrix)

where square-matrix is a numeric matrix or literal.

The DET function computes the determinant of square-matrix, which must be square. The determinant, the product of the eigenvalues, is a single numeric value. If the determinant of a matrix is zero, then that matrix is singular; that is, it does not have an inverse.

The method performs an LU decomposition and collects the product of the diagonals (Forsythe, Malcolm, and Moler 1967). For example, consider the following statements:
  
    a={1 1 1,1 2 4,1 3 9}; 
    c=det(a);
 
These statements produce the following matrix c containing the determinant:
  
                 C             1 row       1 col     (numeric) 
  
                                           2
 
The DET function (as well as the INV and SOLVE functions) uses the following criterion to decide whether the input matrix, {a}= [a_{ij}]_{i,j=1, ... ,n}, is singular:
{sing} = 100 x {macheps} x    \max_{1 \leq i,j \leq n} | a_{ij}|
where MACHEPS is the relative machine precision.

All matrix elements less than or equal to sing are now considered rounding errors of the largest matrix elements, so they are taken to be zero. For example, if a diagonal or triangular coefficient matrix has a diagonal value less than or equal to sing, the matrix is considered singular by the DET, INV, and SOLVE functions.

Previously, a much smaller singularity criterion was used, which caused algebraic operations to be performed on values that were essentially floating-point error. This occasionally yielded numerically unstable results. The new criterion is much more conservative, and it generates far fewer erroneous results. In some cases, you might need to scale the data to avoid singular matrices. If you think the new criterion is too strong, do the following:

If a is an n x n matrix, then the DET function temporarily allocates an n^2 array in order to compute the determinant.

Previous Page | Next Page | Top of Page