|
Macaulay2 Engine
|
KBasis — k-vector-space basis of a graded module restricted to chosen degrees. More...
#include <stddef.h>#include <vector>#include "ExponentVector.hpp"#include "interface/m2-mem.h"#include "engine-includes.hpp"#include "error.h"#include "freemod.hpp"#include "int-bag.hpp"#include "interrupted.hpp"#include "matrix-con.hpp"#include "matrix.hpp"#include "monideal.hpp"#include "monoid.hpp"#include "newdelete.hpp"#include "polyring.hpp"#include "ring.hpp"#include "ringelem.hpp"#include "style.hpp"#include "util.hpp"Go to the source code of this file.
Classes | |
| class | KBasis |
| Enumerates a k-basis (degree-graded monomial basis) of a module, a finite module's entire basis, or the basis of a map between modules. More... | |
Functions | |
| static bool | all_have_pure_powers (const MonomialIdeal *M, std::vector< int > varlist) |
KBasis — k-vector-space basis of a graded module restricted to chosen degrees.
Implements the engine code behind M2's basis(d, M): given a graded module M and a degree vector (or (lo, hi) range), return a single-row Matrix whose columns are the standard monomials of M in the requested degrees. The algorithm computes the leading-term monomial ideal of M's presentation and enumerates standard monomials by complement, walking the monomial-ideal tree once rather than the naive variable- exponentiation that would blow up exponentially. The KBasis class tags its three modes via a private enum { KB_FULL, KB_SINGLE, KB_MULTI } computation_type — full (finite-basis) collection, a single requested degree, or a (lo_degree, hi_degree) range — and do_truncation switches between returning the basis vs the truncation. The single public entry Matrix::basis(lo, hi, heft, vars, do_truncation, limit) (defined at the bottom) hands its arguments off to KBasis::k_basis.
The Hilbert-function counts in hilb.hpp are derived from exactly these basis sizes; the non-commutative analogue lives in matrix-ncbasis.cpp because the NC monomial structure is different.
Definition in file matrix-kbasis.cpp.