Frobby 0.9.5
SplitStrategy.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 SPLIT_STRATEGY_GUARD
18#define SPLIT_STRATEGY_GUARD
19
20class Term;
21class Slice;
22class Ideal;
23class TermGrader;
24
31 public:
32 virtual ~SplitStrategy();
33
40 virtual void getPivot(Term& pivot, Slice& slice) const = 0;
41
48 virtual void getPivot(Term& pivot, Slice& slice, const TermGrader& grader) const = 0;
49
54 virtual size_t getLabelSplitVariable(const Slice& slice) const = 0;
55
57 virtual bool isPivotSplit() const = 0;
58
60 virtual bool isLabelSplit() const = 0;
61
63 virtual const char* getName() const = 0;
64
68 static auto_ptr<SplitStrategy> createStrategy(const string& prefix);
69
70 protected:
72
73 // To make these inaccessible. They are not implemented.
77};
78
79#endif
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
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.
virtual size_t getLabelSplitVariable(const Slice &slice) const =0
Returns the variable to perform a label split on.
SplitStrategy & operator=(const SplitStrategy &)
virtual void getPivot(Term &pivot, Slice &slice, const TermGrader &grader) const =0
Sets pivot to the pivot of a pivot split on slice.
virtual ~SplitStrategy()
virtual bool isPivotSplit() const =0
If returns true, only call getPivot.
static auto_ptr< SplitStrategy > createStrategy(const string &prefix)
Returns the strategy whose name has the given prefix.
virtual bool isLabelSplit() const =0
If returns true, only call getLabelSplitVariable.
virtual void getPivot(Term &pivot, Slice &slice) const =0
Sets pivot to the pivot of a pivot split on slice.
virtual const char * getName() const =0
Returns the name of the strategy.
SplitStrategy(const SplitStrategy &)
bool operator==(const SplitStrategy &)
A TermGrader assigns a value, the degree, to each monomial.
Definition TermGrader.h:27
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49