1 #ifndef _REGULARCHAIN_H_ 2 #define _REGULARCHAIN_H_ 4 #include "../TriangularSet/triangularset.hpp" 5 #include "../SubResultantChain/subresultantchain.hpp" 6 #include "../polynomial.h" 7 #include "chainstructures.hpp" 9 template <
class Field,
class RecursivePoly>
15 enum RegularChainOption {
16 ASSUME_REGULAR = 0x001,
17 ASSUME_REDUCED = 0x002,
18 ASSUME_PRIMITIVE = 0x004,
19 ASSUME_SQUAREFREE = 0x008,
20 ASSUME_ZERODIMENSIONAL = 0x010,
21 ASSUME_MAKESCHAIN = 0x020,
22 MAINTAIN_SQUAREFREE = 0x040,
23 MAINTAIN_NORMALIZED = 0x080,
24 MAINTAIN_PRIME = 0x100,
32 template <
class Field,
class RecursivePoly>
49 int regularChainOptions = MAINTAIN_SQUAREFREE;
58 void updateRegularChainStates();
66 void updateRegularChainStates(
const RecursivePoly& p);
80 bool cleanSet(std::vector<RecursivePoly>& polys)
const;
130 void constructChain(
const RecursivePoly& p,
int options=ASSUME_REGULAR);
148 std::vector<RegularChain<Field,RecursivePoly>> constructChains(
const RecursivePoly& p,
int options=ASSUME_REGULAR)
const;
166 std::vector<RegularChain<Field,RecursivePoly>> intersectFree(
const RecursivePoly& p,
const Symbol& v)
const;
177 std::vector<RegularChain<Field,RecursivePoly>> intersectAlgebraic(
const RecursivePoly& p,
const RegularChain<Field,RecursivePoly>& T,
const Symbol& v,
const SubResultantChain<RecursivePoly,RecursivePoly>& src)
const;
196 std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularizeSingle(
const RecursivePoly& p)
const;
205 std::vector<RecursivePoly> GCDFreeFactorization(
const RecursivePoly& p,
int type = 0)
const;
213 std::vector<RegularChain<Field,RecursivePoly>> extend(
const RecursivePoly& p,
const Symbol& v)
const;
220 std::vector<RegularChain<Field,RecursivePoly>> extend(
const std::vector<RecursivePoly>& T,
const Symbol& v)
const;
237 std::vector<RegularChain<Field,RecursivePoly>> squareFreePart(
const RecursivePoly& p,
const Symbol& v,
const SubResultantChain<RecursivePoly,RecursivePoly>& src,
int options=ASSUME_REGULAR)
const;
370 RegularChain<Field,RecursivePoly> (
const std::vector<Symbol>& vs,
const std::vector<Symbol>& avs,
const std::vector<Symbol>& tvs,
const std::vector<RecursivePoly>& ts, TriangularSetMode tsm,
const mpz_class& c);
544 bool isRegular(
const RecursivePoly& p)
const;
620 std::vector<RegularChain<Field,RecursivePoly>>
triangularize(
const std::vector<RecursivePoly>& F);
629 std::vector<RegularChain<Field,RecursivePoly>>
intersect(
const RecursivePoly& p)
const;
638 std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>
regularize(
const RecursivePoly& p)
const;
649 std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>
regularGCD(
const RecursivePoly& p,
const RecursivePoly& q,
const Symbol& v,
const SubResultantChain<RecursivePoly,RecursivePoly>& src)
const;
658 std::vector<RegularChain<Field,RecursivePoly>> squareFreePart(
const RecursivePoly& p,
const Symbol& v,
int options=ASSUME_REGULAR)
const;
673 void randomRegularChain(
int nVars,
int nAlgVars,
int nTrcVars,
int nTerms,
unsigned long int coefBound,
int pSparsity,
bool includeNeg);
687 void randomRegularChain(
int nVars,
int nAlgVars,
int nTrcVars, std::vector<int> maxDegs,
unsigned long int coefBound,
double pSparsity,
bool includeNeg);
bool operator!=(RegularChain< Field, RecursivePoly > &a)
Negated identity operator !=.
void randomRegularChain(int nVars, int nAlgVars, int nTrcVars, int nTerms, unsigned long int coefBound, int pSparsity, bool includeNeg)
Generate a random regular chain based on the number of terms of the polynomials in the chain...
A triangular set templated by a multivariate polynomial over a field.
Definition: triangularset.hpp:42
std::vector< Symbol > variables() const
Get the variable names in decreasing order.
Definition: triangularset.hpp:311
static std::vector< RegularChain< Field, RecursivePoly > > removeRedundantChains(const std::vector< RegularChain< Field, RecursivePoly >> &lrc)
Remove redundancy from the input list of regular chains.
std::vector< RegularChain< Field, RecursivePoly > > intersect(const RecursivePoly &p) const
Compute the common solutions of the input polynomial and the current regular chain.
void upper(const Symbol &s, BPASTriangularSet< Field, RecursivePoly > &ts) const
Returns the regular chain consisting of polynomials with main variable strictly greater than s...
void lowerSlice(const Symbol &s)
Destructively converts the current object into lower(s) by changing the set of (potentially algebraic...
int numberOfVariables() const
Get the number of variables.
Definition: triangularset.hpp:275
A class for handling regular chains in dimension zero.
Definition: regularchain.hpp:10
void lower(const Symbol &s, BPASTriangularSet< Field, RecursivePoly > &ts) const
Returns the regular chain consisting of polynomials with main variable strictly less than s...
RecursivePoly select(const Symbol &s) const
Select a polynomial given the leading variable; if no such polynomial, 0 is returned.
bool operator==(RegularChain< Field, RecursivePoly > &a)
Identity operator ==.
RecursivePoly select(const Symbol &s) const
Select the polynomial in the current object with main variable s, if it exists.
Definition: regularchain.hpp:585
bool isInSaturatedIdeal(const RecursivePoly &p) const
Find out if the input polynomial is in the saturated ideal of the current regular chain...
static bool compareHeuristicNoSplit(const RegularChain< Field, RecursivePoly > &rc1, const RegularChain< Field, RecursivePoly > &rc2)
Determine whether or not the quasicomponent of the first regular chain is contained in the quasicompo...
void setOptions(int opts)
Set the encoded options of the regular chain.
bool isKnownToBeSquareFree() const
Find out if the regular chain is known to be squarefree.
static bool compareCertifiedNoSplit(const RegularChain< Field, RecursivePoly > &rc1, const RegularChain< Field, RecursivePoly > &rc2)
Determine whether or not the quasicomponent of the first regular chain is contained in the quasicompo...
RegularChain< Field, RecursivePoly > & operator+=(const RecursivePoly &p)
Add assignment operator +=: Adds a polynomial to a regular chain, assuming that the main variable of ...
std::vector< RegularChain< Field, RecursivePoly > > triangularize(const std::vector< RecursivePoly > &F)
Compute a triangular decomposition of the list of input polynomials.
std::vector< Symbol > variables() const
Get the (potentially algebriac) variable names in decreasing order.
Definition: regularchain.hpp:576
int options() const
Get the encoded options of the regular chain, a bitwise or of RegularChainOption values.
RegularChain< Field, RecursivePoly > operator+(const RecursivePoly &p) const
Add operator +: Adds a polynomial to a regular chain and returns a new regular chain, assuming that the main variable of p is above any in the current object and that init(p) is regular modulo the saturated ideal of the current object.
A class for handling regular chains of arbitrary dimension.
Definition: regularchain.hpp:33
int numberOfVariables() const
Get the number of (potentially algebraic) variables in the current object.
Definition: regularchain.hpp:491
An encapsulation of a mathematical symbol.
Definition: Symbol.hpp:23
std::vector< PolyChainPair< RecursivePoly, RegularChain< Field, RecursivePoly > > > regularGCD(const RecursivePoly &p, const RecursivePoly &q, const Symbol &v, const SubResultantChain< RecursivePoly, RecursivePoly > &src) const
Compute the gcd of two input polynomials p and q modulo the saturated ideal of the current object...
RegularChain< Field, RecursivePoly > & operator=(const ZeroDimensionalRegularChain< Field, RecursivePoly > &a)
Assignment operator = for a zero-dimensional regular chain.
An abstract class defining the interface of a regular chain.
Definition: polynomial.h:220
bool isInRadicalSaturatedIdeal(const RecursivePoly &p) const
Find out if the input polynomial is in the radical saturated ideal of the current regular chain...
std::vector< PolyChainPair< RecursivePoly, RegularChain< Field, RecursivePoly > > > regularize(const RecursivePoly &p) const
Compute a decomposition of the current object such that on each component the input polynomial is eit...
bool isRegular(const RecursivePoly &p) const
Find out if the input polynomial is regular modulo the saturated ideal of the current regular chain...