ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This module contains procedures and generic interfaces relevant to the computation of the determinants of square matrices.
More...
Data Types | |
interface | getMatDet |
Generate and return the determinant of the input general square matrix. More... | |
interface | getMatDetSqrt |
Generate and return the square-root of the determinant of the input positive-definite square matrix. More... | |
interface | getMatDetSqrtLog |
Generate and return the natural logarithm of the square-root of the determinant of the input positive-definite square matrix. More... | |
interface | setMatDet |
Return the determinant of the input square matrix. More... | |
interface | setMatDetSqrt |
Return the determinant of the input positive-definite square matrix. More... | |
interface | setMatDetSqrtLog |
Return the natural logarithm of the square-root of the determinant of the input positive-definite square matrix. More... | |
Variables | |
character(*, SK), parameter | MODULE_NAME = "@pm_matrixDet" |
This module contains procedures and generic interfaces relevant to the computation of the determinants of square matrices.
The determinant is a scalar value that is a function of the entries of a square matrix.
It characterizes some properties of the matrix and the linear map represented by the matrix.
In particular, the determinant is nonzero if and only if the matrix is invertible and the linear map represented by the matrix is an isomorphism.
The determinant of a product of matrices is the product of their determinants (the preceding property is a corollary of this one).
The determinant of a matrix \(A\) is denoted \(\det(A)\), or \(|A|\).
The determinant of a \(2 \times 2\) matrix is,
\begin{equation} \begin{vmatrix}a&b\\c&d\end{vmatrix} = ad - bc ~, \end{equation}
and the determinant of a \(3 \times 3\) matrix is,
\begin{equation} \begin{vmatrix}a&b&c\\d&e&f\\g&h&i\end{vmatrix} = aei + bfg + cdh - ceg - bdi - afh ~. \end{equation}
The determinant of an \(n \times n\) matrix can be defined in several equivalent ways.
The Leibniz formula expresses the determinant as a sum of signed products of matrix entries such that each summand is the product of \(n\) different entries, and the number of these summands is \(n!\), the factorial of \(n\) (the product of the \(n\) first positive integers).
The Laplace expansion expresses the determinant of an \(n\times n\) matrix as a linear combination of determinants of \((n-1)\times (n-1)\) submatrices.
Gaussian elimination expresses the determinant as the product of the diagonal entries of a diagonal matrix that is obtained by a succession of elementary row operations.
Determinants are used for defining the characteristic polynomial of a matrix, whose roots are the eigenvalues.
In geometry, the signed \(n\)-dimensional volume of a \(n\)-dimensional parallelepiped is expressed by a determinant.
This is used in calculus with exterior differential forms and the Jacobian determinant, in particular for changes of variables in multiple integrals.
The determinant is the unique function defined on the \(n\times n\) matrices that has the four following properties:
\begin{equation} \det(cA) = c^{n}\det(A) ~,~ \text{for an} ~n\times n~ \text{matrix} ~A ~. \end{equation}
\begin{equation} \det(A) = a_{11}a_{22}\cdots a_{nn} = \prod _{i=1}^{n}a_{ii} ~. \end{equation}
Indeed, such a matrix can be reduced, by appropriately adding multiples of the columns with fewer nonzero entries to those with more entries, to a diagonal matrix (without changing the determinant).mat
whose LUP factorization lup(:,:)
is returned by setMatLUP can be computed as (-1)**nswap * getMatMulTrace(lup)
, where nswaps
is the number of swaps made to rows of the original mat
compute its lup
.nswap = count([(rperm(i) /= i, i = 1, size(rperm))]
where rperm
is the row permutation vector returned by setMatLUP.mat
whose upper or lower Cholesky factorization chol(:,:)
is returned by setMatChol is the square of the product of the diagonal elements of its Cholesky factorization and, by definition, is always a positive real number.
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
character(*, SK), parameter pm_matrixDet::MODULE_NAME = "@pm_matrixDet" |
Definition at line 106 of file pm_matrixDet.F90.