|
Macaulay2 Engine
|
Determinants and minors of Matrix values via Bareiss, cofactor, or dynamic-programming strategies. More...
#include "matrix.hpp"#include "matrix-con.hpp"#include <utility>#include <vector>#include <map>#include <algorithm>Go to the source code of this file.
Classes | |
| class | DetComputation |
| Computation of minors of a matrix. More... | |
Variables | |
| const int | DET_BAREISS = 0 |
| const int | DET_COFACTOR = 1 |
| const int | DET_DYNAMIC = 2 |
Determinants and minors of Matrix values via Bareiss, cofactor, or dynamic-programming strategies.
Declares DetComputation and the three integer strategy constants the caller selects between: DET_BAREISS, DET_COFACTOR, and DET_DYNAMIC. Bareiss is the fraction-free Gaussian variant — requires the coefficient ring to be a domain (the in-source comment annotates it "fraction free, DOMAINS only") and keeps the intermediate pivots integral by carrying the previous pivot through the divisions. Cofactor is a straight recursive Laplace expansion along the last row of each submatrix, skipping zero entries; it is the natural fallback over rings where Bareiss division does not apply (inexact fields, quotient rings). Dynamic is the memoised variant: it caches submatrix minors in nested std::maps keyed by row/column index sets so that minor-list queries of many sizes share work. The user-facing det / minors functions defined in m2/multilin.m2 map their Strategy => option onto these three constants.
Entry points operate on a Matrix and return either a RingElement (the determinant of a square submatrix) or a Matrix collecting minors (or an exterior power when the do_exterior flag is set).
Definition in file det.hpp.