18 #ifndef polybori_BoolePolynomial_h_
19 #define polybori_BoolePolynomial_h_
50 class DegRevLexAscOrder;
51 class BlockDegLexOrder;
52 class BlockDegRevLexAscOrder;
59 template <
class IteratorType,
class MonomType>
62 template <
class IteratorType,
class MonomType>
69 template<
class OrderType,
class NavigatorType,
class MonomType>
72 template<
class NavigatorType,
class ExpType>
213 m_dd(ring.zero() ) { }
217 m_dd(isOne? ring.one(): ring.zero() ) { }
246 return (*
this) =
self(rhs, ring());
251 self& operator+=(
const self&);
255 if (rhs) (*this) = (*
this + ring().one());
258 template <
class RHSType>
259 self&
operator-=(
const RHSType& rhs) {
return operator+=(rhs); }
264 if (!rhs) *
this = ring().zero();
267 self& operator/=(
const var_type&);
268 self& operator/=(
const monom_type&);
269 self& operator/=(
const exp_type&);
270 self& operator/=(
const self& rhs);
271 self& operator/=(constant_type rhs);
272 self& operator%=(
const var_type&);
273 self& operator%=(
const monom_type&);
275 return (*
this) -= (
self(rhs) *= (
self(*
this) /= rhs));
285 return ( rhs? isOne(): isZero() );
289 return (!(*
this==rhs));
306 bool_type firstReducibleBy(
const self&)
const;
309 monom_type lead()
const;
312 monom_type lexLead()
const;
318 monom_type boundedLead(
deg_type bound)
const;
321 exp_type leadExp()
const;
325 exp_type boundedLeadExp(
deg_type bound)
const;
337 hash_type leadStableHash()
const;
355 self gradedPart(
deg_type deg)
const;
358 size_type nNodes()
const;
361 size_type nUsedVariables()
const;
364 monom_type usedVariables()
const;
367 exp_type usedVariablesExp()
const;
370 size_type length()
const;
373 ostream_type& print(ostream_type&)
const;
376 const_iterator begin()
const;
379 const_iterator end()
const;
382 exp_iterator expBegin()
const;
385 exp_iterator expEnd()
const;
388 first_iterator firstBegin()
const;
391 first_iterator firstEnd()
const;
394 monom_type firstTerm()
const;
397 deg_iterator degBegin()
const;
400 deg_iterator degEnd()
const;
403 ordered_iterator orderedBegin()
const;
406 ordered_iterator orderedEnd()
const;
409 ordered_exp_iterator orderedExpBegin()
const;
412 ordered_exp_iterator orderedExpEnd()
const;
416 lex_iterator genericBegin(
lex_tag)
const;
417 lex_iterator genericEnd(
lex_tag)
const;
418 dlex_iterator genericBegin(
dlex_tag)
const;
419 dlex_iterator genericEnd(
dlex_tag)
const;
420 dp_asc_iterator genericBegin(
dp_asc_tag)
const;
428 lex_exp_iterator genericExpBegin(
lex_tag)
const;
429 lex_exp_iterator genericExpEnd(
lex_tag)
const;
430 dlex_exp_iterator genericExpBegin(
dlex_tag)
const;
431 dlex_exp_iterator genericExpEnd(
dlex_tag)
const;
432 dp_asc_exp_iterator genericExpBegin(
dp_asc_tag)
const;
433 dp_asc_exp_iterator genericExpEnd(
dp_asc_tag)
const;
452 size_type eliminationLength()
const;
453 size_type eliminationLengthWithDegBound(
deg_type garantied_deg_bound)
const;
455 void fetchTerms(termlist_type&)
const;
458 termlist_type terms()
const;
481 comp_type compare(
const self&)
const;
484 bool_type inSingleBlock()
const;
491 self leadFirst()
const;
494 set_type firstDivisors()
const;
503 inline BoolePolynomial
509 inline BoolePolynomial
516 inline BoolePolynomial
524 template <
class RHSType>
525 inline BoolePolynomial
531 inline BoolePolynomial
539 #define PBORI_RHS_MULT(type) inline BoolePolynomial \
540 operator*(const BoolePolynomial& lhs, const type& rhs) { \
541 return BoolePolynomial(lhs) *= rhs; }
549 #undef PBORI_RHS_MULT
552 #define PBORI_LHS_MULT(type) inline BoolePolynomial \
553 operator*(const type& lhs, const BoolePolynomial& rhs) { return rhs * lhs; }
559 #undef PBORI_LHS_MULT
563 template <
class RHSType>
570 template <
class RHSType>
571 inline BoolePolynomial
578 inline BoolePolynomial::bool_type
585 inline BoolePolynomial::bool_type
592 BoolePolynomial::ostream_type&
593 operator<<(BoolePolynomial::ostream_type&,
const BoolePolynomial&);
596 inline BoolePolynomial::bool_type
597 BoolePolynomial::firstReducibleBy(
const self& rhs)
const {
605 return std::includes(firstBegin(), firstEnd(),
606 rhs.firstBegin(), rhs.firstEnd());
613 #endif // of polybori_BoolePolynomial_h_