30 class CountingConsumer :
33 CountingConsumer(FILE* out):
43 virtual ~CountingConsumer() {
49 virtual void consumeRing(
const VarNames& names) {
52 virtual void beginConsuming() {
60 virtual void consume(
const vector<mpz_class>& term) {
64 virtual void consume(
const BigIdeal& ideal) {
70 virtual void consume(
const mpz_class& coef,
const Term& term) {
74 virtual void consume(
const mpz_class& coef,
80 virtual void consume(
const mpz_class& coef,
81 const vector<mpz_class>& term) {
91 virtual void doneConsuming() {
92 gmp_fprintf(_out,
"%Zd\n", _termCount.get_mpz_t());
102 IOHandlerImpl(staticGetName(),
"Writes the number of output terms.") {
113 return new CountingConsumer(out);
117 return new CountingConsumer(out);
size_t getGeneratorCount() const
size_t getTermCount() const
static const DataType & getMonomialIdealListType()
Returns the one and only instance for monomial ideal lists.
static const DataType & getMonomialIdealType()
Returns the one and only instance for monomial ideals.
static const DataType & getPolynomialType()
Returns the one and only instance for polynomials.
virtual CoefBigTermConsumer * doCreatePolynomialWriter(FILE *out)
virtual BigTermConsumer * doCreateIdealWriter(FILE *out)
static const char * staticGetName()
virtual void doWriteTerm(const vector< mpz_class > &term, const VarNames &names, FILE *out)
This class contains a minimum level of functionality that makes it more convenient to derive from tha...
void registerOutput(const DataType &type)
Specify that output of the argument type is supported.
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Term represents a product of variables which does not include a coefficient.
Defines the variables of a polynomial ring and facilities IO involving them.