Macaulay2 Engine
Loading...
Searching...
No Matches
MonoidTest.cpp File Reference

gtest coverage for the ExponentVector exponent-array primitives. More...

#include <gtest/gtest.h>
#include <iostream>
#include <memory>
#include <vector>
#include "ExponentVector.hpp"
#include "monoid.hpp"

Go to the source code of this file.

Functions

 TEST (ExponentVector, All)

Detailed Description

gtest coverage for the ExponentVector exponent-array primitives.

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

Hosts the TEST(ExponentVector, All) battery that exercises the raw exponents_t (int*) primitives every polynomial multiplication in the engine sits on top of: copy, equal, simple_degree, one / is_one, mult, power, multpower, divides, divide, quotient, gcd, lcm, lex_compare, weight, mask, and the syz syzygy split. The Monoid tests comment block is a placeholder for future coverage; today the file only exercises the underlying exponent-array layer.

Subtle bugs in these primitives surface several layers up as "F4 returns the wrong GB" or "Hilbert function is off by one"; catching them here keeps the failure local. Exponents are stored as raw int* rather than std::vector<int> so the F4 inner loop can read entries with a single load — the tests use pre-allocated int[3] stack arrays passed through static_cast<exponents_t> to match that representation.

See also
ExponentVector.hpp
monoid.hpp
ARingTest.hpp
f4/f4.hpp

Definition in file MonoidTest.cpp.