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