Macaulay2 Engine
Loading...
Searching...
No Matches
betti.hpp File Reference

BettiDisplay — engine-side container and renderer for the Betti table of a free resolution. More...

#include "buffer.hpp"
#include "memtailor.h"
#include <unordered_set>
#include <unordered_map>
#include <utility>

Go to the source code of this file.

Classes

class  BettiDisplay
 Engine-side Betti table: a (degree, homological level) rectangle of integers. More...
class  BettiHashAndEq
 Combined hash + equality functor for (int*, int) pairs, used by the resolution code to key an unordered_set on (monomial, component). More...

Detailed Description

BettiDisplay — engine-side container and renderer for the Betti table of a free resolution.

Note
AI-generated documentation. Verify against the source before relying on it.

BettiDisplay holds the graded Betti numbers produced when an engine ResolutionComputation finishes: entry(deg, lev) reads or writes the count at degree deg and homological level lev, with absolute bounds mLoDegree, mHiDegree, mHiLength. The class is intentionally just a 2-D int array (new int[] / delete[]) with bounds plus printing helpers — the actual mathematics (which entries are non-zero and what they equal) is done by the resolution code that fills the table.

getBetti() flattens the table into an M2_arrayint of the form [lo, hi1, len1, values...] where lo is unchanged from mLoDegree and hi1 / len1 are trimmed down to the largest degree / level that still has a positive entry, and displayBetti(buffer&) writes the standard M2 plain-text Betti diagram — column totals, a [grand total] header, - for zero entries — to a buffer. The BettiHashAndEq functor at the bottom of the header is a (int*, int)-keyed hash/equality pair that hashes the int* by its raw pointer value (+ 13 * second) rather than its contents; no engine code outside this header currently instantiates it.

See also
buffer.hpp

Definition in file betti.hpp.