ScarfHilbertAlgorithm.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2010 University of Aarhus
Contact Bjarke Hammersholt Roune for license information (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 SCARF_HILBERT_ALGORITHM_GUARD
#define SCARF_HILBERT_ALGORITHM_GUARD
class Consumer;
class CoefTermConsumer;
class TermTranslator;
class CoefBigTermConsumer;
class ScarfParams;
class IdealOrderer;
class IdealTree;
#include "Term.h"
#include "Ideal.h"
class ScarfHilbertAlgorithm {
public:
ScarfHilbertAlgorithm(const TermTranslator& translator,
const ScarfParams& params,
unique_ptr<IdealOrderer> enumerationOrder,
unique_ptr<IdealOrderer> deformationOrder);
~ScarfHilbertAlgorithm();
void runGeneric(const Ideal& ideal,
CoefBigTermConsumer& consumer,
bool univariate,
bool canonical);
private:
struct State {
Term term;
Ideal::const_iterator pos;
vector<Exponent*> face;
bool plus;
};
vector<State> _states;
void enumerateScarfComplex(const Ideal& ideal,
CoefTermConsumer& consumer);
void initializeEnumeration(const Ideal& ideal,
size_t& activeStateCount);
bool doEnumerationStep(const Ideal& ideal,
const IdealTree& tree,
State& state,
State& nextState);
void doEnumerationBaseCase(const State& state,
CoefTermConsumer& consumer);
const TermTranslator& _translator;
const ScarfParams& _params;
const unique_ptr<IdealOrderer> _enumerationOrder;
const unique_ptr<IdealOrderer> _deformationOrder;
size_t _totalStates;
size_t _totalFaces;
};
#endif
Ideal.h
Term.h
CoefBigTermConsumer
Definition CoefBigTermConsumer.h:29
CoefTermConsumer
Definition CoefTermConsumer.h:24
IdealOrderer
Definition IdealOrderer.h:23
IdealTree
Objects of this class represents a monomial ideal.
Definition IdealTree.h:29
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Ideal::const_iterator
Cont::const_iterator const_iterator
Definition Ideal.h:43
ScarfHilbertAlgorithm::enumerateScarfComplex
void enumerateScarfComplex(const Ideal &ideal, CoefTermConsumer &consumer)
Definition ScarfHilbertAlgorithm.cpp:254
ScarfHilbertAlgorithm::_totalStates
size_t _totalStates
Definition ScarfHilbertAlgorithm.h:70
ScarfHilbertAlgorithm::doEnumerationBaseCase
void doEnumerationBaseCase(const State &state, CoefTermConsumer &consumer)
Definition ScarfHilbertAlgorithm.cpp:238
ScarfHilbertAlgorithm::_params
const ScarfParams & _params
Definition ScarfHilbertAlgorithm.h:66
ScarfHilbertAlgorithm::doEnumerationStep
bool doEnumerationStep(const Ideal &ideal, const IdealTree &tree, State &state, State &nextState)
Definition ScarfHilbertAlgorithm.cpp:174
ScarfHilbertAlgorithm::runGeneric
void runGeneric(const Ideal &ideal, CoefBigTermConsumer &consumer, bool univariate, bool canonical)
Definition ScarfHilbertAlgorithm.cpp:112
ScarfHilbertAlgorithm::_translator
const TermTranslator & _translator
Definition ScarfHilbertAlgorithm.h:65
ScarfHilbertAlgorithm::_deformationOrder
const unique_ptr< IdealOrderer > _deformationOrder
Definition ScarfHilbertAlgorithm.h:68
ScarfHilbertAlgorithm::initializeEnumeration
void initializeEnumeration(const Ideal &ideal, size_t &activeStateCount)
Definition ScarfHilbertAlgorithm.cpp:141
ScarfHilbertAlgorithm::ScarfHilbertAlgorithm
ScarfHilbertAlgorithm(const TermTranslator &translator, const ScarfParams &params, unique_ptr< IdealOrderer > enumerationOrder, unique_ptr< IdealOrderer > deformationOrder)
Definition ScarfHilbertAlgorithm.cpp:93
ScarfHilbertAlgorithm::~ScarfHilbertAlgorithm
~ScarfHilbertAlgorithm()
Definition ScarfHilbertAlgorithm.cpp:107
ScarfHilbertAlgorithm::_states
vector< State > _states
Definition ScarfHilbertAlgorithm.h:52
ScarfHilbertAlgorithm::_enumerationOrder
const unique_ptr< IdealOrderer > _enumerationOrder
Definition ScarfHilbertAlgorithm.h:67
ScarfHilbertAlgorithm::_totalFaces
size_t _totalFaces
Definition ScarfHilbertAlgorithm.h:71
ScarfParams
Definition ScarfParams.h:27
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition TermTranslator.h:41
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
ScarfHilbertAlgorithm::State
Definition ScarfHilbertAlgorithm.h:46
ScarfHilbertAlgorithm::State::face
vector< Exponent * > face
Definition ScarfHilbertAlgorithm.h:49
ScarfHilbertAlgorithm::State::plus
bool plus
Definition ScarfHilbertAlgorithm.h:50
ScarfHilbertAlgorithm::State::term
Term term
Definition ScarfHilbertAlgorithm.h:47
ScarfHilbertAlgorithm::State::pos
Ideal::const_iterator pos
Definition ScarfHilbertAlgorithm.h:48