HilbertIndependenceConsumer.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 HILBERT_INDEPENDENCE_CONSUMER
#define HILBERT_INDEPENDENCE_CONSUMER
#include "Projection.h"
#include "Term.h"
#include "Ideal.h"
#include "CoefTermConsumer.h"
#include "Task.h"
#include <vector>
class IndependenceSplitter;
class HilbertStrategy;
class HilbertIndependenceConsumer : public CoefTermConsumer, public Task {
public:
HilbertIndependenceConsumer(HilbertStrategy* strategy);
void reset(CoefTermConsumer* parent,
IndependenceSplitter& splitter,
size_t varCount);
void clear();
virtual void run(TaskEngine& engine);
virtual void dispose();
CoefTermConsumer* getLeftConsumer();
virtual void consumeRing(const VarNames& names); // Does nothing.
virtual void beginConsuming(); // Does nothing.
virtual void consume(const mpz_class& coef, const Term& term);
virtual void doneConsuming(); // Does nothing.
CoefTermConsumer* getRightConsumer();
const Projection& getLeftProjection() const;
const Projection& getRightProjection() const;
private:
class RightConsumer : public CoefTermConsumer {
public:
RightConsumer(HilbertIndependenceConsumer* parent);
virtual void consumeRing(const VarNames& names); // Does nothing.
virtual void beginConsuming(); // Does nothing.
virtual void consume(const mpz_class& coef, const Term& term);
virtual void doneConsuming(); // Does nothing.
private:
HilbertIndependenceConsumer* _parent;
};
virtual void consumeLeft(const mpz_class& leftCoef, const Term& leftTerm);
virtual void consumeRight(const mpz_class& coef, const Term& term);
Term _tmpTerm;
mpz_class _tmpCoef;
CoefTermConsumer* _parent;
Projection _leftProjection;
Projection _rightProjection;
Ideal _rightTerms;
vector<mpz_class> _rightCoefs;
RightConsumer _rightConsumer;
HilbertStrategy* _strategy;
};
#endif
CoefTermConsumer.h
Ideal.h
Projection.h
Task.h
Term.h
CoefTermConsumer
Definition CoefTermConsumer.h:24
HilbertIndependenceConsumer::RightConsumer
Definition HilbertIndependenceConsumer.h:58
HilbertIndependenceConsumer::RightConsumer::doneConsuming
virtual void doneConsuming()
Definition HilbertIndependenceConsumer.cpp:113
HilbertIndependenceConsumer::RightConsumer::_parent
HilbertIndependenceConsumer * _parent
Definition HilbertIndependenceConsumer.h:68
HilbertIndependenceConsumer::RightConsumer::beginConsuming
virtual void beginConsuming()
Definition HilbertIndependenceConsumer.cpp:105
HilbertIndependenceConsumer::RightConsumer::RightConsumer
RightConsumer(HilbertIndependenceConsumer *parent)
Definition HilbertIndependenceConsumer.cpp:97
HilbertIndependenceConsumer::RightConsumer::consumeRing
virtual void consumeRing(const VarNames &names)
Definition HilbertIndependenceConsumer.cpp:102
HilbertIndependenceConsumer::RightConsumer::consume
virtual void consume(const mpz_class &coef, const Term &term)
Definition HilbertIndependenceConsumer.cpp:109
HilbertIndependenceConsumer::consumeRing
virtual void consumeRing(const VarNames &names)
Definition HilbertIndependenceConsumer.cpp:65
HilbertIndependenceConsumer::_rightTerms
Ideal _rightTerms
Definition HilbertIndependenceConsumer.h:82
HilbertIndependenceConsumer::getRightConsumer
CoefTermConsumer * getRightConsumer()
Definition HilbertIndependenceConsumer.cpp:81
HilbertIndependenceConsumer::getRightProjection
const Projection & getRightProjection() const
Definition HilbertIndependenceConsumer.cpp:91
HilbertIndependenceConsumer::_strategy
HilbertStrategy * _strategy
Definition HilbertIndependenceConsumer.h:87
HilbertIndependenceConsumer::_tmpTerm
Term _tmpTerm
Definition HilbertIndependenceConsumer.h:75
HilbertIndependenceConsumer::_rightConsumer
RightConsumer _rightConsumer
Definition HilbertIndependenceConsumer.h:85
HilbertIndependenceConsumer::consumeRight
virtual void consumeRight(const mpz_class &coef, const Term &term)
Definition HilbertIndependenceConsumer.cpp:138
HilbertIndependenceConsumer::run
virtual void run(TaskEngine &engine)
Does whatever work this task represents.
Definition HilbertIndependenceConsumer.cpp:56
HilbertIndependenceConsumer::reset
void reset(CoefTermConsumer *parent, IndependenceSplitter &splitter, size_t varCount)
Definition HilbertIndependenceConsumer.cpp:31
HilbertIndependenceConsumer::_rightCoefs
vector< mpz_class > _rightCoefs
Definition HilbertIndependenceConsumer.h:83
HilbertIndependenceConsumer::_leftProjection
Projection _leftProjection
Definition HilbertIndependenceConsumer.h:79
HilbertIndependenceConsumer::doneConsuming
virtual void doneConsuming()
Definition HilbertIndependenceConsumer.cpp:71
HilbertIndependenceConsumer::beginConsuming
virtual void beginConsuming()
Definition HilbertIndependenceConsumer.cpp:68
HilbertIndependenceConsumer::getLeftProjection
const Projection & getLeftProjection() const
Definition HilbertIndependenceConsumer.cpp:86
HilbertIndependenceConsumer::consumeLeft
virtual void consumeLeft(const mpz_class &leftCoef, const Term &leftTerm)
Definition HilbertIndependenceConsumer.cpp:116
HilbertIndependenceConsumer::dispose
virtual void dispose()
Called when the task is no longer used but run has not and will not be called.
Definition HilbertIndependenceConsumer.cpp:51
HilbertIndependenceConsumer::getLeftConsumer
CoefTermConsumer * getLeftConsumer()
Definition HilbertIndependenceConsumer.cpp:60
HilbertIndependenceConsumer::_parent
CoefTermConsumer * _parent
Definition HilbertIndependenceConsumer.h:78
HilbertIndependenceConsumer::HilbertIndependenceConsumer
HilbertIndependenceConsumer(HilbertStrategy *strategy)
Definition HilbertIndependenceConsumer.cpp:24
HilbertIndependenceConsumer::consume
virtual void consume(const mpz_class &coef, const Term &term)
Definition HilbertIndependenceConsumer.cpp:74
HilbertIndependenceConsumer::_tmpCoef
mpz_class _tmpCoef
Definition HilbertIndependenceConsumer.h:76
HilbertIndependenceConsumer::_rightProjection
Projection _rightProjection
Definition HilbertIndependenceConsumer.h:80
HilbertIndependenceConsumer::clear
void clear()
Definition HilbertIndependenceConsumer.cpp:45
HilbertStrategy
Definition HilbertStrategy.h:33
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
IndependenceSplitter
Definition IndependenceSplitter.h:29
Projection
Definition Projection.h:29
TaskEngine
TaskEngine handles a list of tasks that are to be carried out.
Definition TaskEngine.h:40
Task
A Task object represents a unit of work that is performed when the method run() is called.
Definition Task.h:27
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