|
Macaulay2 Engine
|
Hash table specialisation for (exponent vector, unsigned long) pairs. More...
Go to the source code of this file.
Typedefs | |
| typedef int * | exponent |
Functions | |
| exponent_table * | exponent_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) |
Hash table specialisation for (exponent vector, unsigned long) pairs.
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.
Definition in file exptable.h.