22 template<
class Polynomial>
67 template<
typename InputPolynomial,
typename PolynomialInIdeal,
template <
class>
class Datastructure =
carl::Heap,
template <
typename Polynomial>
class Configuration =
ReductorConfiguration>
72 using Order =
typename InputPolynomial::OrderedBy;
73 using EntryType =
typename Configuration<InputPolynomial>::EntryType;
74 using Coeff =
typename InputPolynomial::CoeffType;
86 if(InputPolynomial::Policy::has_reasons)
109 typename Configuration<InputPolynomial>::Entry entry;
116 leadingTerm = entry->getLead();
117 CARL_LOG_TRACE(
"carl.gb.reductor",
"Intermediate leading term: " << leadingTerm);
122 typename Configuration<InputPolynomial>::Entry newentry =
mDatastruct.top();
125 assert(!newentry->empty());
149 if(PolynomialInIdeal::Policy::has_reasons)
160 CARL_LOG_DEBUG(
"carl.gb.reductor",
"Not reducible: " << leadingTerm);
192 InputPolynomial result(std::move(
mRemainder),
true,
false);
193 if(InputPolynomial::Policy::has_reasons)
225 entry->removeLeadingTerm();
226 assert(!entry->empty());
236 CARL_LOG_TRACE(
"carl.gb.reductor",
"Insert polynomial: " << g <<
" * " << fact);
243 assert(g.getCoeff() != 0);
This file has been extracted from mathic.
#define CARL_LOG_TRACE(channel, msg)
#define CARL_LOG_DEBUG(channel, msg)
carl is the main namespace for the library.
signed compare(const BasicConstraint< Pol > &_constraintA, const BasicConstraint< Pol > &_constraintB)
Compares _constraintA with _constraintB.
bool is_zero(const Interval< Number > &i)
Check if this interval is a point-interval containing 0.
Term< typename Polynomial::CoeffType > mFactor
const Polynomial *const mDivisor
DivisionLookupResult< Polynomial > getDivisor(const Term< typename Polynomial::CoeffType > &t) const
Class with the settings for the reduction algorithm.
static bool deduplicate(Entry e1, Entry e2)
should only be called if the compare result was EQUAL eliminate duplicate leading monomials
static CompareResult compare(Entry e1, Entry e2)
static const bool fastIndex
static bool cmpLessThan(CompareResult res)
static const bool supportDeduplicationWhileOrdering
static bool cmpEqual(CompareResult res)
A dedicated algorithm for calculating the remainder of a polynomial modulo a set of other polynomials...
std::vector< Term< Coeff > > mRemainder
virtual ~Reductor()=default
Datastructure< Configuration< InputPolynomial > > mDatastruct
const Ideal< PolynomialInIdeal > & mIdeal
void insert(const Term< Coeff > &g)
InputPolynomial fullReduce()
Uses the ideal to reduce a polynomial as far as possible.
typename Configuration< InputPolynomial >::EntryType EntryType
typename InputPolynomial::OrderedBy Order
Reductor(const Ideal< PolynomialInIdeal > &ideal, const Term< Coeff > &f)
bool reductionOccured()
Gets the flag which indicates that a reduction has occurred (p -> p' with p' != p)
typename InputPolynomial::CoeffType Coeff
Reductor(const Ideal< PolynomialInIdeal > &ideal, const InputPolynomial &f)
bool updateDatastruct(EntryType *entry)
A small routine which updates the underlying data structure for the polynomial which is reduced.
bool reduce()
The basic reduce routine on a priority queue.
void insert(const InputPolynomial &g, const Term< Coeff > &fact)
An entry in the reduction polynomial.
bool addCoefficient(const Coeff &coeffToBeAdded)
const Term< Coeff > & getLead() const
Coefficient & coeff()
Get the coefficient.
Monomial::Arg & monomial()
Get the monomial.
BitVector & calculateUnion(const BitVector &rhs)