69 fputs(
"Slice (multiply: ", file);
71 fputs(
"\n ideal: ", file);
73 fputs(
" subtract: ", file);
137 if (
getIdeal().getGeneratorCount() != count)
140 if (
pivot.getSizeOfSupport() > 1)
169 for (
size_t var = 0; var <
_varCount; ++var) {
226 if (var ==
slice.getVarCount() ||
projection.domainVarHasProjection(var)) {
238 if (var ==
slice.getVarCount() ||
projection.domainVarHasProjection(var)) {
245 if (
slice._lcmUpdated) {
264 class PruneSubtractPredicate {
266 PruneSubtractPredicate(
const Ideal& ideal,
const Term& lcm):
267 _ideal(ideal), _lcm(lcm) {}
269 bool operator()(
const Exponent* term) {
272 _ideal.contains(term);
306 if (!
bound.isIdentity()) {
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.
void removeStrictMultiples(const Exponent *term)
void singleDegreeSort(size_t var)
size_t getGeneratorCount() const
void clearAndSetVarCount(size_t varCount)
void getLcm(Exponent *lcm) const
Sets lcm to the least common multiple of all generators.
Cont::const_iterator const_iterator
void insert(const Exponent *term)
void insertReminimize(const Exponent *term)
const_iterator end() const
bool removeIf(Predicate pred)
Removes those generators m such that pred(m) evaluates to true.
void print(FILE *file) const
const_iterator begin() const
bool colonReminimize(const Exponent *colon)
size_t getVarCount() const
This class describes the interface of a strategy object for the Slice Algorithm.
virtual void freeSlice(auto_ptr< Slice > slice)=0
It is allowed to delete returned slices directly, but it is better to use freeSlice.
virtual bool processSlice(TaskEngine &tasks, auto_ptr< Slice > slice)=0
Process the parameter slice.
This class represents a slice, which is the central data structure of the Slice Algorithm.
size_t _varCount
The number of variables in the ambient polynomial ring.
Ideal _ideal
The of a slice .
void resetAndSetVarCount(size_t varCount)
Resets this slice to in an ambient polynomial ring of varCount variables.
SliceStrategy & _strategy
bool normalize()
Removes those generators of getIdeal() that are strictly divisible by some generator of getSubtract()...
void singleDegreeSortIdeal(size_t var)
Calls Ideal::singleDegreeSort on getIdeal().
void print(FILE *file) const
Write a text representation of this object to file in a format appropriate for debugging.
virtual bool innerSlice(const Term &pivot)
Sets this object to the inner slice according to pivot.
virtual void outerSlice(const Term &pivot)
Sets this object to the outer slice according to pivot.
size_t _lowerBoundHint
A hint that starting simplification through a lower bound at the variable indicated by _lowerBoundHin...
virtual Slice & operator=(const Slice &slice)=0
Performs a deep copy of slice into this object.
bool adjustMultiply()
Ensure that for each var, var appears to the first power in some generator of getIdeal().
void setToProjOf(const Slice &slice, const Projection &projection)
Set this object to be the projection of slice according to projection.
Term _multiply
The of a slice .
void swap(Slice &slice)
Simultaneously set the value of this object to that of slice and vice versa.
Slice(SliceStrategy &strategy)
Construct the slice in a ring of zero variables.
Term & getMultiply()
Returns for a slice .
bool pruneSubtract()
Removes those generators of subtract that do not strictly divide the lcm of getIdeal(),...
virtual void run(TaskEngine &tasks)
Does whatever work this task represents.
Term _lcm
The lcm of getIdeal() if _lcmUpdated is true, and otherwise the value is undefind.
void clearIdealAndSubtract()
Clears getIdeal() and getSubtract() and does not change getMultiply().
bool applyLowerBound()
Calculates a lower bound on the content of the slice using getLowerBound() and calls innerSlice with ...
virtual bool getLowerBound(Term &bound, size_t var) const =0
Calculates a lower bound that depends on var.
const Ideal & getIdeal() const
Returns for a slice .
const Term & getLcm() const
Returns the least common multiple of the generators of getIdeal().
bool _lcmUpdated
Indicates whether _lcm is correct.
Ideal _subtract
The of a slice .
size_t getVarCount() const
Returns the number of variables in the ambient ring.
virtual void dispose()
Called when the task is no longer used but run has not and will not be called.
Ideal & getSubtract()
Returns for a slice .
virtual bool simplify()
Simplifies this object such that it may become simpler without changing the content.
bool operator()(const Exponent *term)
StrictMultiplePredicate(const Exponent *term, size_t varCount)
TaskEngine handles a list of tasks that are to be carried out.
Term represents a product of variables which does not include a coefficient.
void reset(size_t newVarCount)
static void product(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the product of a and b.
static bool strictlyDivides(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether a strictly divides b.
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
static void colon(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to .
size_t getFirstNonZeroExponent() const