41 Ideal sliceIdeal(varCount);
47 Term allOnes(varCount);
48 for (
size_t var = 0; var < varCount; ++var)
56 unique_ptr<Slice> slice
61 _tasks.addTask(slice.release());
89 return unique_ptr<HilbertSlice>(
static_cast<HilbertSlice*
>(slice.release()));
105 _split->getPivot(term, slice);
110 ASSERT(consumer.get() != 0);
120 ASSERT(sliceParam.get() != 0);
122 unique_ptr<HilbertSlice> slice
126 unique_ptr<HilbertIndependenceConsumer> autoSplit =
newConsumer();
127 autoSplit->reset(slice->getConsumer(),
_indepSplitter, slice->getVarCount());
135 _tasks.addTask(leftSlice.release());
141 _tasks.addTask(rightSlice.release());
149 return unique_ptr<HilbertIndependenceConsumer>
152 unique_ptr<HilbertIndependenceConsumer> consumer(
_consumerCache.back());
void noThrowPushBack(Container &container, unique_ptr< Element > pointer)
CoefTermConsumer * getRightConsumer()
const Projection & getRightProjection() const
const Projection & getLeftProjection() const
CoefTermConsumer * getLeftConsumer()
virtual bool processSlice(TaskEngine &tasks, unique_ptr< Slice > slice)
Process the parameter slice.
unique_ptr< HilbertIndependenceConsumer > newConsumer()
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
vector< HilbertIndependenceConsumer * > _consumerCache
CoefTermConsumer * _consumer
virtual void run(const Ideal &ideal)
Run the Slice algorithm.
void freeConsumer(unique_ptr< HilbertIndependenceConsumer > consumer)
virtual unique_ptr< Slice > allocateSlice()
Directly allocate a slice of the correct type using new.
unique_ptr< HilbertSlice > newHilbertSlice()
void independenceSplit(unique_ptr< Slice > slice)
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
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 void freeSlice(unique_ptr< Slice > slice)
It is allowed to delete returned slices directly, but it is better to use freeSlice.
virtual bool simplify(Slice &slice)
Simplifies slice and returns true if it changed.
virtual void pivotSplit(unique_ptr< Slice > slice)
Takes over ownership of slice.
SliceStrategyCommon(const SplitStrategy *splitStrategy)
unique_ptr< Slice > newSlice()
Returns a slice from the cache that freeSlice adds to, or allocate a new one using allocateSlice.
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.
TaskEngine handles a list of tasks that are to be carried out.
Term represents a product of variables which does not include a coefficient.
size_t getVarCount() const
This header file includes common definitions and is included as the first line of code in every imple...