IdealConsolidator.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 IDEAL_CONSOLIDATOR_GUARD
#define IDEAL_CONSOLIDATOR_GUARD
#include "BigTermConsumer.h"
#include "VarNames.h"
#include "BigIdeal.h"
#include <vector>
// This consumer forwards everything it consumes to the wrapped
// consumer. When it consumes an ideal one term at a time, it will
// store the ideal and pass it along as one big ideal.
class IdealConsolidator : public BigTermConsumer {
public:
IdealConsolidator(unique_ptr<BigTermConsumer> consumer);
virtual void beginConsumingList();
virtual void consumeRing(const VarNames& names);
virtual void beginConsuming();
virtual void consume(const Term& term);
virtual void consume(const Term& term, const TermTranslator& translator);
virtual void consume(const vector<mpz_class>& term);
virtual void doneConsuming();
virtual void consume(const BigIdeal& ideal);
virtual void doneConsumingList();
private:
const unique_ptr<BigTermConsumer> _consumer;
BigIdeal _ideal;
VarNames _names;
bool _inList;
bool _inIdeal;
vector<mpz_class> _tmp;
};
#endif
BigIdeal.h
BigTermConsumer.h
VarNames.h
BigIdeal
Definition BigIdeal.h:27
BigTermConsumer
Definition BigTermConsumer.h:29
IdealConsolidator::_consumer
const unique_ptr< BigTermConsumer > _consumer
Definition IdealConsolidator.h:47
IdealConsolidator::_ideal
BigIdeal _ideal
Definition IdealConsolidator.h:48
IdealConsolidator::_names
VarNames _names
Definition IdealConsolidator.h:49
IdealConsolidator::_inList
bool _inList
Definition IdealConsolidator.h:50
IdealConsolidator::consumeRing
virtual void consumeRing(const VarNames &names)
Tell the consumer which ring is being used.
Definition IdealConsolidator.cpp:29
IdealConsolidator::IdealConsolidator
IdealConsolidator(unique_ptr< BigTermConsumer > consumer)
Definition IdealConsolidator.cpp:23
IdealConsolidator::consume
virtual void consume(const Term &term)
Consume a term.
Definition IdealConsolidator.cpp:52
IdealConsolidator::doneConsumingList
virtual void doneConsumingList()
Must be called once after each time beginConsumingList has been called.
Definition IdealConsolidator.cpp:84
IdealConsolidator::beginConsuming
virtual void beginConsuming()
Tell the consumer to begin consuming an ideal.
Definition IdealConsolidator.cpp:47
IdealConsolidator::_inIdeal
bool _inIdeal
Definition IdealConsolidator.h:51
IdealConsolidator::_tmp
vector< mpz_class > _tmp
Definition IdealConsolidator.h:52
IdealConsolidator::beginConsumingList
virtual void beginConsumingList()
Tell the consumer that the ideals that are consumed until the next call to doneConsumingList are to b...
Definition IdealConsolidator.cpp:39
IdealConsolidator::doneConsuming
virtual void doneConsuming()
Must be called once after each time beginConsuming has been called.
Definition IdealConsolidator.cpp:76
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