CanonicalTermConsumer.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef CANONICAL_TERM_CONSUMER_GUARD
#define CANONICAL_TERM_CONSUMER_GUARD
#include "TermConsumer.h"
#include "Ideal.h"
#include "ElementDeleter.h"
class Term;
class TermTranslator;
class CanonicalTermConsumer : public TermConsumer {
public:
CanonicalTermConsumer(unique_ptr<TermConsumer> consumer,
size_t varCount,
TermTranslator* translator = 0);
virtual void consumeRing(const VarNames& names);
virtual void beginConsumingList();
virtual void beginConsuming();
virtual void consume(const Term& term);
virtual void doneConsuming();
virtual void doneConsumingList();
private:
void passLastIdeal();
void canonicalizeIdeal(Ideal& ideal);
size_t _varCount;
bool _storingList;
vector<Ideal*> _ideals;
ElementDeleter<vector<Ideal*> > _idealsDeleter;
unique_ptr<TermConsumer> _consumer;
TermTranslator* _translator;
};
#endif
ElementDeleter.h
Ideal.h
TermConsumer.h
CanonicalTermConsumer::_storingList
bool _storingList
Definition CanonicalTermConsumer.h:67
CanonicalTermConsumer::canonicalizeIdeal
void canonicalizeIdeal(Ideal &ideal)
Definition CanonicalTermConsumer.cpp:113
CanonicalTermConsumer::_consumer
unique_ptr< TermConsumer > _consumer
Definition CanonicalTermConsumer.h:70
CanonicalTermConsumer::consume
virtual void consume(const Term &term)
Consume a term.
Definition CanonicalTermConsumer.cpp:54
CanonicalTermConsumer::beginConsumingList
virtual void beginConsumingList()
This method is not required to be called.
Definition CanonicalTermConsumer.cpp:40
CanonicalTermConsumer::CanonicalTermConsumer
CanonicalTermConsumer(unique_ptr< TermConsumer > consumer, size_t varCount, TermTranslator *translator=0)
The translator, if non-null, is used to identify exponents that map to zero, which influences the sor...
Definition CanonicalTermConsumer.cpp:24
CanonicalTermConsumer::_translator
TermTranslator * _translator
Definition CanonicalTermConsumer.h:71
CanonicalTermConsumer::doneConsuming
virtual void doneConsuming()
Must be called once after each time beginConsuming has been called.
Definition CanonicalTermConsumer.cpp:61
CanonicalTermConsumer::beginConsuming
virtual void beginConsuming()
Tell the consumer to begin consuming an ideal.
Definition CanonicalTermConsumer.cpp:47
CanonicalTermConsumer::_idealsDeleter
ElementDeleter< vector< Ideal * > > _idealsDeleter
Definition CanonicalTermConsumer.h:69
CanonicalTermConsumer::passLastIdeal
void passLastIdeal()
Definition CanonicalTermConsumer.cpp:92
CanonicalTermConsumer::_ideals
vector< Ideal * > _ideals
Definition CanonicalTermConsumer.h:68
CanonicalTermConsumer::_varCount
size_t _varCount
Definition CanonicalTermConsumer.h:66
CanonicalTermConsumer::consumeRing
virtual void consumeRing(const VarNames &names)
Passes on the call immediately.
Definition CanonicalTermConsumer.cpp:36
CanonicalTermConsumer::doneConsumingList
virtual void doneConsumingList()
Must be called once after each time beginConsumingList has been called.
Definition CanonicalTermConsumer.cpp:69
ElementDeleter
Definition ElementDeleter.h:50
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
TermConsumer
This class is used to transfer terms one at a time from one part of the program to another,...
Definition TermConsumer.h:36
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition TermTranslator.h:41
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40