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