Frobby  0.9.5
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
RightConsumer(HilbertIndependenceConsumer *parent)
virtual void consume(const mpz_class &coef, const Term &term)
virtual void consumeRing(const VarNames &names)
const Projection & getRightProjection() const
virtual void consumeRight(const mpz_class &coef, const Term &term)
virtual void run(TaskEngine &engine)
Does whatever work this task represents.
void reset(CoefTermConsumer *parent, IndependenceSplitter &splitter, size_t varCount)
const Projection & getLeftProjection() const
virtual void consumeLeft(const mpz_class &leftCoef, const Term &leftTerm)
virtual void dispose()
Called when the task is no longer used but run has not and will not be called.
HilbertIndependenceConsumer(HilbertStrategy *strategy)
virtual void consume(const mpz_class &coef, const Term &term)
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
TaskEngine handles a list of tasks that are to be carried out.
Definition: TaskEngine.h:40
A Task object represents a unit of work that is performed when the method run() is called.
Definition: Task.h:27
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40