det_by_minor

View page source

Determinant Using Expansion by Minors

ell

We use \(\ell\) to denote the row and column dimension of the square matrix under consideration.

Algorithm

This algorithm computes \(|A|\) the determinant of a square matrix \(A \in \B{R}^{\ell \times \ell}\) . In the special case where ell is one, the determinant is just the element of the matrix. Otherwise, the determinant is computed using the formula

\[| A | = + | A(0,0) | - | A(0,1) | + | A(0,2) | \cdots \pm | A(0,\ell-1) |\]

where the last term is + (-) if ell is odd (even) and \(A(i,j) \in \B{R}^{(\ell-1) \times (\ell-1)}\) is the \((i,j)\) minor of A; i.e., the square sub-matrix formed by deleting the i-th row and j-th column of A .

option

The only option used by this algorithm is n_arg ; see below:

n_arg

This is the number of arguments to the algorithm which is the number of elements in the matrix; i.e., \(\ell^2\) . There is an assert checking that n_arg > 0.

n_other

This option is not used except that it may be checked to make sure it is zero.

Implementation

cpp_det_by_minor , py_det_by_minor .

Derivative

The partial derivative of \(|A|\) with respect to the \((i,j)\)-th element \(A_{i,j}\) is

\[\frac{ \partial |A| }{ \partial A_{i,j} } = (-1)^{i+j} | A(i,j) |\]