Basic Polynomial Algebra Subprograms (BPAS)  v. 1.791
regularchain.hpp
1 #ifndef _REGULARCHAIN_H_
2 #define _REGULARCHAIN_H_
3 
4 #include "regularchain_macros.hpp"
5 
6 #include "../TriangularSet/triangularset.hpp"
7 #include "../SubResultantChain/subresultantchain.hpp"
8 #include "chainstructures.hpp"
9 
10 #include "BPASRegularChain.hpp"
11 
12 #include <memory>
13 
14 /* Debugging utils */
15 
16 extern int intersectDepth;
17 extern int regularGCDDepth;
18 extern int intersectFreeDepth;
19 extern int intersectAlgebraicDepth;
20 extern int regularizeDepth;
21 extern int regularizeSingleDepth;
22 extern int extendDepth;
23 extern int cleanChainDepth;
24 extern int depth;
25 
26 extern float primitivePartTime;
27 extern float squareFreePartTime;
28 extern float subresultantChainTime;
29 extern float zerodimensionalregularchainTime;
30 extern float pseudoDivideTime;
31 extern float normalFormTime;
32 extern float removeRedundantChainsTime;
33 extern float factorTime;
34 
35 extern float intersectTime;
36 extern float regularGCDTime;
37 extern float intersectFreeTime;
38 extern float intersectAlgebraicTime;
39 extern float regularizeTime;
40 extern float extendTime;
41 extern float cleanChainTime;
42 extern float constructChainTime;
43 extern float constructChainsTime;
44 extern float GCDFreeFactorizationTime;
45 extern float ZDIntersectTime;
46 extern float ZDRegularizeTime;
47 extern float isRegularTime;
48 extern float isInSaturatedIdealTime;
49 extern float cleanSetTime;
50 
51 extern float tsCopyTime;
52 extern float rcCopyTime;
53 extern float zdrcCopyTime;
54 
55 #define RC_TRIANGULARIZE_TASKTREEDATA 0
56 
57 
58 /* forward declares */
59 
60 template <class Field, class RecursivePoly>
62 
63 template <class Value>
65 
66 class TaskScheduler;
67 
68 template <class Field, class RecursivePoly>
70 
71 /* internal helper functions */
72 
73 template<class Field, class RecursivePoly>
74 void triangularizeTask(const RegularChain<Field, RecursivePoly>& rc, std::vector<RecursivePoly>& polys, bool lazardDecompose, int heightBound, TaskScheduler* tasks, std::shared_ptr<SynchronizedWriteVector<RegularChain<Field,RecursivePoly>>> results);
75 
76 template<class Field, class RecursivePoly>
77 void intersectOne(int j, const RegularChain<Field, RecursivePoly>& T, const RecursivePoly& p, int lazardDecompose, int heightBound, SynchronizedWriteVector<RegularChain<Field,RecursivePoly>>&);
78 
79 
80 /**
81  * An enumeration for various options passed to certain routines of the regular chain classes.
82  **/
83 enum RegularChainOption {
84  ASSUME_REGULAR = 0x001,
85  ASSUME_REDUCED = 0x002,
86  ASSUME_PRIMITIVE = 0x004,
87  ASSUME_SQUAREFREE = 0x008,
88  ASSUME_ZERODIMENSIONAL = 0x010,
89  ASSUME_MAKESCHAIN = 0x020,
90  MAINTAIN_SQUAREFREE = 0x040,
91  MAINTAIN_NORMALIZED = 0x080,
92  MAINTAIN_PRIME = 0x100,
93  CONSTRUCT_FACTORIZE = 0x200,
94 };
95 
96 /**
97  * A class for handling regular chains of arbitrary dimension.
98  * A RegularChain contains polynomials of type BPASRecursivelyViewedPolynomial, which have coefficients in a BPASField.
99  **/
100 template <class Field, class RecursivePoly>
101 class RegularChain : public TriangularSet<Field,RecursivePoly>,
102  public virtual BPASRegularChain<Field,RecursivePoly>
103 {
104  protected:
116 
117 #if defined(RC_TRIANGULARIZE_TASKTREEDATA) && RC_TRIANGULARIZE_TASKTREEDATA
118  mutable int RegChain_UniqueID;
119 #endif
120 
121  int regularChainOptions = CONSTRUCT_FACTORIZE;
122  // int regularChainOptions = MAINTAIN_SQUAREFREE | CONSTRUCT_FACTORIZE;
123 
124  //TODO: These don't really work. They only count up from the empty chain.
125  //Ex: RC over [x>y>z] with polys [x,y]. Adding a non-square free poly in z would make squarefree-ness = 0
126  int squareFreeLevel;
127  int saturatedIdealPrimeLevel;
128 
129  /**
130  * Determine whether the regular chain is strongly normalized and the maximum variable
131  * of the largest strongly normalized subset of the regular chain.
132  *
133  * @param
134  **/
135  void updateRegularChainStates();
136 
137  /**
138  * Determine whether after adding p the regular chain is strongly normalized and update the maximum variable
139  * of the largest strongly normalized subset of the triangular set.
140  *
141  * @param p: a recursively viewed polynomial that has just been added to the chain
142  **/
143  void updateRegularChainStates(const RecursivePoly& p);
144 
145 // /**
146 // * A protected internal routine used by triangularize to
147 // *
148 // * @param p: a recursively viewed polynomial that has just been added to the set
149 // **/
150 // std::vector<RegularChain<Field,RecursivePoly>> triangularize_inner(std::vector<RecursivePoly>& F) const;
151 
152  /**
153  * Compute a canonical representation of the input polynomial.
154  *
155  * @param p: a recursively viewed polynomial
156  **/
157  RecursivePoly makeCanonical(const RecursivePoly& p_in) const;
158 
159  /**
160  * Reduce the input polynomial with respect to the polynomials in the the current object with constant
161  * initial and remove parts of the result that reduce to zero modulo the current object. This is a less
162  * involved computation than reduce from the TriangularSet class.
163  *
164  * @param p: a recursively viewed polynomial
165  **/
166  RecursivePoly reduceMinimal(const RecursivePoly& p) const;
167 
168  /**
169  * Do a minimal reduction (calling reduceMinimal) and take the mainPrimitivePart.
170  *
171  * @param p: a recursively viewed polynomial
172  **/
173  RecursivePoly reduceMinimalPrimitivePart(const RecursivePoly& p) const;
174 
175  /**
176  * Do a minimal reduction (calling reduceMinimal) and take the mainPrimitivePart and squareFreePart.
177  *
178  * @param p: a recursively viewed polynomial
179  **/
180  RecursivePoly reduceMinimalPrimitiveSquareFreePart(const RecursivePoly& p_in) const;
181 
182  /**
183  * Reduce the input polynomial such that p = 0 iff p is in the saturated ideal of the current object and such that the p - ret is in the same saturated ideal, where ret is the returned value.
184  *
185  * @param p: a recursively viewed polynomial
186  **/
187  RecursivePoly removeZero(const RecursivePoly& p) const;
188  // TODO: move this to the TriangularSet class.
189 
190  /**
191  * Cut an input regular chain at the symbol v, returning the subchain below v, the polynomial with main variable v and the subchain above v.
192  *
193  * @param T: a regular chain
194  * @param v: a symbol
195  * @param Tlv: the subchain of T below v
196  * @param Tv: the recursively viewed polynomial with main variable v, if it exists
197  * @param Tgv: the subchain of T above v
198  **/
199  void cutChain(const RegularChain<Field,RecursivePoly>& T, const Symbol& v, RegularChain<Field,RecursivePoly>& Tlv, RecursivePoly& Tv, RegularChain<Field,RecursivePoly>& Tgv) const;
200 
201  /**
202  * Cut the current object at the symbol v, returning the polynomial with main variable v and the subchain above v.
203  *
204  * @param v: a symbol
205  * @param Tv: the recursively viewed polynomial with main variable v, if it exists
206  * @param Tgv: the subchain of the current object above v
207  **/
208  void cutChain(const Symbol& v, RecursivePoly& Tv, RegularChain<Field,RecursivePoly>& Tgv) const;
209 
210  /**
211  * Cut the current object at the symbol v, returning the subchain below v and the polynomial with main variable v.
212  *
213  * @param v: a symbol
214  * @param Tlv: the subchain of the current object below v
215  * @param Tv: the recursively viewed polynomial with main variable v, if it exists
216  **/
217  void cutChain(const Symbol& v, RegularChain<Field,RecursivePoly>& Tlv, RecursivePoly& Tv) const;
218 
219  /**
220  * Cut the current object at the symbol v and return the subchain above v.
221  *
222  * @param v: a symbol
223  * @param[out] Tgv: the upper subchain
224  */
225  void upper(const Symbol& v, RegularChain<Field, RecursivePoly>& Tgv) const;
226 
227  /**
228  * Cut the current object at the symbol v and return the subchain below v.
229  *
230  * @param v: a symbol
231  * @param[out] Tlv: the lower subchain
232  */
233  void lower(const Symbol& v, RegularChain<Field, RecursivePoly>& Tlv) const;
234 
235  /**
236  * A protected internal routine to regularize a list of polynomials with respect to the current object.
237  *
238  * @param knownRegular: a list of polynomials known to be regular modulo the saturated ideal of the current object
239  * @param unknownIfRegular: a list of polynomials for which it is not known if they are regular or not wrt the current object
240  * @param singularComponents: a list of regular chains consisting of those components of the current object over which some element
241  * of both knownRegular and unknownIfRegular is zero
242  * @param regularComponents: a list of regular chains consisting of those components of the current object over which each element
243  * of both knownRegular and unknownIfRegular is regular
244  **/
245  void regularizeList(const std::vector<RecursivePoly>& knownRegular, const std::vector<RecursivePoly>& unknownIfRegular, std::vector<RegularChain<Field,RecursivePoly>>& singularComponents, std::vector<RegularChain<Field,RecursivePoly>>& regularComponents, bool lazardDecompose, int heightBound) const;
246 
247  /**
248  * A protected internal routine to regularize a list of polynomials with respect to the current object.
249  *
250  * @param knownRegular: a list of polynomials known to be regular modulo the saturated ideal of the current object
251  * @param unknownIfRegular: a list of polynomials for which it is not known if they are regular or not wrt the current object
252  * @param results: a list of pairs of polynomials and regular chains
253  **/
254  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
255  void regularizeListStream(const RecursivePoly& p, const std::vector<RecursivePoly>& knownRegular, const std::vector<RecursivePoly>& unknownIfRegular, bool lazardDecompose, int heightBound, AsyncGenerator<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>& results) const;
256  #else
257  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularizeListStream(const RecursivePoly& p, const std::vector<RecursivePoly>& knownRegular, const std::vector<RecursivePoly>& unknownIfRegular, bool lazardDecompose, int heightBound) const;
258  #endif
259 
260  /**
261  * Add an input polynomial to the current object
262  *
263  * @param p: A recursively viewed polynomial
264  * @param options: a bitwise or of RegularChainOption values (default assume that init(p) is regular modulo the saturated ideal of the current object)
265  **/
266  void constructChain(const RecursivePoly& p, int options=ASSUME_REGULAR);
267 
268  /**
269  * Construct a regular chain from the current object and an input regular chain known to have polynomials
270  * with main variable greater than any in the current object.
271  *
272  * @param T: An upper regular chain
273  * @param options: a bitwise or of RegularChainOption values
274  **/
275  void constructChain(const RegularChain<Field,RecursivePoly>& T, int options);
276 
277  /**
278  * Construct a set of regular chains from the current object and an input polynomial known to have main
279  * variable greater than any in the current object.
280  * Here, the parameter options is information about the p being added.
281  *
282  * @param p: A recursively viewed polynomial
283  * @param options: a bitwise or of RegularChainOption values (default assume init(p) is regular modulo the saturated ideal of current object)
284  **/
285  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
286  void constructChainsFromPoly(const RecursivePoly& p, bool lazardDecompose, int heightBound, int options, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
287  #else
288  std::vector<RegularChain<Field,RecursivePoly>> constructChainsFromPoly(const RecursivePoly& p, bool lazardDecompose, int heightBound, int options=ASSUME_REGULAR) const;
289  #endif
290 
291  /**
292  * Construct a set of regular chains from the current object and an input regular chain above the current object, when splitting can occur to impose
293  * the condition that the regular chains are squarefree.
294  * Here, the parameter options is information about the polys in the chain being added on top.
295  *
296  * @param T: An upper regular chain
297  * @param options: a bitwise or of RegularChainOption values (default assume that the initials of T are regular modulo the saturated ideal of the current object)
298  **/
299  std::vector<RegularChain<Field,RecursivePoly>> constructChainsFromChain(const RegularChain<Field,RecursivePoly>& T, bool lazardDecompose, int heightBound, int options) const;
300 
301  /**
302  * Return the intersection of the zero sets of an input polynomial and the current regular chain, when the main variable
303  * of the input is not algebraic.
304  *
305  * @param p: a recursively viewed polynomial
306  * @param v: the main variable of p
307  **/
308  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
309  void intersectFree(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
310  #else
311  std::vector<RegularChain<Field,RecursivePoly>> intersectFree(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound) const;
312  #endif
313 
314  /**
315  * Return the intersection of the zero sets of an input polynomial, an input regular chain and the current regular chain, when the main variable
316  * of the input is algebraic.
317  *
318  * @param p: a recursively viewed polynomial
319  * @param T: a regular chain acting as an additional constraint
320  * @param v: the main variable of p
321  * @param src: the subresultant chain of p and the polynomial of the current object with main variable v
322  **/
323  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
324  void intersectAlgebraic(const RecursivePoly& p, const RegularChain<Field,RecursivePoly>& T, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose, int heightBound, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
325  #else
326  std::vector<RegularChain<Field,RecursivePoly>> intersectAlgebraic(const RecursivePoly& p, const RegularChain<Field,RecursivePoly>& T, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose, int heightBound) const;
327  #endif
328 
329  /**
330  * A routine to clean an input regular chain wrt the current object.
331  * More precisely, if the current object has a polynomial with main variable v, the routine returns a set of regular
332  * chains T_j with larger radical saturated ideal than that of in the input chain C (specializations of C) such that T_j+Tv is
333  * a regular chain, and the quasi-component of C minus the variety of init(Tv) is contained within the
334  * union of the quasi-components of the T_j; otherwise it returns C.
335  *
336  * @param C: a regular chain with larger radical saturated ideal than that of T<v (specialization of T<v), where T is the current object
337  * @param v: a (potentially algebriac) variable of the current object
338  **/
339  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
340  void cleanChain(const RegularChain<Field,RecursivePoly>& C, const Symbol& v, bool lazardDecompose, int heightBound, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
341  #else
342  std::vector<RegularChain<Field,RecursivePoly>> cleanChain(const RegularChain<Field,RecursivePoly>& C, const Symbol& v, bool lazardDecompose, int heightBound) const;
343  #endif
344 
345  /**
346  * A routine to regularize a polynomial modulo the saturated ideal of the current object.
347  *
348  * @param p: a recursively viewed polynomial
349  **/
350  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
351  void regularizeSingle(const RecursivePoly& p, bool lazardDecompose, int heightBound, AsyncGenerator<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>& results) const;
352  #else
353  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularizeSingle(const RecursivePoly& p, bool lazardDecompose, int heightBound) const;
354  #endif
355 
356  /**
357  * Compute a factorization of the input such that the returned vector of polynomials
358  * pairwise gcd 1.
359  *
360  * @param p: a recursively viewed polynomial
361  * @param type: a flag to determine the type of factorization [0: none, 1: primitive, 2: irreducible, 3: squareFree] (default is 1)
362  **/
363  std::vector<RecursivePoly> GCDFreeFactorization(const RecursivePoly& p, int type = 2) const;
364 
365  /**
366  * A routine to extend the current object to a list of regular chains corresponding to adding the polynomial p and
367  * requiring that p is regular modulo the saturated ideal of the current object.
368  *
369  * @param p: a recursively viewed polynomial with main variable greater than any algebraic variable of the current object
370  **/
371  std::vector<RegularChain<Field,RecursivePoly>> extend(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound) const;
372 // std::vector<RegularChain<Field,RecursivePoly>> extend(const RecursivePoly& p, const Symbol& v) const;
373 
374  /**
375  * A routine to extend the current object with a list of polynomials
376  *
377  * @param T: a vector of recursively viewed polynomials with main variables greater than any algebraic variable of the current object
378  **/
379  std::vector<RegularChain<Field,RecursivePoly>> extend(const std::vector<RecursivePoly>& T, const Symbol& v, bool lazardDecompose, int heightBound) const;
380 // std::vector<RegularChain<Field,RecursivePoly>> extend(const std::vector<RecursivePoly>& T, const Symbol& v) const;
381 
382  /**
383  * A routine to extend the current object with an upper regular chain.
384  *
385  * @param T: a regular chain with algebraic variables greater than any algebraic variable of the current object.
386  **/
387  std::vector<RegularChain<Field,RecursivePoly>> extend(const RegularChain<Field,RecursivePoly>& T, const Symbol& v, bool lazardDecompose, int heightBound) const;
388 // std::vector<RegularChain<Field,RecursivePoly>> extend(const RegularChain<Field,RecursivePoly>& T, const Symbol& v) const;
389 
390  /**
391  * A routine that decomposes the regular chain formed from the current object and an input polynomial into a set of squarefree regular chains.
392  *
393  * @param p: a squarefree recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
394  * @param v: the main variable of p
395  * @param src: the subresultant chain of p and p'
396  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
397  **/
398  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
399  void _squareFreePartInner(const RecursivePoly& p, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose, int heightBound, int options, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
400  #else
401  std::vector<RegularChain<Field,RecursivePoly>> _squareFreePartInner(const RecursivePoly& p, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose, int heightBound, int options) const;
402  #endif
403 
404  /**
405  * A routine that decomposes the regular chain formed from the current object and an input polynomial into a set of squarefree regular chains.
406  *
407  * @param p: a recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
408  * @param v: the main variable of p
409  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
410  **/
411  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
412  void _squareFreePart(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound, int options, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
413  #else
414  std::vector<RegularChain<Field,RecursivePoly>> _squareFreePart(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound, int options) const;
415  #endif
416 
417  /**
418  * A routine that decomposes the current object into a set of pairs of polynomials and regular chains, where the
419  * polynomial is the squarefree part of the input modulo the corresponding regular chain.
420  *
421  * @param p: a squarefree recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
422  * @param v: the main variable of p
423  * @param src: the subresultant chain of p and p'
424  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
425  **/
426  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
427  void _squareFreePartPolynomialInner(const RecursivePoly& p, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose, int heightBound, int options, AsyncGenerator<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>& results) const;
428  #else
429  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> _squareFreePartPolynomialInner(const RecursivePoly& p, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose, int heightBound, int options) const;
430  #endif
431 
432  /**
433  * A routine that decomposes the current object into a set of pairs of polynomials and regular chains, where the
434  * polynomial is the squarefree part of the input modulo the corresponding regular chain.
435  *
436  * @param p: a recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
437  * @param v: the main variable of p
438  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
439  **/
440  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
441  void _squareFreePartPolynomial(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound, int options, AsyncGenerator<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>& results) const;
442  #else
443  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> _squareFreePartPolynomial(const RecursivePoly& p, const Symbol& v, bool lazardDecompose, int heightBound, int options) const;
444  #endif
445 
446  /**
447 // * Merge two lists of regular chains that are each pairwise irredundant to form a single list of pairwise irredundant chains.
448 // *
449 // * @param lrc1: a list of pairwise irredundant regular chains
450 // * @param lrc2: a list of pairwise irredundant regular chains
451 // **/
452 // static std::vector<RegularChain<Field,RecursivePoly>> mergeIrredundantLists(const std::vector<RegularChain<Field,RecursivePoly>>& lrc1, const std::vector<RegularChain<Field,RecursivePoly>>& lrc2);
453 
454 // /**
455 // * Compare two lists of regular chains to find those components of the first list are not contained in a component of an element in the second list.
456 // *
457 // * @param lrc1: the first list of regular chains
458 // * @param lrc2: the second list of regular chains
459 // **/
460 // static std::vector<RegularChain<Field,RecursivePoly>> oneSideCompare(const std::vector<RegularChain<Field,RecursivePoly>>& lrc1, const std::vector<RegularChain<Field, RecursivePoly>>& lrc2);
461 //
462 // /**
463 // * Determine which components of a list of regular chains are not contained in a given regular chain
464 // *
465 // * @param lrc: a list of regular chains
466 // * @param rc: a regular chain
467 // **/
468 // static std::vector<RegularChain<Field,RecursivePoly>> oneSideCompare(const std::vector<RegularChain<Field,RecursivePoly>>& lrc, const RegularChain<Field,RecursivePoly>& rc);
469 //
470 // /**
471 // * Find any components of the first regular chain that are not contained in a component of the second regular chain.
472 // *
473 // * @param rc1: the first regular chain
474 // * @param rc2: the second regular chain
475 // **/
476 // static std::vector<RegularChain<Field,RecursivePoly>> oneSideCompare(const RegularChain<Field,RecursivePoly>& rc1, const RegularChain<Field,RecursivePoly>& rc2);
477 
478 
479  /**
480  * Compute the gcd of two input polynomials p and q modulo the saturated ideal of the current object. The result is a list of pairs (g_i,T_i) of
481  * polynomials g_i and regular chains T_i, where g_i is gcd(p,q) modulo the saturated ideal of T_i.
482  *
483  * @param p: a recursively viewed polynomial
484  * @param q: a recursively viewed polynomial
485  * @param v: the common main variable of p and q
486  * @param src: the subresultant chain of p and q
487  **/
488  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
489  void _regularGCD(const RecursivePoly& p, const RecursivePoly& q, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& S, bool lazardDecompose, int inputHeightBound, AsyncGenerator<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>& results) const;
490  #else
491  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> _regularGCD(const RecursivePoly& p, const RecursivePoly& q, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose = false, int heightBound = 0) const;
492  #endif
493 
494  /**
495  * Compute a decomposition of the current object such that on each component the input polynomial is either
496  * zero or regular modulo the saturated ideal of that component. If the polynomial is zero, (0, T_i) is returned;
497  * if the polynomial is regular, (p_i, T_i), is returned, where p_i is equivalent to p modulo the saturated ideal of T_i.
498  *
499  * @param p: a recursively viewed polynomial
500  **/
501  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
502  void _regularize(const RecursivePoly& p, bool lazardDecompose, int heightBound, AsyncGenerator<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>>& results) const;
503  #else
504  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> _regularize(const RecursivePoly& p, bool lazardDecompose, int heightBound) const;
505  #endif
506 
507  /**
508  * Compute the common solutions of the input polynomial and the current regular chain.
509  * More precisely, this routine computes the intersection of the varieties of the input polynomial and the
510  * current regular chain, expressed as a set of regular chains.
511  *
512  * @param p: a recursively viewed polynomial
513  **/
514  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
515  void _intersect(const RecursivePoly& p, bool lazardDecompose, int inputHeightBound, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
516  #else
517  std::vector<RegularChain<Field,RecursivePoly>> _intersect(const RecursivePoly& p, bool lazardDecompose, int inputHeightBound) const;
518  #endif
519 
520  /**
521  * Compute a triangular decomposition of the list of input polynomials.
522  *
523  * @param polys: a vector of recursively viewed polynomials
524  * @param chains: a vector of regular chains
525  * @param lazardDecompose: whether to compute a Lazard decomposition
526  **/
527  #if defined(RC_WITH_GENERATORS) && RC_WITH_GENERATORS
528  void _triangularize(const std::vector<RecursivePoly>& polys, const std::vector<RegularChain<Field,RecursivePoly>>& chains, bool lazardDecompose, int heightBound, AsyncGenerator<RegularChain<Field,RecursivePoly>>& results) const;
529  #else
530  std::vector<RegularChain<Field,RecursivePoly>> _triangularize(const std::vector<RecursivePoly>& polys, std::vector<RegularChain<Field,RecursivePoly>>& chains, bool lazardDecompose, int heightBound) const;
531  #endif
532 
533  std::vector<RegularChain<Field,RecursivePoly>> _triangularizeByTasks(std::vector<RecursivePoly>& polys, bool lazardDecompose, int heightBound) const;
534 
535  friend void triangularizeTask<Field,RecursivePoly>(const RegularChain<Field, RecursivePoly>& rc, std::vector<RecursivePoly>& polys, bool lazardDecompose, int heightBound, TaskScheduler* tasks, std::shared_ptr<SynchronizedWriteVector<RegularChain<Field,RecursivePoly>>> results);
536 
537  friend void intersectOne<Field,RecursivePoly>(int j, const RegularChain<Field, RecursivePoly>& T, const RecursivePoly& p, int lazardDecompose, int heightBound, SynchronizedWriteVector<RegularChain<Field,RecursivePoly>>&);
538 
539  std::vector<RegularChain<Field,RecursivePoly>> intersectTrivial(const RecursivePoly& p) const;
540 
541  bool isIntersectionTrivial(const RecursivePoly& p, RecursivePoly& pReduced) const;
542 
543  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularizeTrivial(const RecursivePoly& p, const RecursivePoly& pReduced) const;
544 
545  bool isRegularizationTrivial(const RecursivePoly& p, RecursivePoly& pReduced) const;
546 
547  RecursivePoly moduloPolysWithConstantInitial(const RecursivePoly& p_in) const;
548 
549  std::vector<RecursivePoly> factorPolynomial(const RecursivePoly& p) const;
550 
551  public:
552 
554 
555  /**
556  * Default constructor: creates an empty regular chain of variable size
557  * with empty list of transcendentals.
558  *
559  * @param
560  **/
562 
563  /**
564  * Construct an empty fixed variable list regular chain in the decreasingly ordered
565  * variables given by xs with empty list of transcendentals.
566  *
567  * @param xs: The variable names
568  **/
569  RegularChain<Field,RecursivePoly> (const std::vector<Symbol>& xs);
570 
571  /**
572  * Construct an empty fixed variable list regular chain in the decreasingly ordered
573  * variables given by xs and list of transcendentals given by ts.
574  *
575  * @param xs: The variable names
576  * @param ts: The transcendental variable names
577  **/
578  RegularChain<Field,RecursivePoly> (const std::vector<Symbol>& xs, const std::vector<Symbol>& ts);
579 
580  /**
581  * Construct a variable regular chain containing p, such that the variables of p are treated as algebraic,
582  * with empty list of transcendentals
583  *
584  * @param p: The polynomial to add
585  **/
586  RegularChain<Field,RecursivePoly> (const RecursivePoly& p);
587 
588  /**
589  * Construct a variable regular chain containing p, such that the variables in ts are
590  * treated as transcendental, while any remaining variables of p are treated as algebraic
591  *
592  * @param p: The polynomial to add
593  * @param ts: The transcendental variable names
594  **/
595  RegularChain<Field,RecursivePoly> (const RecursivePoly& p, const std::vector<Symbol>& ts);
596 
597  /**
598  * Construct a fixed regular chain containing the polynomials in polys.
599  * It is assumed that the polynomials in polys form a valid regular chain.
600  *
601  * @param polys: a list of recursively viewed polynomials.
602  *
603  */
604  RegularChain<Field,RecursivePoly> (const std::vector<RecursivePoly> polys);
605 
606  /**
607  * Copy constructor taking a zero-dimensional regular chain as input.
608  *
609  * @param a: A zero-dimensional regular chain
610  **/
612 
613  /**
614  * Copy constructor.
615  *
616  * @param a: A regular chain
617  **/
619 
620  /**
621  * Copy constructor taking a triangular set as input, assuming that the triangular set is a regular chain.
622  *
623  * @param a: A triangular set
624  **/
626 
627  /**
628  * Move constructor taking an r-value zero-dimensional regular chain as input.
629  *
630  * @param a: An r-value reference zero-dimensional regular chain
631  **/
633 
634  /**
635  * Move constructor.
636  *
637  * @param a: An r-value reference regular chain
638  **/
640 
641  /**
642  * Move constructor taking an r-value triangular set as input, assuming that the triangular set is a regular chain.
643  *
644  * @param a: An r-value reference triangular set
645  **/
647 
648  /**
649  * Computational constructor: creates a regular chain given all the data.
650  *
651  * @param vs: rvalue reference to variables of the regular chain
652  * @param avs: rvalue reference to algebraic variables of the regular chain
653  * @param tvs: rvalue reference to transcendental variables of the regular chain
654  * @param polys: rvalue reference to polynomials of the regular chain
655  * @param tsm: whether the regular chain is variable or fixed
656  * @param c: characteristic of the regular chain
657  **/
658  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);
659 
660  /**
661  * Construct a set of regular chains from an input triangular set by triangularizing the elements of the input.
662  *
663  * @param T: A triangular set
664  **/
665  static std::vector<RegularChain<Field,RecursivePoly>> constructChains(const TriangularSet<Field,RecursivePoly>& T);
666 
667  /**
668  * Assignment operator = for a zero-dimensional regular chain.
669  *
670  * @param a: A regular chain
671  **/
673 
674  /**
675  * Assignment operator =.
676  *
677  * @param a: A regular chain
678  **/
680 
681 
683 
684  /**
685  * Assignment operator = imposed by abstract class BPASTriangularSet.
686  *
687  * @param a: A triangular set
688  **/
690 
691  /**
692  * Assignment operator = imposed by abstract class BPASRegularChain.
693  *
694  * @param a: A regular chain
695  **/
697 
698  /**
699  * Move assignment operator = taking an r-value zero-dimensional regular chain as input.
700  *
701  * @param a: An r-value reference zero-dimensional regular chain
702  **/
704 
705  /**
706  * Move assignment operator =.
707  *
708  * @param a: An r-value reference regular chain
709  **/
711 
713 
714  /**
715  * Move assignment operator = imposed by abstract class BPASTriangularSet.
716  *
717  * @param a: An r-value reference triangular set
718  **/
720 
721  /**
722  * Move assignment operator = imposed by abstract class BPASRegularChain.
723  *
724  * @param a: An r-value reference regular chain
725  **/
727 
728  /**
729  * Add operator +:
730  * Adds a polynomial to a regular chain and returns a new regular chain, assuming that the
731  * main variable of p is above any in the current object and that init(p) is regular modulo
732  * the saturated ideal of the current object.
733  *
734  * @param p: A recursively viewed polynomial
735  **/
736  RegularChain<Field,RecursivePoly> operator+ (const RecursivePoly& p) const;
737 
738  /**
739  * Add assignment operator +=:
740  * Adds a polynomial to a regular chain, assuming that the main variable of p is above any in
741  * the current object and that init(p) is regular modulo the saturated ideal of the current object.
742  *
743  * @param p: A recursively viewed polynomial
744  **/
745  RegularChain<Field,RecursivePoly>& operator+= (const RecursivePoly& p);
746 
747  /**
748  * Add operator +:
749  * Adds a regular chain to a regular chain and returns a new regular chain, assuming that the
750  * input is above the current object and the result of adding the chains is a regular chain.
751  *
752  * @param p: A regular chain
753  **/
755 
756  /**
757  * Add assignment operator +=:
758  * Adds a regular chain to a regular chain, assuming that the
759  * input is above the current object and the result adding the chains is a regular chain.
760  *
761  * @param p: A regular chain
762  **/
764 
765  /**
766  * Identity operator ==.
767  *
768  * @param a: A regular chain
769  **/
770  bool operator== (const RegularChain<Field,RecursivePoly>& a) const;
771 
772  /**
773  * Negated identity operator !=.
774  *
775  * @param a: A regular chain
776  **/
777  bool operator!= (const RegularChain<Field,RecursivePoly>& a) const;
778 
779  /**
780  * Get the number of (potentially algebraic) variables in the current object.
781  *
782  * @param
783  **/
784  inline int numberOfVariables() const {
786  }
787 
788  /**
789  * Get the encoded options of the regular chain, a bitwise or of RegularChainOption values.
790  *
791  * @param
792  **/
793  int options() const;
794 
795  /**
796  * Set the encoded options of the regular chain.
797  *
798  * @param opts: bitwise or of RegularChainOption values
799  **/
800  void setOptions(int opts);
801 
802 
803  /**
804  * Find out if the regular chain is known to be squarefree.
805  *
806  * @param
807  **/
808  bool isSquareFree() const {
809  return squareFreeLevel >= algVars.size();
810  }
811 
812  bool isSaturatedIdealPrime() const {
813  return saturatedIdealPrimeLevel >= algVars.size();
814  }
815 
816  /**
817  * Efficiently find out if the input polynomial is in the saturated ideal of the current regular chain.
818  *
819  * @param p: a recursively viewed polynomial
820  **/
821  bool isInSaturatedIdealMinimal(const RecursivePoly& p) const;
822 
823  bool isInSaturatedIdealMinimal_inner(const RecursivePoly& p) const;
824 
825 
826  /**
827  * Find out if the input polynomial is in the saturated ideal of the current regular chain.
828  *
829  * @param p: a recursively viewed polynomial
830  **/
831  bool isInSaturatedIdeal(const RecursivePoly& p) const;
832 
833  /**
834  * Find out if the input polynomial is in the saturated ideal of the current regular chain.
835  * and return the reduced input polynomial.
836  *
837  * @param p: a recursively viewed polynomial
838  **/
839  bool isInSaturatedIdeal(const RecursivePoly& p, RecursivePoly& redp) const;
840 
841  /**
842  * Find out if the input polynomial is in the radical saturated ideal of the current regular chain.
843  *
844  * @param p: a recursively viewed polynomial
845  **/
846  bool isInRadicalSaturatedIdeal(const RecursivePoly& p) const;
847 
848  /**
849  * Find out if the input polynomial is regular modulo the saturated ideal of the current regular chain.
850  *
851  * @param p: a recursively viewed polynomial
852  **/
853  bool isRegular(const RecursivePoly& p) const;
854 
855  /**
856  * Using a modular method determine if the iterated resultant of p and this regular chain is zero or not.
857  *
858  * @param p: a recursively viewed polynomial
859  * @return true iff the iterated resultant is zero.
860  */
861  bool isIteratedResultantZeroModular(const RecursivePoly& p) const;
862 
863 
864  /**
865  * Determine whether or not the quasicomponent of the first regular chain is contained in the quasicomponent of the second
866  * using a certified method that returns true if the first is contained in the second and false if not.
867  *
868  * @param rc1: the first regular chain
869  * @param rc1: the second regular chain
870  **/
872 
873  /**
874  * Determine whether or not the quasicomponent of the first regular chain is contained in the quasicomponent of the second
875  * using a heuristic method that returns true when the first is contained in the second and false when no conclusion is possible.
876  *
877  * @param rc1: the first regular chain
878  * @param rc1: the second regular chain
879  **/
881 
882  /**
883  * Remove redundancy from the input list of regular chains.
884  *
885  * @param lrc: a list of regular chains
886  **/
887  static void removeRedundantChains(const std::vector<RegularChain<Field,RecursivePoly>>& lrc, std::vector<RegularChain<Field,RecursivePoly>>& results);
888 // static std::vector<RegularChain<Field,RecursivePoly>> removeRedundantChains(const std::vector<RegularChain<Field,RecursivePoly>>& lrc);
889 
890  /**
891  * Get the (potentially algebriac) variable names in decreasing order.
892  *
893  * @param
894  **/
895  inline std::vector<Symbol> variables() const {
897  }
898 
899  /**
900  * Select the polynomial in the current object with main variable s, if it exists.
901  *
902  * @param s: a symbol
903  **/
904  inline RecursivePoly select(const Symbol& s) const {
906  }
907 
908  /**
909  * Returns the regular chain consisting of polynomials with
910  * main variable strictly less than s.
911  *
912  * @param s: symbol of the main variable of specified element of the regular chain
913  * @param ts: The returned regular chain
914  **/
915  void lower(const Symbol& s, BPASTriangularSet<Field,RecursivePoly>& ts) const;
916 
917  /**
918  * Returns the regular chain consisting of polynomials with
919  * main variable strictly greater than s.
920  *
921  * @param s: symbol of the main variable of specified element of the regular chain
922  * @param ts: The returned regular chain
923  **/
924  void upper(const Symbol& s, BPASTriangularSet<Field,RecursivePoly>& ts) const;
925 
926  /**
927  * Destructively converts the current object into lower(s) by changing the set of
928  * (potentially algebraic) variables to be only those below s in the variable order.
929  *
930  * @param s: symbol of the main variable of specified element of the regular chain
931  **/
932  void lowerSlice(const Symbol& s);
933 
934  /**
935  * Compute a triangular decomposition of the list of input polynomials.
936  *
937  * @param F: a vector of recursively viewed polynomials
938  * @param type: a flag to determine what strategy to use (type = 0 processes tasks as they are generated, type = 1 process by level of the
939  * tree of chains generted in the decomposition process)
940  **/
941  std::vector<RegularChain<Field,RecursivePoly>> triangularize(const std::vector<RecursivePoly>& F, bool lazardDecompose = false, int type = 0);
942 
943  /**
944  * Compute the common solutions of the input polynomial and the current regular chain.
945  * More precisely, this routine computes the intersection of the varieties of the input polynomial and the
946  * current regular chain, expressed as a set of regular chains.
947  *
948  * @param p: a recursively viewed polynomial
949  **/
950  std::vector<RegularChain<Field,RecursivePoly>> intersect(const RecursivePoly& p, bool lazardDecompose = false, int heightBound = 0) const;
951 // std::vector<RegularChain<Field,RecursivePoly>> intersect(const RecursivePoly& p) const;
952 
953  /**
954  * Compute a decomposition of the current object such that on each component the input polynomial is either
955  * zero or regular modulo the saturated ideal of that component. If the polynomial is zero, (0, T_i) is returned;
956  * if the polynomial is regular, (p_i, T_i), is returned, where p_i is equivalent to p modulo the saturated ideal of T_i.
957  *
958  * @param p: a recursively viewed polynomial
959  **/
960  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularize(const RecursivePoly& p, bool lazardDecompose = false, int heightBound = 0) const;
961 // std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularize(const RecursivePoly& p) const;
962 
963  /**
964  * Compute the gcd of two input polynomials p and q modulo the saturated ideal of the current object. The result is a list of pairs (g_i,T_i) of
965  * polynomials g_i and regular chains T_i, where g_i is gcd(p,q) modulo the saturated ideal of T_i.
966  *
967  * @param p: a recursively viewed polynomial
968  * @param q: a recursively viewed polynomial
969  * @param v: the common main variable of p and q
970  * @param src: the subresultant chain of p and q
971  **/
972  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularGCD(const RecursivePoly& p, const RecursivePoly& q, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, bool lazardDecompose = false, int heightBound = 0) const;
973 
974  /**
975  * A routine that decomposes the regular chain formed from the current object and an input polynomial into a set of squarefree regular chains.
976  *
977  * @param p: a recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
978  * @param v: the main variable of p
979  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
980  **/
981  std::vector<RegularChain<Field,RecursivePoly>> squareFreePart(const RecursivePoly& p, const Symbol& v, bool lazardDecompose = false, int heightBound = 0, int options=ASSUME_REGULAR) const;
982 
983 
984  /**
985  * Generate a random regular chain based on the number of terms of the polynomials in the chain.
986  *
987  * @param nVars: number of variables
988  * @param nAlgVars: number of algebraic variables
989  * @param nTrcVars: number of transcendental variables
990  * @param nTerms: number of terms in each polynomial
991  * @param coefBound: bound on the coefficient size
992  * @param pSparsity: sparsity of the polynomial in the term separation sense
993  * @param includeNeg: whether to include negative coefficients
994  *
995  **/
996  void randomRegularChain(int nVars, int nAlgVars, int nTrcVars, int nTerms, unsigned long int coefBound, int pSparsity, bool includeNeg);
997 
998  /**
999  * Generate a random regular chain based on a list of maximum degrees of variables in the polynomials in the chain.
1000  *
1001  * @param nVars: number of variables
1002  * @param nAlgVars: number of algebraic variables
1003  * @param nTrcVars: number of transcendental variables
1004  * @param maxDegs: maximum degrees among the full list of variables
1005  * @param coefBound: bound on the coefficient size
1006  * @param pSparsity: sparsity of the polynomial in the term separation sense
1007  * @param includeNeg: whether to include negative coefficients
1008  *
1009  **/
1010  void randomRegularChain(int nVars, int nAlgVars, int nTrcVars, std::vector<int> maxDegs, unsigned long int coefBound, double pSparsity, bool includeNeg);
1011 
1012  /**
1013  * Reduce the polynomials of the input vector modulo the saturated ideal of the current object and detect any obvious inconsistency among the set.
1014  *
1015  * @param polys: a vector of recursively viewed polynomials
1016  **/
1017  bool cleanSet(std::vector<RecursivePoly>& polys) const;
1018 // bool cleanSet(const std::vector<RecursivePoly>& inPolys, std::vector<RecursivePoly>& outPolys) const;
1019 
1020 };
1021 
1022 #endif
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:44
std::vector< Symbol > variables() const
Get the variable names in decreasing order.
Definition: triangularset.hpp:311
Definition: regularchain.hpp:64
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
bool isSquareFree() const
Find out if the regular chain is known to be squarefree.
Definition: regularchain.hpp:808
A class for handling regular chains in dimension zero.
Definition: regularchain.hpp:61
static void removeRedundantChains(const std::vector< RegularChain< Field, RecursivePoly >> &lrc, std::vector< RegularChain< Field, RecursivePoly >> &results)
Remove redundancy from the input list of regular chains.
RecursivePoly select(const Symbol &s) const
Select a polynomial given the leading variable; if no such polynomial, 0 is returned.
RecursivePoly select(const Symbol &s) const
Select the polynomial in the current object with main variable s, if it exists.
Definition: regularchain.hpp:904
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...
bool isInSaturatedIdealMinimal(const RecursivePoly &p) const
Efficiently find out if the input polynomial is in the saturated ideal of the current regular chain...
void setOptions(int opts)
Set the encoded options of the regular chain.
bool cleanSet(std::vector< RecursivePoly > &polys) const
Reduce the polynomials of the input vector modulo the saturated ideal of the current object and detec...
std::vector< PolyChainPair< RecursivePoly, RegularChain< Field, RecursivePoly > > > regularGCD(const RecursivePoly &p, const RecursivePoly &q, const Symbol &v, const SubResultantChain< RecursivePoly, RecursivePoly > &src, bool lazardDecompose=false, int heightBound=0) const
Compute the gcd of two input polynomials p and q modulo the saturated ideal of the current object...
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< Symbol > variables() const
Get the (potentially algebriac) variable names in decreasing order.
Definition: regularchain.hpp:895
bool isIteratedResultantZeroModular(const RecursivePoly &p) const
Using a modular method determine if the iterated resultant of p and this regular chain is zero or not...
static std::vector< RegularChain< Field, RecursivePoly > > constructChains(const TriangularSet< Field, RecursivePoly > &T)
Construct a set of regular chains from an input triangular set by triangularizing the elements of the...
bool operator!=(const RegularChain< Field, RecursivePoly > &a) const
Negated identity operator !=.
int options() const
Get the encoded options of the regular chain, a bitwise or of RegularChainOption values.
std::vector< RegularChain< Field, RecursivePoly > > squareFreePart(const RecursivePoly &p, const Symbol &v, bool lazardDecompose=false, int heightBound=0, int options=ASSUME_REGULAR) const
A routine that decomposes the regular chain formed from the current object and an input polynomial in...
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.
std::vector< RegularChain< Field, RecursivePoly > > triangularize(const std::vector< RecursivePoly > &F, bool lazardDecompose=false, int type=0)
Compute a triangular decomposition of the list of input polynomials.
bool operator==(const RegularChain< Field, RecursivePoly > &a) const
Identity operator ==.
std::vector< RegularChain< Field, RecursivePoly > > intersect(const RecursivePoly &p, bool lazardDecompose=false, int heightBound=0) const
Compute the common solutions of the input polynomial and the current regular chain.
A class for handling regular chains of arbitrary dimension.
Definition: regularchain.hpp:69
int numberOfVariables() const
Get the number of (potentially algebraic) variables in the current object.
Definition: regularchain.hpp:784
An encapsulation of a mathematical symbol.
Definition: Symbol.hpp:23
RegularChain< Field, RecursivePoly > & operator=(const ZeroDimensionalRegularChain< Field, RecursivePoly > &a)
Assignment operator = for a zero-dimensional regular chain.
std::vector< PolyChainPair< RecursivePoly, RegularChain< Field, RecursivePoly > > > regularize(const RecursivePoly &p, bool lazardDecompose=false, int heightBound=0) const
Compute a decomposition of the current object such that on each component the input polynomial is eit...
An abstract class defining the interface of a regular chain.
Definition: BPASRegularChain.hpp:11
bool isInRadicalSaturatedIdeal(const RecursivePoly &p) const
Find out if the input polynomial is in the radical saturated ideal of the current regular chain...
bool isRegular(const RecursivePoly &p) const
Find out if the input polynomial is regular modulo the saturated ideal of the current regular chain...