Macaulay2 Engine
Loading...
Searching...
No Matches
int-bag.hpp File Reference

int_bag / Bag — minimal (payload, varpower monomial) carrier shared by monomial-ideal code. More...

#include "newdelete.hpp"

Go to the source code of this file.

Classes

class  int_bag

Typedefs

typedef int_bag Bag

Detailed Description

int_bag / Bag — minimal (payload, varpower monomial) carrier shared by monomial-ideal code.

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

Declares int_bag (aliased as Bag at the bottom — most engine code refers to it under the alias), a small GC-managed class pairing a gc_vector<int> varpower monomial with a payload union of either an int (b_elem, typically a basis index) or a void* (b_ptr, typically a gbvector* or Nterm*). Callers know which arm of the union applies at each call site; there is no runtime tag. Five constructors cover the cases — default, int b, void* b, (int b, varpower), and (void* b, varpower), plus copy constructors from reference and pointer. The accessors expose both arms (basis_elem() / basis_ptr()) plus the monomial via the paired monom() / vector() overloads (returning the same gc_vector<int>& either way — monom() carries the varpower-encoded monomial, the vector() alias is the same underlying buffer).

The class survives from an older era of engine code that wanted a single concrete type for ferrying (payload, monomial) pairs — primarily through MonomialIdeal build helpers (Nmi_node leaves carry Bag* payloads) and monomial-ideal minimal-prime recursion. Newer engine code prefers std::pair over varpower or the strongly-typed indices from gb-f4/; removing int_bag would touch many call sites and is not yet on the critical path.

See also
ExponentList.hpp
monideal.hpp

Definition in file int-bag.hpp.