carl  24.04
Computer ARithmetic Library
carl::PolynomialFactorizationPair< P > Class Template Reference

#include <PolynomialFactorizationPair.h>

Collaboration diagram for carl::PolynomialFactorizationPair< P >:

Public Member Functions

 PolynomialFactorizationPair ()=delete
 
 PolynomialFactorizationPair (Factorization< P > &&_factorization, P *_polynomial=nullptr)
 
 PolynomialFactorizationPair (const PolynomialFactorizationPair &)=delete
 
 ~PolynomialFactorizationPair ()
 
PolynomialFactorizationPairoperator= (const PolynomialFactorizationPair &pfp)=default
 
size_t hash () const
 
const auto & polynomial () const
 
void rehash () const
 Updates the hash. More...
 

Private Member Functions

P::CoeffType flattenFactorization () const
 Turn (possible) tree structure of factorization into linear list of factors. More...
 
bool checkFactorization () const
 
bool assertFactorization () const
 
const Factorization< P > & factorization () const
 Get the flattened factorization. More...
 
bool factorizedTrivially () const
 
void gatherVariables (std::set< carl::Variable > &_vars) const
 
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. More...
 
bool isIrreducible () const
 

Private Attributes

size_t mHash
 The hash of this polynomial factorization pair. More...
 
std::recursive_mutex mMutex
 A mutex for situation where any member is changed. More...
 
Factorization< P > mFactorization
 A factorization (not necessarily the prime factorization) of the polynomial. More...
 
P * mpPolynomial
 A pointer to a polynomial. More...
 
int mIrreducible
 Indicates, if the polynomial is irreducible. More...
 

Friends

class FactorizedPolynomial< P >
 
template<typename P1 >
P1 computePolynomial (const Factorization< P1 > &)
 
template<typename P1 >
P1 computePolynomial (const PolynomialFactorizationPair< P1 > &)
 
template<typename P1 >
bool operator== (const PolynomialFactorizationPair< P1 > &_polyFactA, const PolynomialFactorizationPair< P1 > &_polyFactB)
 
template<typename P1 >
bool operator< (const PolynomialFactorizationPair< P1 > &_polyFactA, const PolynomialFactorizationPair< P1 > &_polyFactB)
 
template<typename P1 >
bool canBeUpdated (const PolynomialFactorizationPair< P1 > &_toUpdate, const PolynomialFactorizationPair< P1 > &_updateWith)
 
template<typename P1 >
void update (PolynomialFactorizationPair< P1 > &_toUpdate, PolynomialFactorizationPair< P1 > &_updateWith)
 Updates the first given polynomial factorization pair with the information stored in the second given polynomial factorization pair. More...
 
template<typename P1 >
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 factorization pairs. More...
 
template<typename P1 >
Factors< FactorizedPolynomial< P1 > > factor (const PolynomialFactorizationPair< P1 > &_pfPair, const typename P1::CoeffType &)
 
template<typename P1 >
std::ostream & operator<< (std::ostream &_out, const PolynomialFactorizationPair< P1 > &_pfPair)
 Prints the given polynomial-factorization pair on the given output stream. More...
 

Detailed Description

template<typename P>
class carl::PolynomialFactorizationPair< P >

Definition at line 96 of file PolynomialFactorizationPair.h.

Constructor & Destructor Documentation

◆ PolynomialFactorizationPair() [1/3]

template<typename P >
carl::PolynomialFactorizationPair< P >::PolynomialFactorizationPair ( )
delete

◆ PolynomialFactorizationPair() [2/3]

template<typename P >
carl::PolynomialFactorizationPair< P >::PolynomialFactorizationPair ( Factorization< P > &&  _factorization,
P *  _polynomial = nullptr 
)
explicit

◆ PolynomialFactorizationPair() [3/3]

template<typename P >
carl::PolynomialFactorizationPair< P >::PolynomialFactorizationPair ( const PolynomialFactorizationPair< P > &  )
delete

◆ ~PolynomialFactorizationPair()

Member Function Documentation

◆ assertFactorization()

template<typename P >
bool carl::PolynomialFactorizationPair< P >::assertFactorization ( ) const
inlineprivate

Definition at line 143 of file PolynomialFactorizationPair.h.

◆ checkFactorization()

template<typename P >
bool carl::PolynomialFactorizationPair< P >::checkFactorization ( ) const
private

◆ factorization()

template<typename P >
const Factorization<P>& carl::PolynomialFactorizationPair< P >::factorization ( ) const
inlineprivate

Get the flattened factorization.

Returns
The factorization of this polynomial factorization pair

Definition at line 152 of file PolynomialFactorizationPair.h.

◆ factorizedTrivially()

template<typename P >
bool carl::PolynomialFactorizationPair< P >::factorizedTrivially ( ) const
inlineprivate

Definition at line 157 of file PolynomialFactorizationPair.h.

◆ flattenFactorization()

template<typename P >
P::CoeffType carl::PolynomialFactorizationPair< P >::flattenFactorization ( ) const
private

Turn (possible) tree structure of factorization into linear list of factors.

Returns
true, if the factorization has been changed; false, otherwise.

◆ gatherVariables()

template<typename P >
void carl::PolynomialFactorizationPair< P >::gatherVariables ( std::set< carl::Variable > &  _vars) const
inlineprivate

Definition at line 163 of file PolynomialFactorizationPair.h.

◆ hash()

template<typename P >
size_t carl::PolynomialFactorizationPair< P >::hash ( ) const
inline
Returns
The hash of this polynomial factorization pair.

Definition at line 205 of file PolynomialFactorizationPair.h.

Here is the caller graph for this function:

◆ isIrreducible()

template<typename P >
bool carl::PolynomialFactorizationPair< P >::isIrreducible ( ) const
private

◆ operator=()

template<typename P >
PolynomialFactorizationPair& carl::PolynomialFactorizationPair< P >::operator= ( const PolynomialFactorizationPair< P > &  pfp)
default

◆ polynomial()

template<typename P >
const auto& carl::PolynomialFactorizationPair< P >::polynomial ( ) const
inline

Definition at line 210 of file PolynomialFactorizationPair.h.

◆ rehash()

template<typename P >
void carl::PolynomialFactorizationPair< P >::rehash ( ) const

Updates the hash.

◆ setNewFactors()

template<typename P >
void carl::PolynomialFactorizationPair< P >::setNewFactors ( const FactorizedPolynomial< P > &  _fpolyA,
carl::exponent  exponentA,
const FactorizedPolynomial< P > &  _fpolyB,
carl::exponent  exponentB 
) const
private

Set new factorization for polynomial as two factors.

Parameters
_fpolyAFirst polynomial.
exponentAExponent of first polynomial.
_fpolyBSecond polynomial.
exponentBExponent of second polynomial.

Friends And Related Function Documentation

◆ canBeUpdated

template<typename P >
template<typename P1 >
bool canBeUpdated ( const PolynomialFactorizationPair< P1 > &  _toUpdate,
const PolynomialFactorizationPair< P1 > &  _updateWith 
)
friend
Parameters
_toUpdateThe polynomial factorization pair to be checked for the possibility to be updated.
_updateWithThe polynomial factorization pair used to update the first given one.
Returns
true, if the first polynomial factorization pair can be updated with the second one.

◆ computePolynomial [1/2]

template<typename P >
template<typename P1 >
P1 computePolynomial ( const Factorization< P1 > &  )
friend

◆ computePolynomial [2/2]

template<typename P >
template<typename P1 >
P1 computePolynomial ( const PolynomialFactorizationPair< P1 > &  )
friend

◆ factor

template<typename P >
template<typename P1 >
Factors<FactorizedPolynomial<P1> > factor ( const PolynomialFactorizationPair< P1 > &  _pfPair,
const typename P1::CoeffType &   
)
friend
Parameters
_pfPairThe polynomial to calculate the factorization for.
Returns
A factorization of this factorized polynomial. (probably finer than the one factorization() returns)

◆ FactorizedPolynomial< P >

template<typename P >
friend class FactorizedPolynomial< P >
friend

Definition at line 69 of file PolynomialFactorizationPair.h.

◆ gcd

template<typename P >
template<typename P1 >
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 
)
friend

Calculates the factorization of the gcd of the polynomial represented by the two given polynomial factorization pairs.

As a side effect the factorizations of these pairs can be refined. (c.f. Accelerating Parametric Probabilistic Verification, Algorithm 2)

Parameters
_pfPairAThe first polynomial factorization pair to calculate the gcd with.
_pfPairBThe second polynomial factorization pair to calculate the gcd with.
_restAThe remaining factorization of the first polynomial without the gcd.
_restBThe remaining factorization of the second polynomial without the gcd.
_coeff
_pfPairARefinedA bool which is set to true, if the factorization of the first given polynomial factorization pair has been refined.
_pfPairBRefinedA bool which is set to true, if the factorization of the second given polynomial factorization pair has been refined.
Returns
The factorization of the gcd of the polynomial represented by the two given polynomial factorization pairs.

◆ operator<

template<typename P >
template<typename P1 >
bool operator< ( const PolynomialFactorizationPair< P1 > &  _polyFactA,
const PolynomialFactorizationPair< P1 > &  _polyFactB 
)
friend
Parameters
_polyFactAThe first polynomial factorization pair to compare.
_polyFactBThe second polynomial factorization pair to compare.
Returns
true, if the first given polynomial factorization pair is less than the second given polynomial factorization pair.

◆ operator<<

template<typename P >
template<typename P1 >
std::ostream& operator<< ( std::ostream &  _out,
const PolynomialFactorizationPair< P1 > &  _pfPair 
)
friend

Prints the given polynomial-factorization pair on the given output stream.

Parameters
_outThe stream to print on.
_pfPairThe polynomial-factorization pair to print.
Returns
The output stream after inserting the output.

◆ operator==

template<typename P >
template<typename P1 >
bool operator== ( const PolynomialFactorizationPair< P1 > &  _polyFactA,
const PolynomialFactorizationPair< P1 > &  _polyFactB 
)
friend
Parameters
_polyFactAThe first polynomial factorization pair to compare.
_polyFactBThe second polynomial factorization pair to compare.
Returns
true, if the two given polynomial factorization pairs are equal.

◆ update

template<typename P >
template<typename P1 >
void update ( PolynomialFactorizationPair< P1 > &  _toUpdate,
PolynomialFactorizationPair< P1 > &  _updateWith 
)
friend

Updates the first given polynomial factorization pair with the information stored in the second given polynomial factorization pair.

Parameters
_toUpdateThe polynomial factorization pair to update with the second given one.
_updateWithThe polynomial factorization pair used to update the first given one.

Field Documentation

◆ mFactorization

template<typename P >
Factorization<P> carl::PolynomialFactorizationPair< P >::mFactorization
mutableprivate

A factorization (not necessarily the prime factorization) of the polynomial.

Definition at line 116 of file PolynomialFactorizationPair.h.

◆ mHash

template<typename P >
size_t carl::PolynomialFactorizationPair< P >::mHash
mutableprivate

The hash of this polynomial factorization pair.

Definition at line 106 of file PolynomialFactorizationPair.h.

◆ mIrreducible

template<typename P >
int carl::PolynomialFactorizationPair< P >::mIrreducible
mutableprivate

Indicates, if the polynomial is irreducible.

Definition at line 126 of file PolynomialFactorizationPair.h.

◆ mMutex

template<typename P >
std::recursive_mutex carl::PolynomialFactorizationPair< P >::mMutex
mutableprivate

A mutex for situation where any member is changed.

Definition at line 111 of file PolynomialFactorizationPair.h.

◆ mpPolynomial

template<typename P >
P* carl::PolynomialFactorizationPair< P >::mpPolynomial
mutableprivate

A pointer to a polynomial.

This pointer might be set to nullptr, if the factorization has not yet been expanded.

Definition at line 121 of file PolynomialFactorizationPair.h.


The documentation for this class was generated from the following file: