Frobby  0.9.5
PivotStrategy.h
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2011 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 PIVOT_EULER_STRATEGY_GUARD
18 #define PIVOT_EULER_STRATEGY_GUARD
19 
20 #include <vector>
21 #include <ostream>
22 #include <string>
23 
24 class EulerState;
25 class PivotEulerAlg;
26 
29 public:
30  virtual ~PivotStrategy() {}
31 
35  virtual EulerState* doPivot(EulerState& state, const size_t* divCounts) = 0;
36 
38  virtual void getName(ostream& out) const = 0;
39 
41  virtual void computationCompleted(const PivotEulerAlg& alg) = 0;
42 
44  virtual bool shouldTranspose(const EulerState& state) const = 0;
45 
46  protected:
48 
49  private:
50  PivotStrategy(const PivotStrategy&); // not available
51  void operator=(const PivotStrategy&); // not available
52 };
53 
54 auto_ptr<PivotStrategy> newDefaultPivotStrategy();
55 
56 auto_ptr<PivotStrategy> newStdPivotStrategy(const string& name);
57 auto_ptr<PivotStrategy> newGenPivotStrategy(const string& name);
58 auto_ptr<PivotStrategy> newHybridPivotStrategy
59  (auto_ptr<PivotStrategy> stdStrat, auto_ptr<PivotStrategy> genStrat);
60 auto_ptr<PivotStrategy> newDebugPivotStrategy(auto_ptr<PivotStrategy> strat,
61  FILE* out);
62 auto_ptr<PivotStrategy> newStatisticsPivotStrategy
63 (auto_ptr<PivotStrategy> strat, FILE* out);
64 
65 #endif
auto_ptr< PivotStrategy > newStdPivotStrategy(const string &name)
auto_ptr< PivotStrategy > newGenPivotStrategy(const string &name)
auto_ptr< PivotStrategy > newStatisticsPivotStrategy(auto_ptr< PivotStrategy > strat, FILE *out)
auto_ptr< PivotStrategy > newDefaultPivotStrategy()
auto_ptr< PivotStrategy > newDebugPivotStrategy(auto_ptr< PivotStrategy > strat, FILE *out)
auto_ptr< PivotStrategy > newHybridPivotStrategy(auto_ptr< PivotStrategy > stdStrat, auto_ptr< PivotStrategy > genStrat)
A pivot selection strategy for the Euler algorithm.
Definition: PivotStrategy.h:28
void operator=(const PivotStrategy &)
virtual EulerState * doPivot(EulerState &state, const size_t *divCounts)=0
Split state.
virtual ~PivotStrategy()
Definition: PivotStrategy.h:30
virtual bool shouldTranspose(const EulerState &state) const =0
Returns true if transposing state is adviced.
virtual void computationCompleted(const PivotEulerAlg &alg)=0
Call this function once when computation is complete.
PivotStrategy(const PivotStrategy &)
virtual void getName(ostream &out) const =0
Prints the name of the strategy to out.