Frobby  0.9.0
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 
20 class 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;
40  size_t extraSupport;
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
HilbertBasecase::HilbertBasecase
HilbertBasecase()
Definition: HilbertBasecase.cpp:24
HilbertBasecase::canSimplify
bool canSimplify(size_t var, const Ideal &ideal, const Term &counts)
Definition: HilbertBasecase.cpp:194
HilbertBasecase::clearTodo
void clearTodo()
HilbertBasecase::_stepsPerformed
size_t _stepsPerformed
Definition: HilbertBasecase.h:58
ElementDeleter
Definition: ElementDeleter.h:50
HilbertBasecase::_todo
vector< Entry > _todo
Definition: HilbertBasecase.h:43
HilbertBasecase::Entry
Definition: HilbertBasecase.h:38
HilbertBasecase::_idealCache
vector< Ideal * > _idealCache
Definition: HilbertBasecase.h:50
HilbertBasecase::getNewIdeal
auto_ptr< Ideal > getNewIdeal()
Definition: HilbertBasecase.cpp:275
Term.h
HilbertBasecase::Entry::ideal
Ideal * ideal
Definition: HilbertBasecase.h:41
HilbertBasecase::_idealCacheDeleter
ElementDeleter< vector< Ideal * > > _idealCacheDeleter
Definition: HilbertBasecase.h:51
HilbertBasecase::computeCoefficient
void computeCoefficient(Ideal &ideal)
Definition: HilbertBasecase.cpp:131
HilbertBasecase::getLastCoefficient
const mpz_class & getLastCoefficient()
Definition: HilbertBasecase.cpp:190
Term
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49
HilbertBasecase::_sum
mpz_class _sum
Definition: HilbertBasecase.h:56
HilbertBasecase::~HilbertBasecase
~HilbertBasecase()
Definition: HilbertBasecase.cpp:29
HilbertBasecase::stepComputation
bool stepComputation(Entry &entry, Entry &newEntry)
Definition: HilbertBasecase.cpp:42
HilbertBasecase::eliminate1Counts
size_t eliminate1Counts(Ideal &ideal, Term &counts, bool &negate)
Definition: HilbertBasecase.cpp:223
Ideal
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
HilbertBasecase::Entry::extraSupport
size_t extraSupport
Definition: HilbertBasecase.h:40
HilbertBasecase::_term
Term _term
Definition: HilbertBasecase.h:57
HilbertBasecase::freeIdeal
void freeIdeal(auto_ptr< Ideal > ideal)
Definition: HilbertBasecase.cpp:285
HilbertBasecase
Definition: HilbertBasecase.h:27
ElementDeleter.h
HilbertBasecase::Entry::negate
bool negate
Definition: HilbertBasecase.h:39