Frobby  0.9.1
HilbertIndependenceConsumer.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see http://www.gnu.org/licenses/.
16 */
17 #ifndef HILBERT_INDEPENDENCE_CONSUMER
18 #define HILBERT_INDEPENDENCE_CONSUMER
19 
20 #include "Projection.h"
21 #include "Term.h"
22 #include "Ideal.h"
23 #include "CoefTermConsumer.h"
24 #include "Task.h"
25 
26 #include <vector>
27 
29 class HilbertStrategy;
30 
32 public:
34 
35  void reset(CoefTermConsumer* parent,
36  IndependenceSplitter& splitter,
37  size_t varCount);
38 
39  void clear();
40 
41  virtual void run(TaskEngine& engine);
42  virtual void dispose();
43 
45 
46  virtual void consumeRing(const VarNames& names); // Does nothing.
47  virtual void beginConsuming(); // Does nothing.
48  virtual void consume(const mpz_class& coef, const Term& term);
49  virtual void doneConsuming(); // Does nothing.
50 
52 
53  const Projection& getLeftProjection() const;
54 
55  const Projection& getRightProjection() const;
56 
57 private:
59  public:
61 
62  virtual void consumeRing(const VarNames& names); // Does nothing.
63  virtual void beginConsuming(); // Does nothing.
64  virtual void consume(const mpz_class& coef, const Term& term);
65  virtual void doneConsuming(); // Does nothing.
66 
67  private:
69  };
70 
71  virtual void consumeLeft(const mpz_class& leftCoef, const Term& leftTerm);
72 
73  virtual void consumeRight(const mpz_class& coef, const Term& term);
74 
76  mpz_class _tmpCoef;
77 
81 
83  vector<mpz_class> _rightCoefs;
84 
86 
88 };
89 
90 #endif
HilbertIndependenceConsumer::beginConsuming
virtual void beginConsuming()
Definition: HilbertIndependenceConsumer.cpp:68
HilbertIndependenceConsumer::_rightProjection
Projection _rightProjection
Definition: HilbertIndependenceConsumer.h:80
HilbertIndependenceConsumer::_parent
CoefTermConsumer * _parent
Definition: HilbertIndependenceConsumer.h:78
HilbertIndependenceConsumer::_rightConsumer
RightConsumer _rightConsumer
Definition: HilbertIndependenceConsumer.h:85
HilbertIndependenceConsumer::getLeftConsumer
CoefTermConsumer * getLeftConsumer()
Definition: HilbertIndependenceConsumer.cpp:60
Task.h
HilbertIndependenceConsumer::getRightConsumer
CoefTermConsumer * getRightConsumer()
Definition: HilbertIndependenceConsumer.cpp:81
HilbertIndependenceConsumer::RightConsumer::doneConsuming
virtual void doneConsuming()
Definition: HilbertIndependenceConsumer.cpp:113
HilbertIndependenceConsumer::RightConsumer::_parent
HilbertIndependenceConsumer * _parent
Definition: HilbertIndependenceConsumer.h:68
HilbertIndependenceConsumer::getRightProjection
const Projection & getRightProjection() const
Definition: HilbertIndependenceConsumer.cpp:91
HilbertIndependenceConsumer::_rightCoefs
vector< mpz_class > _rightCoefs
Definition: HilbertIndependenceConsumer.h:83
HilbertIndependenceConsumer::consume
virtual void consume(const mpz_class &coef, const Term &term)
Definition: HilbertIndependenceConsumer.cpp:74
CoefTermConsumer.h
HilbertIndependenceConsumer::_tmpTerm
Term _tmpTerm
Definition: HilbertIndependenceConsumer.h:75
Term.h
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
IndependenceSplitter
Definition: IndependenceSplitter.h:29
HilbertIndependenceConsumer::RightConsumer::RightConsumer
RightConsumer(HilbertIndependenceConsumer *parent)
Definition: HilbertIndependenceConsumer.cpp:97
HilbertIndependenceConsumer::clear
void clear()
Definition: HilbertIndependenceConsumer.cpp:45
TaskEngine
TaskEngine handles a list of tasks that are to be carried out.
Definition: TaskEngine.h:40
HilbertIndependenceConsumer
Definition: HilbertIndependenceConsumer.h:31
Ideal.h
HilbertIndependenceConsumer::reset
void reset(CoefTermConsumer *parent, IndependenceSplitter &splitter, size_t varCount)
Definition: HilbertIndependenceConsumer.cpp:31
Task
A Task object represents a unit of work that is performed when the method run() is called.
Definition: Task.h:27
HilbertIndependenceConsumer::consumeLeft
virtual void consumeLeft(const mpz_class &leftCoef, const Term &leftTerm)
Definition: HilbertIndependenceConsumer.cpp:116
Term
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49
CoefTermConsumer
Definition: CoefTermConsumer.h:24
HilbertStrategy
Definition: HilbertStrategy.h:33
HilbertIndependenceConsumer::_leftProjection
Projection _leftProjection
Definition: HilbertIndependenceConsumer.h:79
HilbertIndependenceConsumer::_strategy
HilbertStrategy * _strategy
Definition: HilbertIndependenceConsumer.h:87
HilbertIndependenceConsumer::RightConsumer
Definition: HilbertIndependenceConsumer.h:58
HilbertIndependenceConsumer::doneConsuming
virtual void doneConsuming()
Definition: HilbertIndependenceConsumer.cpp:71
HilbertIndependenceConsumer::HilbertIndependenceConsumer
HilbertIndependenceConsumer(HilbertStrategy *strategy)
Definition: HilbertIndependenceConsumer.cpp:24
HilbertIndependenceConsumer::_tmpCoef
mpz_class _tmpCoef
Definition: HilbertIndependenceConsumer.h:76
Ideal
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
Projection
Definition: Projection.h:29
VarNames
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40
HilbertIndependenceConsumer::RightConsumer::consumeRing
virtual void consumeRing(const VarNames &names)
Definition: HilbertIndependenceConsumer.cpp:102
HilbertIndependenceConsumer::RightConsumer::beginConsuming
virtual void beginConsuming()
Definition: HilbertIndependenceConsumer.cpp:105
HilbertIndependenceConsumer::_rightTerms
Ideal _rightTerms
Definition: HilbertIndependenceConsumer.h:82
Projection.h
HilbertIndependenceConsumer::RightConsumer::consume
virtual void consume(const mpz_class &coef, const Term &term)
Definition: HilbertIndependenceConsumer.cpp:109
HilbertIndependenceConsumer::getLeftProjection
const Projection & getLeftProjection() const
Definition: HilbertIndependenceConsumer.cpp:86
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::consumeRing
virtual void consumeRing(const VarNames &names)
Definition: HilbertIndependenceConsumer.cpp:65