Macaulay2 Engine
Loading...
Searching...
No Matches
exptable.h File Reference

Hash table specialisation for (exponent vector, unsigned long) pairs. More...

Go to the source code of this file.

Typedefs

typedef intexponent

Functions

exponent_tableexponent_table_new (int hint, int nvars)
int exponent_table_length (exponent_table *E)
void exponent_table_free (exponent_table **E)
long exponent_table_put (exponent_table *E, const exponent expon, long value)
long exponent_table_get (exponent_table *E, const exponent expon)
const void ** exponent_table_to_array (exponent_table *E)

Detailed Description

Hash table specialisation for (exponent vector, unsigned long) pairs.

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

Specialises David R. Hanson's generic C Table_T (declared in table.h) for the case the engine cares about most: keys are fixed-length integer exponent vectors and values are unsigned long. The exponent_table_* API wraps the generic operations — _new(hint, nvars), _put, _get, _length, _free — with the right key-comparison and hashing for monomial exponents, so callers don't have to wire up hash / cmp callbacks themselves. The convention is to avoid storing zero values: _put returns the previously stored value (or 0 if absent), so a zero return uniformly means "key was not present."

Used wherever the engine accumulates a sparse exponent-keyed histogram — Hilbert-function buckets, monomial-coefficient tallies in res-monomials, F4 monomial-index pools. The base table.h predates the engine's C++ refactor and is one of the remaining C-only files in the engine.

See also
table.h

Definition in file exptable.h.