Frobby  0.9.0
ScarfHilbertAlgorithm.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2010 University of Aarhus
3  Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see http://www.gnu.org/licenses/.
17 */
18 #ifndef SCARF_HILBERT_ALGORITHM_GUARD
19 #define SCARF_HILBERT_ALGORITHM_GUARD
20 
21 class Consumer;
22 class CoefTermConsumer;
23 class TermTranslator;
25 class ScarfParams;
26 class IdealOrderer;
27 class IdealTree;
28 
29 #include "Term.h"
30 #include "Ideal.h"
31 
33  public:
34  ScarfHilbertAlgorithm(const TermTranslator& translator,
35  const ScarfParams& params,
36  auto_ptr<IdealOrderer> enumerationOrder,
37  auto_ptr<IdealOrderer> deformationOrder);
39 
40  void runGeneric(const Ideal& ideal,
41  CoefBigTermConsumer& consumer,
42  bool univariate,
43  bool canonical);
44 
45  private:
46  struct State {
49  vector<Exponent*> face;
50  bool plus;
51  };
52  vector<State> _states;
53 
54  void enumerateScarfComplex(const Ideal& ideal,
55  CoefTermConsumer& consumer);
56  void initializeEnumeration(const Ideal& ideal,
57  size_t& activeStateCount);
58  bool doEnumerationStep(const Ideal& ideal,
59  const IdealTree& tree,
60  State& state,
61  State& nextState);
62  void doEnumerationBaseCase(const State& state,
63  CoefTermConsumer& consumer);
64 
67  const auto_ptr<IdealOrderer> _enumerationOrder;
68  const auto_ptr<IdealOrderer> _deformationOrder;
69 
70  size_t _totalStates;
71  size_t _totalFaces;
72 };
73 
74 #endif
ScarfHilbertAlgorithm::_deformationOrder
const auto_ptr< IdealOrderer > _deformationOrder
Definition: ScarfHilbertAlgorithm.h:68
CoefBigTermConsumer
Definition: CoefBigTermConsumer.h:29
ScarfHilbertAlgorithm
Definition: ScarfHilbertAlgorithm.h:32
Ideal::const_iterator
Cont::const_iterator const_iterator
Definition: Ideal.h:43
ScarfHilbertAlgorithm::_params
const ScarfParams & _params
Definition: ScarfHilbertAlgorithm.h:66
ScarfHilbertAlgorithm::~ScarfHilbertAlgorithm
~ScarfHilbertAlgorithm()
Definition: ScarfHilbertAlgorithm.cpp:107
IdealTree
Objects of this class represents a monomial ideal.
Definition: IdealTree.h:29
ScarfHilbertAlgorithm::_translator
const TermTranslator & _translator
Definition: ScarfHilbertAlgorithm.h:65
ScarfHilbertAlgorithm::_totalFaces
size_t _totalFaces
Definition: ScarfHilbertAlgorithm.h:71
ScarfHilbertAlgorithm::_enumerationOrder
const auto_ptr< IdealOrderer > _enumerationOrder
Definition: ScarfHilbertAlgorithm.h:67
ScarfHilbertAlgorithm::doEnumerationBaseCase
void doEnumerationBaseCase(const State &state, CoefTermConsumer &consumer)
Definition: ScarfHilbertAlgorithm.cpp:238
ScarfHilbertAlgorithm::runGeneric
void runGeneric(const Ideal &ideal, CoefBigTermConsumer &consumer, bool univariate, bool canonical)
Definition: ScarfHilbertAlgorithm.cpp:112
Term.h
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition: TermTranslator.h:41
Ideal.h
Term
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49
ScarfHilbertAlgorithm::State::pos
Ideal::const_iterator pos
Definition: ScarfHilbertAlgorithm.h:48
ScarfHilbertAlgorithm::ScarfHilbertAlgorithm
ScarfHilbertAlgorithm(const TermTranslator &translator, const ScarfParams &params, auto_ptr< IdealOrderer > enumerationOrder, auto_ptr< IdealOrderer > deformationOrder)
Definition: ScarfHilbertAlgorithm.cpp:93
CoefTermConsumer
Definition: CoefTermConsumer.h:24
ScarfHilbertAlgorithm::_states
vector< State > _states
Definition: ScarfHilbertAlgorithm.h:52
ScarfHilbertAlgorithm::initializeEnumeration
void initializeEnumeration(const Ideal &ideal, size_t &activeStateCount)
Definition: ScarfHilbertAlgorithm.cpp:141
ScarfHilbertAlgorithm::_totalStates
size_t _totalStates
Definition: ScarfHilbertAlgorithm.h:70
ScarfHilbertAlgorithm::doEnumerationStep
bool doEnumerationStep(const Ideal &ideal, const IdealTree &tree, State &state, State &nextState)
Definition: ScarfHilbertAlgorithm.cpp:174
ScarfHilbertAlgorithm::State::term
Term term
Definition: ScarfHilbertAlgorithm.h:47
IdealOrderer
Definition: IdealOrderer.h:23
Ideal
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
ScarfHilbertAlgorithm::State
Definition: ScarfHilbertAlgorithm.h:46
ScarfParams
Definition: ScarfParams.h:27
ScarfHilbertAlgorithm::State::plus
bool plus
Definition: ScarfHilbertAlgorithm.h:50
ScarfHilbertAlgorithm::enumerateScarfComplex
void enumerateScarfComplex(const Ideal &ideal, CoefTermConsumer &consumer)
Definition: ScarfHilbertAlgorithm.cpp:254
ScarfHilbertAlgorithm::State::face
vector< Exponent * > face
Definition: ScarfHilbertAlgorithm.h:49