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]));
88 _ideals.back().getLastTermRef()[var] = mpz_class(exponentVector[var]);
92 for (
size_t i = 0; i <
_ideals.size(); ++i)
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.
size_t getVarCount() const
vector< mpz_class > & getLastTermRef()
mpz_class & getLastCoef()
size_t getVarCount() const
vector< mpz_class > & getLastTerm()
void sortTermsReverseLex()
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.
size_t getVarCount() const
Returns the current number of variables.
#define TEST_SUITE(SUITE)
The namespace Frobby contains the public interface of Frobby.