33 _consumerCacheDeleter(_consumerCache),
41 Ideal sliceIdeal(varCount);
47 Term allOnes(varCount);
48 for (
size_t var = 0; var < varCount; ++var)
89 return auto_ptr<HilbertSlice>(
static_cast<HilbertSlice*
>(slice.release()));
110 ASSERT(consumer.get() != 0);
120 ASSERT(sliceParam.get() != 0);
122 auto_ptr<HilbertSlice> slice
126 auto_ptr<HilbertIndependenceConsumer> autoSplit =
newConsumer();
149 return auto_ptr<HilbertIndependenceConsumer>
152 auto_ptr<HilbertIndependenceConsumer> consumer(
_consumerCache.back());
void noThrowPushBack(Container &container, auto_ptr< Element > pointer)
virtual void consume(const Polynomial &poly)
CoefTermConsumer * getRightConsumer()
const Projection & getRightProjection() const
const Projection & getLeftProjection() const
CoefTermConsumer * getLeftConsumer()
void freeConsumer(auto_ptr< HilbertIndependenceConsumer > consumer)
virtual auto_ptr< Slice > allocateSlice()
Directly allocate a slice of the correct type using new.
virtual void getPivot(Term &term, Slice &slice)
Used by pivotSplit to obtain a pivot.
ElementDeleter< vector< HilbertIndependenceConsumer * > > _consumerCacheDeleter
HilbertStrategy(CoefTermConsumer *consumer, const SplitStrategy *splitStrategy)
virtual bool debugIsValidSlice(Slice *slice)
Check that this slice is valid for use with this strategy.
IndependenceSplitter _indepSplitter
auto_ptr< HilbertSlice > newHilbertSlice()
vector< HilbertIndependenceConsumer * > _consumerCache
CoefTermConsumer * _consumer
virtual void run(const Ideal &ideal)
Run the Slice algorithm.
virtual bool processSlice(TaskEngine &tasks, auto_ptr< Slice > slice)
Process the parameter slice.
void independenceSplit(auto_ptr< Slice > slice)
auto_ptr< HilbertIndependenceConsumer > newConsumer()
Represents a monomial ideal with int exponents.
void product(const Exponent *term)
size_t getGeneratorCount() const
bool contains(const Exponent *term) const
size_t getVarCount() const
size_t getVarCount() const
bool analyze(const Slice &slice)
This class adds code to the SliceStrategy base class that is useful for derived classes.
bool getUseIndependence() const
Returns true if independence splits should be performed when possible.
bool getUseSimplification() const
Returns true if slices should be simplified.
const SplitStrategy * _split
virtual bool simplify(Slice &slice)
Simplifies slice and returns true if it changed.
virtual void pivotSplit(auto_ptr< Slice > slice)
Takes over ownership of slice.
auto_ptr< Slice > newSlice()
Returns a slice from the cache that freeSlice adds to, or allocate a new one using allocateSlice.
virtual void freeSlice(auto_ptr< Slice > slice)
It is allowed to delete returned slices directly, but it is better to use freeSlice.
TaskEngine _tasks
This keeps track of pending tasks to process.
This class represents a slice, which is the central data structure of the Slice Algorithm.
size_t getVarCount() const
Returns the number of variables in the ambient ring.
A SplitStrategy is an implementation of a split selection strategy for the Slice Algorithm.
virtual bool isPivotSplit() const =0
If returns true, only call getPivot.
virtual void getPivot(Term &pivot, Slice &slice) const =0
Sets pivot to the pivot of a pivot split on slice.
TaskEngine handles a list of tasks that are to be carried out.
void addTask(Task *task)
Add a task at the head of the list of pending tasks.
void runTasks()
Runs all pending tasks.
Term represents a product of variables which does not include a coefficient.
size_t getVarCount() const