Frobby
0.10.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
HilbertIndependenceConsumer.h
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
28
class
IndependenceSplitter
;
29
class
HilbertStrategy
;
30
31
class
HilbertIndependenceConsumer :
public
CoefTermConsumer
,
public
Task
{
32
public
:
33
HilbertIndependenceConsumer(
HilbertStrategy
* strategy);
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
44
CoefTermConsumer
* getLeftConsumer();
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
51
CoefTermConsumer
* getRightConsumer();
52
53
const
Projection
& getLeftProjection()
const
;
54
55
const
Projection
& getRightProjection()
const
;
56
57
private
:
58
class
RightConsumer :
public
CoefTermConsumer
{
59
public
:
60
RightConsumer(HilbertIndependenceConsumer* parent);
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
:
68
HilbertIndependenceConsumer* _parent;
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
75
Term
_tmpTerm;
76
mpz_class _tmpCoef;
77
78
CoefTermConsumer
* _parent;
79
Projection
_leftProjection;
80
Projection
_rightProjection;
81
82
Ideal
_rightTerms;
83
vector<mpz_class> _rightCoefs;
84
85
RightConsumer _rightConsumer;
86
87
HilbertStrategy
* _strategy;
88
};
89
90
#endif
CoefTermConsumer
Definition
CoefTermConsumer.h:24
HilbertIndependenceConsumer::run
virtual void run(TaskEngine &engine)
Definition
HilbertIndependenceConsumer.cpp:56
HilbertIndependenceConsumer::dispose
virtual void dispose()
Definition
HilbertIndependenceConsumer.cpp:51
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
Definition
TaskEngine.h:40
Task
Definition
Task.h:27
Term
Definition
Term.h:49
VarNames
Definition
VarNames.h:38
Generated by
1.17.0