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