Frobby
0.10.0
Toggle main menu visibility
Loading...
Searching...
No Matches
src
InputConsumer.h
1
/* Frobby: Software for monomial ideal computations.
2
Copyright (C) 2011 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 INPUT_CONSUMER_GUARD
18
#define INPUT_CONSUMER_GUARD
19
20
#include "BigIdeal.h"
21
#include "SquareFreeIdeal.h"
22
#include "VarNames.h"
23
#include "ElementDeleter.h"
24
#include <vector>
25
#include <list>
26
#include <string>
27
28
class
Scanner
;
29
30
class
InputConsumer {
31
public
:
32
InputConsumer();
33
34
void
consumeRing(
const
VarNames
& names);
35
36
void
requireSquareFree();
37
39
void
beginIdeal
();
40
44
void
hintGenCount
(
size_t
hintGenCount
);
45
47
void
beginTerm
();
48
50
size_t
consumeVar
(
Scanner
& in);
51
54
size_t
consumeVarNumber
(
Scanner
& in);
55
57
void
consumeVarExponentOne
(
size_t
var,
const
Scanner
& in);
58
62
void
consumeVarExponent
(
size_t
var,
Scanner
& in);
63
65
void
endTerm
();
66
68
void
consumeTermProductNotation
(
Scanner
& in);
69
71
void
endIdeal
();
72
74
bool
empty
()
const
{
return
_ideals.empty();}
75
77
80
void
releaseIdeal
(unique_ptr<SquareFreeIdeal>& sqf, unique_ptr<BigIdeal>& big);
81
84
unique_ptr<BigIdeal>
releaseBigIdeal
();
85
88
unique_ptr<SquareFreeIdeal>
releaseSquareFreeIdeal
();
89
91
const
VarNames
&
getRing
()
const
{
return
_names;}
92
93
private
:
94
struct
Entry {
95
unique_ptr<BigIdeal> _big;
96
unique_ptr<SquareFreeIdeal> _sqf;
97
};
98
void
releaseIdeal
(Entry& e);
99
100
void
errorVariableAppearsTwice(
const
Scanner& in,
size_t
var);
101
void
idealNotSquareFree();
102
static
void
toBigIdeal
103
(unique_ptr<SquareFreeIdeal>& sqf, unique_ptr<BigIdeal>& big);
104
105
string
_tmpString;
106
VarNames _names;
107
unique_ptr<BigIdeal> _bigIdeal;
108
unique_ptr<SquareFreeIdeal> _sqfIdeal;
109
vector<string> _term;
110
111
std::list<Entry*> _ideals;
112
ElementDeleter<std::list<Entry*> > _idealsDeleter;
113
bool
_inIdeal;
114
bool
_requireSquareFree;
115
};
116
117
#endif
InputConsumer::releaseIdeal
void releaseIdeal(unique_ptr< SquareFreeIdeal > &sqf, unique_ptr< BigIdeal > &big)
Definition
InputConsumer.cpp:200
InputConsumer::empty
bool empty() const
Definition
InputConsumer.h:74
InputConsumer::consumeVarNumber
size_t consumeVarNumber(Scanner &in)
Definition
InputConsumer.cpp:76
InputConsumer::releaseBigIdeal
unique_ptr< BigIdeal > releaseBigIdeal()
Definition
InputConsumer.cpp:209
InputConsumer::beginTerm
void beginTerm()
Definition
InputConsumer.cpp:62
InputConsumer::getRing
const VarNames & getRing() const
Definition
InputConsumer.h:91
InputConsumer::beginIdeal
void beginIdeal()
Definition
InputConsumer.cpp:50
InputConsumer::consumeVar
size_t consumeVar(Scanner &in)
Definition
InputConsumer.cpp:90
InputConsumer::consumeTermProductNotation
void consumeTermProductNotation(Scanner &in)
Definition
InputConsumer.cpp:148
InputConsumer::releaseSquareFreeIdeal
unique_ptr< SquareFreeIdeal > releaseSquareFreeIdeal()
Definition
InputConsumer.cpp:218
InputConsumer::consumeVarExponent
void consumeVarExponent(size_t var, Scanner &in)
Definition
InputConsumer.cpp:122
InputConsumer::hintGenCount
void hintGenCount(size_t hintGenCount)
Definition
InputConsumer.cpp:57
InputConsumer::consumeVarExponentOne
void consumeVarExponentOne(size_t var, const Scanner &in)
Definition
InputConsumer.cpp:102
InputConsumer::endIdeal
void endIdeal()
Definition
InputConsumer.cpp:191
InputConsumer::endTerm
void endTerm()
Definition
InputConsumer.cpp:164
Scanner
Definition
Scanner.h:50
VarNames
Definition
VarNames.h:38
Generated by
1.17.0