Frobby 0.9.5
HilbertBasecase.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_BASECASE_GUARD
18#define HILBERT_BASECASE_GUARD
19
20class Ideal;
21
22#include "Term.h"
23#include "ElementDeleter.h"
24
25#include <vector>
26
28 public:
31
32 // Clears ideal.
33 void computeCoefficient(Ideal& ideal);
34
35 const mpz_class& getLastCoefficient();
36
37 private:
38 struct Entry {
39 bool negate;
42 };
43 vector<Entry> _todo;
44 void clearTodo();
45
46 bool stepComputation(Entry& entry, Entry& newEntry);
47
48 auto_ptr<Ideal> getNewIdeal();
49 void freeIdeal(auto_ptr<Ideal> ideal);
50 vector<Ideal*> _idealCache;
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;
59};
60
61#endif
bool canSimplify(size_t var, const Ideal &ideal, const Term &counts)
vector< Ideal * > _idealCache
void computeCoefficient(Ideal &ideal)
void freeIdeal(auto_ptr< Ideal > ideal)
bool stepComputation(Entry &entry, Entry &newEntry)
size_t eliminate1Counts(Ideal &ideal, Term &counts, bool &negate)
vector< Entry > _todo
auto_ptr< Ideal > getNewIdeal()
const mpz_class & getLastCoefficient()
ElementDeleter< vector< Ideal * > > _idealCacheDeleter
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49