Frobby 0.10.0
Loading...
Searching...
No Matches
HilbertBasecase.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_BASECASE_GUARD
18#define HILBERT_BASECASE_GUARD
19
20class Ideal;
21
22#include "Term.h"
23#include "ElementDeleter.h"
24
25#include <vector>
26
27class HilbertBasecase {
28 public:
29 HilbertBasecase();
30 ~HilbertBasecase();
31
32 // Clears ideal.
33 void computeCoefficient(Ideal& ideal);
34
35 const mpz_class& getLastCoefficient();
36
37 private:
38 struct Entry {
39 bool negate;
40 size_t extraSupport;
41 Ideal* ideal;
42 };
43 vector<Entry> _todo;
44 void clearTodo();
45
46 bool stepComputation(Entry& entry, Entry& newEntry);
47
48 unique_ptr<Ideal> getNewIdeal();
49 void freeIdeal(unique_ptr<Ideal> ideal);
50 vector<Ideal*> _idealCache;
51 ElementDeleter<vector<Ideal*> > _idealCacheDeleter;
52
53 bool canSimplify(size_t var, const Ideal& ideal, const Term& counts);
54 size_t eliminate1Counts(Ideal& ideal, Term& counts, bool& negate);
55
56 mpz_class _sum;
57 Term _term;
58 size_t _stepsPerformed;
59};
60
61#endif
Definition ElementDeleter.h:50
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Definition Term.h:49