SplitStrategy.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (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 SPLIT_STRATEGY_GUARD
#define SPLIT_STRATEGY_GUARD
class Term;
class Slice;
class Ideal;
class TermGrader;
class SplitStrategy {
public:
virtual ~SplitStrategy();
virtual void getPivot(Term& pivot, Slice& slice) const = 0;
virtual void getPivot(Term& pivot, Slice& slice, const TermGrader& grader) const = 0;
virtual size_t getLabelSplitVariable(const Slice& slice) const = 0;
virtual bool isPivotSplit() const = 0;
virtual bool isLabelSplit() const = 0;
virtual const char* getName() const = 0;
static unique_ptr<SplitStrategy> createStrategy(const string& prefix);
protected:
SplitStrategy();
// To make these inaccessible. They are not implemented.
SplitStrategy(const SplitStrategy&);
SplitStrategy& operator=(const SplitStrategy&);
bool operator==(const SplitStrategy&);
};
#endif
Ideal
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
Slice
This class represents a slice, which is the central data structure of the Slice Algorithm.
Definition Slice.h:77
SplitStrategy::createStrategy
static unique_ptr< SplitStrategy > createStrategy(const string &prefix)
Returns the strategy whose name has the given prefix.
Definition SplitStrategy.cpp:497
SplitStrategy::getLabelSplitVariable
virtual size_t getLabelSplitVariable(const Slice &slice) const =0
Returns the variable to perform a label split on.
SplitStrategy::operator=
SplitStrategy & operator=(const SplitStrategy &)
SplitStrategy::getPivot
virtual void getPivot(Term &pivot, Slice &slice, const TermGrader &grader) const =0
Sets pivot to the pivot of a pivot split on slice.
SplitStrategy::SplitStrategy
SplitStrategy()
Definition SplitStrategy.cpp:28
SplitStrategy::~SplitStrategy
virtual ~SplitStrategy()
Definition SplitStrategy.cpp:31
SplitStrategy::isPivotSplit
virtual bool isPivotSplit() const =0
If returns true, only call getPivot.
SplitStrategy::isLabelSplit
virtual bool isLabelSplit() const =0
If returns true, only call getLabelSplitVariable.
SplitStrategy::getPivot
virtual void getPivot(Term &pivot, Slice &slice) const =0
Sets pivot to the pivot of a pivot split on slice.
SplitStrategy::getName
virtual const char * getName() const =0
Returns the name of the strategy.
SplitStrategy::SplitStrategy
SplitStrategy(const SplitStrategy &)
SplitStrategy::operator==
bool operator==(const SplitStrategy &)
TermGrader
A TermGrader assigns a value, the degree, to each monomial.
Definition TermGrader.h:27
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49