19 class FactorizedPolynomial;
22 class Factorization:
public std::map<FactorizedPolynomial<P>, carl::exponent>
29 for(
auto f = super::begin(); f != super::end(); ++f )
45 assert( super::find( _val.first ) == super::end() );
46 auto result = super::insert( _hint, std::move(_val) );
59 std::pair<typename super::iterator, bool> insertResult = super::insert( std::move(_val) );
60 if ( !insertResult.second )
63 insertResult.first->second += e;
69 void insert(
typename super::const_iterator _first,
typename super::const_iterator _last )
72 super::insert( _first, _last );
75 typename super::iterator lastInserted = super::begin();
76 while( _first != _last )
78 lastInserted = this->
insert( lastInserted, *_first );
128 template<
typename P1>
131 template<
typename P1>
173 factor.first.gatherVariables( _vars );
219 template<
typename P1>
227 template<
typename P1>
235 template<
typename P1>
243 template<
typename P1>
258 template<
typename P1>
265 template<
typename P1>
274 template <
typename P1>
296 struct hash<
carl::PolynomialFactorizationPair<P>>
carl is the main namespace for the library.
std::string factorizationToString(const Factorization< P > &_factorization, bool _infix=true, bool _friendlyVarNames=true)
std::size_t exponent
Type of an exponent.
std::ostream & operator<<(std::ostream &os, const BasicConstraint< Poly > &c)
Prints the given constraint on the given stream.
bool factorizationsEqual(const Factorization< P > &_factorizationA, const Factorization< P > &_factorizationB)
P computePolynomial(const FactorizedPolynomial< P > &_fpoly)
Obtains the polynomial (representation) of this factorized polynomial.
std::map< Pol, uint > Factors
bool is_one(const Interval< Number > &i)
Check if this interval is a point-interval containing 1.
std::map< FactorizedPolynomial< P >, carl::exponent > super
std::pair< typename super::iterator, bool > insert(const std::pair< FactorizedPolynomial< P >, carl::exponent > &_val)
std::pair< typename super::iterator, bool > insert(std::pair< FactorizedPolynomial< P >, carl::exponent > &&_val)
bool checkFactorization() const
std::pair< typename super::iterator, bool > insert(typename super::const_iterator _hint, const std::pair< FactorizedPolynomial< P >, carl::exponent > &_val)
super::iterator insert(typename super::const_iterator _hint, std::pair< FactorizedPolynomial< P >, carl::exponent > &&_val)
P::CoeffType flattenFactorization() const
Turn (possible) tree structure of factorization into linear list of factors.
PolynomialFactorizationPair(const PolynomialFactorizationPair &)=delete
friend P1 computePolynomial(const Factorization< P1 > &)
void rehash() const
Updates the hash.
std::recursive_mutex mMutex
A mutex for situation where any member is changed.
~PolynomialFactorizationPair()
bool checkFactorization() const
int mIrreducible
Indicates, if the polynomial is irreducible.
void gatherVariables(std::set< carl::Variable > &_vars) const
PolynomialFactorizationPair()=delete
void setNewFactors(const FactorizedPolynomial< P > &_fpolyA, carl::exponent exponentA, const FactorizedPolynomial< P > &_fpolyB, carl::exponent exponentB) const
Set new factorization for polynomial as two factors.
friend bool operator==(const PolynomialFactorizationPair< P1 > &_polyFactA, const PolynomialFactorizationPair< P1 > &_polyFactB)
PolynomialFactorizationPair(Factorization< P > &&_factorization, P *_polynomial=nullptr)
bool isIrreducible() const
friend P1 computePolynomial(const PolynomialFactorizationPair< P1 > &)
size_t mHash
The hash of this polynomial factorization pair.
PolynomialFactorizationPair & operator=(const PolynomialFactorizationPair &pfp)=default
friend std::ostream & operator<<(std::ostream &_out, const PolynomialFactorizationPair< P1 > &_pfPair)
Prints the given polynomial-factorization pair on the given output stream.
friend bool operator<(const PolynomialFactorizationPair< P1 > &_polyFactA, const PolynomialFactorizationPair< P1 > &_polyFactB)
friend bool canBeUpdated(const PolynomialFactorizationPair< P1 > &_toUpdate, const PolynomialFactorizationPair< P1 > &_updateWith)
P * mpPolynomial
A pointer to a polynomial.
const auto & polynomial() const
friend Factors< FactorizedPolynomial< P1 > > factor(const PolynomialFactorizationPair< P1 > &_pfPair, const typename P1::CoeffType &)
friend void update(PolynomialFactorizationPair< P1 > &_toUpdate, PolynomialFactorizationPair< P1 > &_updateWith)
Updates the first given polynomial factorization pair with the information stored in the second given...
const Factorization< P > & factorization() const
Get the flattened factorization.
bool assertFactorization() const
Factorization< P > mFactorization
A factorization (not necessarily the prime factorization) of the polynomial.
friend Factorization< P1 > gcd(const PolynomialFactorizationPair< P1 > &_pfPairA, const PolynomialFactorizationPair< P1 > &_pfPairB, Factorization< P1 > &_restA, Factorization< P1 > &_restB, typename P1::CoeffType &_coeff, bool &_pfPairARefined, bool &_pfPairBRefined)
Calculates the factorization of the gcd of the polynomial represented by the two given polynomial fac...
bool factorizedTrivially() const
size_t operator()(const carl::PolynomialFactorizationPair< P > &_pfp) const