Frobby  0.9.5
MsmStrategy.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 MSM_STRATEGY_GUARD
18 #define MSM_STRATEGY_GUARD
19 
20 #include "SliceStrategyCommon.h"
21 #include <string>
22 #include "TermConsumer.h"
23 #include <vector>
24 #include "SplitStrategy.h"
25 #include "IndependenceSplitter.h"
26 
27 class MsmSlice;
28 class Term;
29 class TermTranslator;
30 class Projection;
31 class Ideal;
32 class TermGrader;
34 class SliceEvent;
35 class TermConsumer;
36 
38  public:
39  MsmStrategy(TermConsumer* consumer, const SplitStrategy* splitStrategy);
40  MsmStrategy(TermConsumer* consumer, const SplitStrategy* splitStrategy,
41  const Ideal& initialSubtract);
42 
43  virtual void run(const Ideal& ideal);
44 
45  virtual bool processSlice(TaskEngine& tasks, auto_ptr<Slice> slice);
46 
47  protected:
48  virtual void getPivot(Term& pivot, Slice& slice);
49  virtual void getPivot(Term& pivot, Slice& slice, const TermGrader& grader);
50 
51  private:
52  auto_ptr<MsmSlice> newMsmSlice();
53  virtual auto_ptr<Slice> allocateSlice();
54  virtual bool debugIsValidSlice(Slice* slice);
55 
56  void labelSplit(auto_ptr<Slice> slice);
57 
58  void independenceSplit(auto_ptr<Slice> slice);
59 
60  size_t getLabelSplitVariable(const Slice& slice);
61 
64 
65  auto_ptr<Ideal> _initialSubtract;
66 };
67 
68 #endif
Represents a monomial ideal with int exponents.
Definition: Ideal.h:27
Invariant: either the slice is a trivial base case, or removeDoubleLcm returns false.
Definition: MsmSlice.h:33
auto_ptr< MsmSlice > newMsmSlice()
Definition: MsmStrategy.cpp:88
virtual bool debugIsValidSlice(Slice *slice)
Check that this slice is valid for use with this strategy.
Definition: MsmStrategy.cpp:98
void independenceSplit(auto_ptr< Slice > slice)
IndependenceSplitter _indep
Definition: MsmStrategy.h:62
TermConsumer * _consumer
Definition: MsmStrategy.h:63
virtual bool processSlice(TaskEngine &tasks, auto_ptr< Slice > slice)
Process the parameter slice.
Definition: MsmStrategy.cpp:68
virtual void getPivot(Term &pivot, Slice &slice)
Used by pivotSplit to obtain a pivot.
void labelSplit(auto_ptr< Slice > slice)
virtual void run(const Ideal &ideal)
Run the Slice algorithm.
Definition: MsmStrategy.cpp:45
MsmStrategy(TermConsumer *consumer, const SplitStrategy *splitStrategy)
Definition: MsmStrategy.cpp:28
virtual auto_ptr< Slice > allocateSlice()
Directly allocate a slice of the correct type using new.
Definition: MsmStrategy.cpp:94
auto_ptr< Ideal > _initialSubtract
Definition: MsmStrategy.h:65
size_t getLabelSplitVariable(const Slice &slice)
This class adds code to the SliceStrategy base class that is useful for derived classes.
This class represents a slice, which is the central data structure of the Slice Algorithm.
Definition: Slice.h:77
A SplitStrategy is an implementation of a split selection strategy for the Slice Algorithm.
Definition: SplitStrategy.h:30
TaskEngine handles a list of tasks that are to be carried out.
Definition: TaskEngine.h:40
This class is used to transfer terms one at a time from one part of the program to another,...
Definition: TermConsumer.h:36
A TermGrader assigns a value, the degree, to each monomial.
Definition: TermGrader.h:27
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Term represents a product of variables which does not include a coefficient.
Definition: Term.h:49