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