Frobby 0.10.0
Loading...
Searching...
No Matches
ScarfHilbertAlgorithm.h
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2010 University of Aarhus
3 Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17*/
18#ifndef SCARF_HILBERT_ALGORITHM_GUARD
19#define SCARF_HILBERT_ALGORITHM_GUARD
20
21class Consumer;
23class TermTranslator;
25class ScarfParams;
26class IdealOrderer;
27class IdealTree;
28
29#include "Term.h"
30#include "Ideal.h"
31
32class ScarfHilbertAlgorithm {
33 public:
34 ScarfHilbertAlgorithm(const TermTranslator& translator,
35 const ScarfParams& params,
36 unique_ptr<IdealOrderer> enumerationOrder,
37 unique_ptr<IdealOrderer> deformationOrder);
38 ~ScarfHilbertAlgorithm();
39
40 void runGeneric(const Ideal& ideal,
41 CoefBigTermConsumer& consumer,
42 bool univariate,
43 bool canonical);
44
45 private:
46 struct State {
47 Term term;
48 Ideal::const_iterator pos;
49 vector<Exponent*> face;
50 bool plus;
51 };
52 vector<State> _states;
53
54 void enumerateScarfComplex(const Ideal& ideal,
55 CoefTermConsumer& consumer);
56 void initializeEnumeration(const Ideal& ideal,
57 size_t& activeStateCount);
58 bool doEnumerationStep(const Ideal& ideal,
59 const IdealTree& tree,
60 State& state,
61 State& nextState);
62 void doEnumerationBaseCase(const State& state,
63 CoefTermConsumer& consumer);
64
65 const TermTranslator& _translator;
66 const ScarfParams& _params;
67 const unique_ptr<IdealOrderer> _enumerationOrder;
68 const unique_ptr<IdealOrderer> _deformationOrder;
69
70 size_t _totalStates;
71 size_t _totalFaces;
72};
73
74#endif
Definition CoefBigTermConsumer.h:29
Definition CoefTermConsumer.h:24
Definition IdealOrderer.h:23
Definition IdealTree.h:29
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Definition ScarfParams.h:27
Definition TermTranslator.h:41
Definition Term.h:49