HilbertBasecase.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef HILBERT_BASECASE_GUARD
#define HILBERT_BASECASE_GUARD
class Ideal;
#include "Term.h"
#include "ElementDeleter.h"
#include <vector>
class HilbertBasecase {
public:
HilbertBasecase();
~HilbertBasecase();
// Clears ideal.
void computeCoefficient(Ideal& ideal);
const mpz_class& getLastCoefficient();
private:
struct Entry {
bool negate;
size_t extraSupport;
Ideal* ideal;
};
vector<Entry> _todo;
void clearTodo();
bool stepComputation(Entry& entry, Entry& newEntry);
unique_ptr<Ideal> getNewIdeal();
void freeIdeal(unique_ptr<Ideal> ideal);
vector<Ideal*> _idealCache;
ElementDeleter<vector<Ideal*> > _idealCacheDeleter;
bool canSimplify(size_t var, const Ideal& ideal, const Term& counts);
size_t eliminate1Counts(Ideal& ideal, Term& counts, bool& negate);
mpz_class _sum;
Term _term;
size_t _stepsPerformed;
};
#endif
ElementDeleter.h
Term.h
ElementDeleter
Definition ElementDeleter.h:50
HilbertBasecase::~HilbertBasecase
~HilbertBasecase()
Definition HilbertBasecase.cpp:29
HilbertBasecase::getNewIdeal
unique_ptr< Ideal > getNewIdeal()
Definition HilbertBasecase.cpp:275
HilbertBasecase::canSimplify
bool canSimplify(size_t var, const Ideal &ideal, const Term &counts)
Definition HilbertBasecase.cpp:194
HilbertBasecase::_idealCache
vector< Ideal * > _idealCache
Definition HilbertBasecase.h:50
HilbertBasecase::computeCoefficient
void computeCoefficient(Ideal &ideal)
Definition HilbertBasecase.cpp:131
HilbertBasecase::HilbertBasecase
HilbertBasecase()
Definition HilbertBasecase.cpp:24
HilbertBasecase::_sum
mpz_class _sum
Definition HilbertBasecase.h:56
HilbertBasecase::_stepsPerformed
size_t _stepsPerformed
Definition HilbertBasecase.h:58
HilbertBasecase::stepComputation
bool stepComputation(Entry &entry, Entry &newEntry)
Definition HilbertBasecase.cpp:42
HilbertBasecase::_term
Term _term
Definition HilbertBasecase.h:57
HilbertBasecase::eliminate1Counts
size_t eliminate1Counts(Ideal &ideal, Term &counts, bool &negate)
Definition HilbertBasecase.cpp:223
HilbertBasecase::clearTodo
void clearTodo()
HilbertBasecase::freeIdeal
void freeIdeal(unique_ptr< Ideal > ideal)
Definition HilbertBasecase.cpp:285
HilbertBasecase::_todo
vector< Entry > _todo
Definition HilbertBasecase.h:43
HilbertBasecase::getLastCoefficient
const mpz_class & getLastCoefficient()
Definition HilbertBasecase.cpp:190
HilbertBasecase::_idealCacheDeleter
ElementDeleter< vector< Ideal * > > _idealCacheDeleter
Definition HilbertBasecase.h:51
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
HilbertBasecase::Entry
Definition HilbertBasecase.h:38
HilbertBasecase::Entry::ideal
Ideal * ideal
Definition HilbertBasecase.h:41
HilbertBasecase::Entry::negate
bool negate
Definition HilbertBasecase.h:39
HilbertBasecase::Entry::extraSupport
size_t extraSupport
Definition HilbertBasecase.h:40