27 size_t varCount = ideal.getVarCount();
30 for (
size_t generator = 0; generator < ideal.getGeneratorCount(); ++generator) {
34 for (
size_t var = 0; var < varCount; ++var)
35 libIdeal.
addExponent(ideal[generator][var].get_mpz_t());
44 ASSERT(
sizeof(mpz_class) ==
sizeof(mpz_t));
45 return reinterpret_cast<const mpz_t*
>(&(vect[0]));
62 for (
size_t var = 0; var <
_ideal.getVarCount(); ++var)
63 _ideal.getLastTermRef()[var] = mpz_class(exponentVector[var]);
87 for (
size_t var = 0; var <
_names.getVarCount(); ++var)
88 _ideals.back().getLastTermRef()[var] = mpz_class(exponentVector[var]);
92 for (
size_t i = 0; i <
_ideals.size(); ++i)
109 for (
size_t var = 0; var <
_polynomial.getVarCount(); ++var)
110 _polynomial.getLastTerm()[var] = mpz_class(exponentVector[var]);
const mpz_t * castLibArray(const vector< mpz_class > &vect)
Returns a pointer to an array of mpt_t that represents the entries in the mpz_class.
Frobby::Ideal toLibIdeal(const BigIdeal &ideal)
Returns a library interface ideal that corresponds to the parameter ideal.
void addExponent(const mpz_t exponent)
Call addExponent once for each variable to add a term one exponent at a time.
Represents a monomial ideal with int exponents.
const BigIdeal & getIdeal() const
Returns the recorded ideal in a canonical form.
virtual void consume(mpz_ptr *exponentVector)
For output of a generator of the ideal.
virtual void idealBegin(size_t varCount)
Called before output of a monomial ideal.
LibIdealConsumer(const VarNames &names)
bool hasAnyOutput() const
Returns whether any ideal has been recorded.
virtual void consume(mpz_ptr *exponentVector)
For output of a generator of the ideal.
LibIdealsConsumer(const VarNames &names)
virtual void idealBegin(size_t varCount)
Called before output of a monomial ideal.
const vector< BigIdeal > & getIdeals() const
Returns the recorded ideals in a canonical form.
vector< BigIdeal > _ideals
const BigPolynomial & getPolynomial() const
Returns the recorded polynomial in a canonical form.
virtual void polynomialBegin(size_t varCount)
Called before output of a polynomial.
virtual void consume(const mpz_t coef, mpz_ptr *exponentVector)
For output of a term of the polynomial.
BigPolynomial _polynomial
LibPolynomialConsumer(const VarNames &names)
Defines the variables of a polynomial ring and facilities IO involving them.
#define TEST_SUITE(SUITE)
The namespace Frobby contains the public interface of Frobby.
This header file includes common definitions and is included as the first line of code in every imple...