321 #ifndef BoolePolynomial_h_
322 #define BoolePolynomial_h_
354 class DegRevLexAscOrder;
355 class BlockDegLexOrder;
356 class BlockDegRevLexAscOrder;
363 template <
class IteratorType,
class MonomType>
366 template <
class IteratorType,
class MonomType>
371 template<
class,
class,
class,
class>
class CDelayedTermIter;
373 template<
class OrderType,
class NavigatorType,
class MonomType>
376 template<
class OrderType,
class NavigatorType,
class MonomType>
377 class MyCGenericIter;
380 template<
class NavigatorType,
class ExpType>
389 class BoolePolynomial;
391 operator+(
const BoolePolynomial& lhs,
const BoolePolynomial& rhs);
476 typedef CGenericIter<DegRevLexAscOrder, navigator, monom_type>
479 typedef CGenericIter<BlockDegLexOrder, navigator, monom_type>
481 typedef CGenericIter<BlockDegRevLexAscOrder, navigator, monom_type>
486 typedef CGenericIter<DegRevLexAscOrder, navigator, exp_type>
488 typedef CGenericIter<BlockDegLexOrder, navigator, exp_type>
490 typedef CGenericIter<BlockDegRevLexAscOrder, navigator, exp_type>
530 m_dd(isOne? ring.one(): ring.zero() ) { }
543 m_dd(ring.manager().manager(), rhs) {
559 return (*
this) =
self(rhs);
564 self& operator+=(
const self&);
568 if (rhs) (*this) = (*
this + ring().one());
571 template <
class RHSType>
572 self&
operator-=(
const RHSType& rhs) {
return operator+=(rhs); }
577 if (!rhs) *
this = ring().zero();
586 return (*
this) -= (
self(rhs) *= (
self(*
this) /= rhs));
596 return ( rhs? isOne(): isZero() );
599 return ( rhs? (!(isZero())): (!(isOne())) );
616 bool_type reducibleBy(
const self&)
const;
619 monom_type lead()
const;
622 monom_type lexLead()
const;
625 monom_type boundedLead(size_type bound)
const;
628 exp_type leadExp()
const;
631 exp_type boundedLeadExp(size_type bound)
const;
643 hash_type lmStableHash()
const;
646 size_type deg()
const;
649 size_type lmDeg()
const;
652 size_type lexLmDeg()
const;
655 size_type totalDeg()
const;
658 size_type lmTotalDeg()
const;
661 self gradedPart(size_type deg)
const;
664 size_type nNodes()
const;
667 size_type nUsedVariables()
const;
670 monom_type usedVariables()
const;
673 exp_type usedVariablesExp()
const;
676 size_type length()
const;
679 ostream_type& print(ostream_type&)
const;
682 void prettyPrint()
const;
685 void prettyPrint(
const char* filename)
const;
688 const_iterator begin()
const;
691 const_iterator end()
const;
694 exp_iterator expBegin()
const;
697 exp_iterator expEnd()
const;
700 first_iterator firstBegin()
const;
703 first_iterator firstEnd()
const;
706 monom_type firstTerm()
const;
709 deg_iterator degBegin()
const;
712 deg_iterator degEnd()
const;
715 ordered_iterator orderedBegin()
const;
718 ordered_iterator orderedEnd()
const;
721 ordered_exp_iterator orderedExpBegin()
const;
724 ordered_exp_iterator orderedExpEnd()
const;
728 lex_iterator genericBegin(
lex_tag)
const;
729 lex_iterator genericEnd(
lex_tag)
const;
730 dlex_iterator genericBegin(
dlex_tag)
const;
731 dlex_iterator genericEnd(
dlex_tag)
const;
732 dp_asc_iterator genericBegin(
dp_asc_tag)
const;
740 lex_exp_iterator genericExpBegin(
lex_tag)
const;
741 lex_exp_iterator genericExpEnd(
lex_tag)
const;
742 dlex_exp_iterator genericExpBegin(
dlex_tag)
const;
743 dlex_exp_iterator genericExpEnd(
dlex_tag)
const;
744 dp_asc_exp_iterator genericExpBegin(
dp_asc_tag)
const;
745 dp_asc_exp_iterator genericExpEnd(
dp_asc_tag)
const;
764 size_type eliminationLength()
const;
765 size_type eliminationLengthWithDegBound(size_type garantied_deg_bound)
const;
767 void fetchTerms(termlist_type&)
const;
770 termlist_type terms()
const;
798 self leadFirst()
const;
801 set_type firstDivisors()
const;
811 inline BoolePolynomial
817 inline BoolePolynomial
824 inline BoolePolynomial
832 template <
class RHSType>
833 inline BoolePolynomial
839 inline BoolePolynomial
847 #define PBORI_RHS_MULT(type) inline BoolePolynomial \
848 operator*(const BoolePolynomial& lhs, const type& rhs) { \
849 return BoolePolynomial(lhs) *= rhs; }
857 #undef PBORI_RHS_MULT
860 #define PBORI_LHS_MULT(type) inline BoolePolynomial \
861 operator*(const type& lhs, const BoolePolynomial& rhs) { return rhs * lhs; }
867 #undef PBORI_LHS_MULT
871 template <
class RHSType>
878 template <
class RHSType>
879 inline BoolePolynomial
886 inline BoolePolynomial::bool_type
893 inline BoolePolynomial::bool_type
900 BoolePolynomial::ostream_type&
901 operator<<(BoolePolynomial::ostream_type&,
const BoolePolynomial&);
904 inline BoolePolynomial::bool_type
905 BoolePolynomial::reducibleBy(
const self& rhs)
const {
915 return std::includes(firstBegin(), firstEnd(),
916 rhs.firstBegin(), rhs.firstEnd());
923 #endif // of BoolePolynomial_h_