Basic Polynomial Algebra Subprograms (BPAS)  v. 1.652
regularchain.hpp
1 #ifndef _REGULARCHAIN_H_
2 #define _REGULARCHAIN_H_
3 
4 #include "../TriangularSet/triangularset.hpp"
5 #include "../SubResultantChain/subresultantchain.hpp"
6 #include "../polynomial.h"
7 #include "chainstructures.hpp"
8 
9 template <class Field, class RecursivePoly>
11 
12 /**
13  * An enumeration for various options passed to certain routines of the regular chain classes.
14  **/
15 enum RegularChainOption {
16  ASSUME_REGULAR = 0x001,
17  ASSUME_REDUCED = 0x002,
18  ASSUME_PRIMITIVE = 0x004,
19  ASSUME_SQUAREFREE = 0x008,
20  ASSUME_ZERODIMENSIONAL = 0x010,
21  ASSUME_MAKESCHAIN = 0x020,
22  MAINTAIN_SQUAREFREE = 0x040,
23  MAINTAIN_NORMALIZED = 0x080,
24  MAINTAIN_PRIME = 0x100,
25  CHECK_REGULAR = 0xffe
26 };
27 
28 /**
29  * A class for handling regular chains of arbitrary dimension.
30  * A RegularChain contains polynomials of type BPASRecursivelyViewedPolynomial, which have coefficients in a BPASField.
31  **/
32 template <class Field, class RecursivePoly>
33 class RegularChain : public TriangularSet<Field,RecursivePoly>,
34  public virtual BPASRegularChain<Field,RecursivePoly>
35 {
36  protected:
48 
49  int regularChainOptions = MAINTAIN_SQUAREFREE;
50  bool isSquareFree;
51 
52  /**
53  * Determine whether the regular chain is strongly normalized and the maximum variable
54  * of the largest strongly normalized subset of the regular chain.
55  *
56  * @param
57  **/
58  void updateRegularChainStates();
59 
60  /**
61  * Determine whether after adding p the regular chain is strongly normalized and update the maximum variable
62  * of the largest strongly normalized subset of the triangular set.
63  *
64  * @param p: a recursively viewed polynomial that has just been added to the chain
65  **/
66  void updateRegularChainStates(const RecursivePoly& p);
67 
68 // /**
69 // * A protected internal routine used by triangularize to
70 // *
71 // * @param p: a recursively viewed polynomial that has just been added to the set
72 // **/
73 // std::vector<RegularChain<Field,RecursivePoly>> triangularize_inner(std::vector<RecursivePoly>& F) const;
74 
75  /**
76  * Reduce the polynomials of the input vector modulo the saturated ideal of the current object and detect any obvious inconsistency among the set.
77  *
78  * @param polys: a vector of recursively viewed polynomials
79  **/
80  bool cleanSet(std::vector<RecursivePoly>& polys) const;
81 
82  /**
83  * 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.
84  *
85  * @param T: a regular chain
86  * @param v: a symbol
87  * @param Tlv: the subchain of T below v
88  * @param Tv: the recursively viewed polynomial with main variable v, if it exists
89  * @param Tgv: the subchain of T above v
90  **/
91  void cutRegularChain(const RegularChain<Field,RecursivePoly>& T, const Symbol& v, RegularChain<Field,RecursivePoly>& Tlv, RecursivePoly& Tv, RegularChain<Field,RecursivePoly>& Tgv) const;
92 
93  /**
94  * Cut the current object at the symbol v, returning the polynomial with main variable v and the subchain above v.
95  *
96  * @param v: a symbol
97  * @param Tv: the recursively viewed polynomial with main variable v, if it exists
98  * @param Tgv: the subchain of the current object above v
99  **/
100  void cutRegularChain(const Symbol& v, RecursivePoly& Tv, RegularChain<Field,RecursivePoly>& Tgv) const;
101 
102  /**
103  * Cut the current object at the symbol v, returning the subchain below v and the polynomial with main variable v.
104  *
105  * @param v: a symbol
106  * @param Tlv: the subchain of the current object below v
107  * @param Tv: the recursively viewed polynomial with main variable v, if it exists
108  **/
109  void cutRegularChain(const Symbol& v, RegularChain<Field,RecursivePoly>& Tlv, RecursivePoly& Tv) const;
110 
111  /**
112  * A protected internal routine to regularize a list of polynomials with respect to the current object.
113  *
114  * @param knownRegular: a list of polynomials known to be regular modulo the saturated ideal of the current object
115  * @param unknownIfRegular: a list of polynomials for which it is not known if they are regular or not wrt the current object
116  * @param singularComponents: a list of regular chains consisting of those components of the current object over which each element
117  * of both knownRegular and unknownIfRegular is zero
118  * @param regularComponents: a list of regular chains consisting of those components of the current object over which each element
119  * of both knownRegular and unknownIfRegular is regular
120  **/
121  void regularizeList(const std::vector<RecursivePoly>& knownRegular, const std::vector<RecursivePoly>& unknownIfRegular, std::vector<RegularChain<Field,RecursivePoly>>& singularComponents, std::vector<RegularChain<Field,RecursivePoly>>& regularComponents) const;
122 // std::vector<BoolChainPair<RegularChain<Field,RecursivePoly>>> areFactorsRegular(const std::vector<RecursivePoly>& factors) const;
123 
124  /**
125  * Add an input polynomial to the current object
126  *
127  * @param p: A recursively viewed polynomial
128  * @param options: a bitwise or of RegularChainOption values (default assume that init(p) is regular modulo the saturated ideal of the current object)
129  **/
130  void constructChain(const RecursivePoly& p, int options=ASSUME_REGULAR);
131 
132  /**
133  * Construct a regular chain from the current object and an input regular chain known to have polynomials
134  * with main variable greater than any in the current object.
135  *
136  * @param T: An upper regular chain
137  * @param options: a bitwise or of RegularChainOption values
138  **/
139  void constructChain(const RegularChain<Field,RecursivePoly>& T, int options);
140 
141  /**
142  * Construct a set of regular chains from the current object and an input polynomial known to have main
143  * variable greater than any in the current object.
144  *
145  * @param p: A recursively viewed polynomial
146  * @param options: a bitwise or of RegularChainOption values (default assume init(p) is regular modulo the saturated ideal of current object)
147  **/
148  std::vector<RegularChain<Field,RecursivePoly>> constructChains(const RecursivePoly& p, int options=ASSUME_REGULAR) const;
149 
150  /**
151  * 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
152  * the condition that the regular chains are squarefree.
153  *
154  * @param T: An upper regular chain
155  * @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)
156  **/
157  std::vector<RegularChain<Field,RecursivePoly>> constructChains(const RegularChain<Field,RecursivePoly>& T, int options=ASSUME_REGULAR) const;
158 
159  /**
160  * Return the intersection of the zero sets of an input polynomial and the current regular chain, when the main variable
161  * of the input is not algebraic.
162  *
163  * @param p: a recursively viewed polynomial
164  * @param v: the main variable of p
165  **/
166  std::vector<RegularChain<Field,RecursivePoly>> intersectFree(const RecursivePoly& p, const Symbol& v) const;
167 
168  /**
169  * Return the intersection of the zero sets of an input polynomial, an input regular chain and the current regular chain, when the main variable
170  * of the input is algebraic.
171  *
172  * @param p: a recursively viewed polynomial
173  * @param T: a regular chain acting as an additional constraint
174  * @param v: the main variable of p
175  * @param src: the subresultant chain of p and the polynomial of the current object with main variable v
176  **/
177  std::vector<RegularChain<Field,RecursivePoly>> intersectAlgebraic(const RecursivePoly& p, const RegularChain<Field,RecursivePoly>& T, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src) const;
178 
179  /**
180  * A routine to clean an input regular chain wrt the current object.
181  * More precisely, if the current object has a polynomial with main variable v, the routine returns a set of regular
182  * 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
183  * a regular chain, and the quasi-component of C minus the variety of init(Tv) is contained within the
184  * union of the quasi-components of the T_j; otherwise it returns C.
185  *
186  * @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
187  * @param v: a (potentially algebriac) variable of the current object
188  **/
189  std::vector<RegularChain<Field,RecursivePoly>> cleanChain(const RegularChain<Field,RecursivePoly>& C, const Symbol& v) const;
190 
191  /**
192  * A routine to regularize a polynomial modulo the saturated ideal of the current object.
193  *
194  * @param p: a recursively viewed polynomial
195  **/
196  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularizeSingle(const RecursivePoly& p) const;
197 
198  /**
199  * Compute a factorization of the input such that the returned vector of polynomials
200  * pairwise gcd 1.
201  *
202  * @param p: a recursively viewed polynomial
203  * @param type: a flag to compute a squarefree factorization rather than a primitive factorization (default is false)
204  **/
205  std::vector<RecursivePoly> GCDFreeFactorization(const RecursivePoly& p, int type = 0) const;
206 
207  /**
208  * A routine to extend the current object to a list of regular chains corresponding to adding the polynomial p and
209  * requiring that p is regular modulo the saturated ideal of the current object.
210  *
211  * @param p: a recursively viewed polynomial with main variable greater than any algebraic variable of the current object
212  **/
213  std::vector<RegularChain<Field,RecursivePoly>> extend(const RecursivePoly& p, const Symbol& v) const;
214 
215  /**
216  * A routine to extend the current object with a list of polynomials
217  *
218  * @param T: a vector of recursively viewed polynomials with main variables greater than any algebraic variable of the current object
219  **/
220  std::vector<RegularChain<Field,RecursivePoly>> extend(const std::vector<RecursivePoly>& T, const Symbol& v) const;
221 
222  /**
223  * A routine to extend the current object with an upper regular chain.
224  *
225  * @param T: a regular chain with algebraic variables greater than any algebraic variable of the current object.
226  **/
227  std::vector<RegularChain<Field,RecursivePoly>> extend(const RegularChain<Field,RecursivePoly>& T, const Symbol& v) const;
228 
229  /**
230  * A routine that decomposes the regular chain formed from the current object and an input polynomial into a set of squarefree regular chains.
231  *
232  * @param p: a squarefree recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
233  * @param v: the main variable of p
234  * @param src: the subresultant chain of p and p'
235  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
236  **/
237  std::vector<RegularChain<Field,RecursivePoly>> squareFreePart(const RecursivePoly& p, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src, int options=ASSUME_REGULAR) const;
238 
239  /**
240 // * Merge two lists of regular chains that are each pairwise irredundant to form a single list of pairwise irredundant chains.
241 // *
242 // * @param lrc1: a list of pairwise irredundant regular chains
243 // * @param lrc2: a list of pairwise irredundant regular chains
244 // **/
245 // static std::vector<RegularChain<Field,RecursivePoly>> mergeIrredundantLists(const std::vector<RegularChain<Field,RecursivePoly>>& lrc1, const std::vector<RegularChain<Field,RecursivePoly>>& lrc2);
246 
247 // /**
248 // * 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.
249 // *
250 // * @param lrc1: the first list of regular chains
251 // * @param lrc2: the second list of regular chains
252 // **/
253 // static std::vector<RegularChain<Field,RecursivePoly>> oneSideCompare(const std::vector<RegularChain<Field,RecursivePoly>>& lrc1, const std::vector<RegularChain<Field, RecursivePoly>>& lrc2);
254 //
255 // /**
256 // * Determine which components of a list of regular chains are not contained in a given regular chain
257 // *
258 // * @param lrc: a list of regular chains
259 // * @param rc: a regular chain
260 // **/
261 // static std::vector<RegularChain<Field,RecursivePoly>> oneSideCompare(const std::vector<RegularChain<Field,RecursivePoly>>& lrc, const RegularChain<Field,RecursivePoly>& rc);
262 //
263 // /**
264 // * Find any components of the first regular chain that are not contained in a component of the second regular chain.
265 // *
266 // * @param rc1: the first regular chain
267 // * @param rc2: the second regular chain
268 // **/
269 // static std::vector<RegularChain<Field,RecursivePoly>> oneSideCompare(const RegularChain<Field,RecursivePoly>& rc1, const RegularChain<Field,RecursivePoly>& rc2);
270 
271 
272  public:
273 
275 
276  /**
277  * Default constructor: creates an empty regular chain of variable size
278  * with empty list of transcendentals.
279  *
280  * @param
281  **/
283 
284  /**
285  * Construct an empty fixed variable list regular chain in the decreasingly ordered
286  * variables given by xs with empty list of transcendentals.
287  *
288  * @param xs: The variable names
289  **/
290  RegularChain<Field,RecursivePoly> (const std::vector<Symbol>& xs);
291 
292  /**
293  * Construct an empty fixed variable list regular chain in the decreasingly ordered
294  * variables given by xs and list of transcendentals given by ts.
295  *
296  * @param xs: The variable names
297  * @param ts: The transcendental variable names
298  **/
299  RegularChain<Field,RecursivePoly> (const std::vector<Symbol>& xs, const std::vector<Symbol>& ts);
300 
301  /**
302  * Construct a variable regular chain containing p, such that the variables of p are treated as algebraic,
303  * with empty list of transcendentals
304  *
305  * @param p: The polynomial to add
306  **/
307  RegularChain<Field,RecursivePoly> (const RecursivePoly& p);
308 
309  /**
310  * Construct a variable regular chain containing p, such that the variables in ts are
311  * treated as transcendental, while any remaining variables of p are treated as algebraic
312  *
313  * @param p: The polynomial to add
314  * @param ts: The transcendental variable names
315  **/
316  RegularChain<Field,RecursivePoly> (const RecursivePoly& p, const std::vector<Symbol>& ts);
317 
318  /**
319  * Copy constructor taking a zero-dimensional regular chain as input.
320  *
321  * @param a: A zero-dimensional regular chain
322  **/
324 
325  /**
326  * Copy constructor.
327  *
328  * @param a: A regular chain
329  **/
331 
332  /**
333  * Copy constructor taking a triangular set as input, assuming that the triangular set is a regular chain.
334  *
335  * @param a: A triangular set
336  **/
338 
339  /**
340  * Move constructor taking an r-value zero-dimensional regular chain as input.
341  *
342  * @param a: An r-value reference zero-dimensional regular chain
343  **/
345 
346  /**
347  * Move constructor.
348  *
349  * @param a: An r-value reference regular chain
350  **/
352 
353  /**
354  * Move constructor taking an r-value triangular set as input, assuming that the triangular set is a regular chain.
355  *
356  * @param a: An r-value reference triangular set
357  **/
359 
360  /**
361  * Computational constructor: creates a regular chain given all the data.
362  *
363  * @param vs: variables of the regular chain
364  * @param avs: algebraic variables of the regular chain
365  * @param tvs: transcendental variables of the regular chain
366  * @param polys: polynomials of the regular chain
367  * @param tsm: whether the regular chain is variable or fixed
368  * @param c: characteristic of the regular chain
369  **/
370  RegularChain<Field,RecursivePoly> (const std::vector<Symbol>& vs, const std::vector<Symbol>& avs, const std::vector<Symbol>& tvs, const std::vector<RecursivePoly>& ts, TriangularSetMode tsm, const mpz_class& c);
371 
372  /**
373  * Construct a set of regular chains from an input triangular set by triangularizing the elements of the input.
374  *
375  * @param T: A triangular set
376  **/
377  static std::vector<RegularChain<Field,RecursivePoly>> constructChains(const TriangularSet<Field,RecursivePoly>& T);
378 
379  /**
380  * Assignment operator = for a zero-dimensional regular chain.
381  *
382  * @param a: A regular chain
383  **/
385 
386  /**
387  * Assignment operator =.
388  *
389  * @param a: A regular chain
390  **/
392 
393  /**
394  * Assignment operator = imposed by abstract class BPASTriangularSet.
395  *
396  * @param a: A triangular set
397  **/
399 
400  /**
401  * Assignment operator = imposed by abstract class BPASRegularChain.
402  *
403  * @param a: A regular chain
404  **/
406 
407  /**
408  * Move assignment operator = taking an r-value zero-dimensional regular chain as input.
409  *
410  * @param a: An r-value reference zero-dimensional regular chain
411  **/
413 
414  /**
415  * Move assignment operator =.
416  *
417  * @param a: An r-value reference regular chain
418  **/
420 
421  /**
422  * Move assignment operator = imposed by abstract class BPASTriangularSet.
423  *
424  * @param a: An r-value reference triangular set
425  **/
427 
428  /**
429  * Move assignment operator = imposed by abstract class BPASRegularChain.
430  *
431  * @param a: An r-value reference regular chain
432  **/
434 
435  /**
436  * Add operator +:
437  * Adds a polynomial to a regular chain and returns a new regular chain, assuming that the
438  * main variable of p is above any in the current object and that init(p) is regular modulo
439  * the saturated ideal of the current object.
440  *
441  * @param p: A recursively viewed polynomial
442  **/
443  RegularChain<Field,RecursivePoly> operator+ (const RecursivePoly& p) const;
444 
445  /**
446  * Add assignment operator +=:
447  * Adds a polynomial to a regular chain, assuming that the main variable of p is above any in
448  * the current object and that init(p) is regular modulo the saturated ideal of the current object.
449  *
450  * @param p: A recursively viewed polynomial
451  **/
452  RegularChain<Field,RecursivePoly>& operator+= (const RecursivePoly& p);
453 
454  /**
455  * Add operator +:
456  * Adds a regular chain to a regular chain and returns a new regular chain, assuming that the
457  * input is above the current object and the result of adding the chains is a regular chain.
458  *
459  * @param p: A regular chain
460  **/
462 
463  /**
464  * Add assignment operator +=:
465  * Adds a regular chain to a regular chain, assuming that the
466  * input is above the current object and the result adding the chains is a regular chain.
467  *
468  * @param p: A regular chain
469  **/
471 
472  /**
473  * Identity operator ==.
474  *
475  * @param a: A regular chain
476  **/
478 
479  /**
480  * Negated identity operator !=.
481  *
482  * @param a: A regular chain
483  **/
485 
486  /**
487  * Get the number of (potentially algebraic) variables in the current object.
488  *
489  * @param
490  **/
491  inline int numberOfVariables() const {
493  }
494 
495  /**
496  * Get the encoded options of the regular chain, a bitwise or of RegularChainOption values.
497  *
498  * @param
499  **/
500  int options() const;
501 
502  /**
503  * Set the encoded options of the regular chain.
504  *
505  * @param opts: bitwise or of RegularChainOption values
506  **/
507  void setOptions(int opts);
508 
509 
510  /**
511  * Find out if the regular chain is known to be squarefree.
512  *
513  * @param
514  **/
515  bool isKnownToBeSquareFree() const;
516 
517  /**
518  * Find out if the input polynomial is in the saturated ideal of the current regular chain.
519  *
520  * @param p: a recursively viewed polynomial
521  **/
522  bool isInSaturatedIdeal(const RecursivePoly& p) const;
523 
524  /**
525  * Find out if the input polynomial is in the saturated ideal of the current regular chain.
526  * and return the reduced input polynomial.
527  *
528  * @param p: a recursively viewed polynomial
529  **/
530  bool isInSaturatedIdeal(const RecursivePoly& p, RecursivePoly& redp) const;
531 
532  /**
533  * Find out if the input polynomial is in the radical saturated ideal of the current regular chain.
534  *
535  * @param p: a recursively viewed polynomial
536  **/
537  bool isInRadicalSaturatedIdeal(const RecursivePoly& p) const;
538 
539  /**
540  * Find out if the input polynomial is regular modulo the saturated ideal of the current regular chain.
541  *
542  * @param p: a recursively viewed polynomial
543  **/
544  bool isRegular(const RecursivePoly& p) const;
545 
546  /**
547  * Determine whether or not the quasicomponent of the first regular chain is contained in the quasicomponent of the second
548  * using a certified method that returns true if the first is contained in the second and false if not.
549  *
550  * @param rc1: the first regular chain
551  * @param rc1: the second regular chain
552  **/
554 
555  /**
556  * Determine whether or not the quasicomponent of the first regular chain is contained in the quasicomponent of the second
557  * using a heuristic method that returns true when the first is contained in the second and false when no conclusion is possible.
558  *
559  * @param rc1: the first regular chain
560  * @param rc1: the second regular chain
561  **/
563 
564  /**
565  * Remove redundancy from the input list of regular chains.
566  *
567  * @param lrc: a list of regular chains
568  **/
569  static std::vector<RegularChain<Field,RecursivePoly>> removeRedundantChains(const std::vector<RegularChain<Field,RecursivePoly>>& lrc);
570 
571  /**
572  * Get the (potentially algebriac) variable names in decreasing order.
573  *
574  * @param
575  **/
576  inline std::vector<Symbol> variables() const {
578  }
579 
580  /**
581  * Select the polynomial in the current object with main variable s, if it exists.
582  *
583  * @param s: a symbol
584  **/
585  inline RecursivePoly select(const Symbol& s) const {
587  }
588 
589  /**
590  * Returns the regular chain consisting of polynomials with
591  * main variable strictly less than s.
592  *
593  * @param s: symbol of the main variable of specified element of the regular chain
594  * @param ts: The returned regular chain
595  **/
596  void lower(const Symbol& s, BPASTriangularSet<Field,RecursivePoly>& ts) const;
597 
598  /**
599  * Returns the regular chain consisting of polynomials with
600  * main variable strictly greater than s.
601  *
602  * @param s: symbol of the main variable of specified element of the regular chain
603  * @param ts: The returned regular chain
604  **/
605  void upper(const Symbol& s, BPASTriangularSet<Field,RecursivePoly>& ts) const;
606 
607  /**
608  * Destructively converts the current object into lower(s) by changing the set of
609  * (potentially algebraic) variables to be only those below s in the variable order.
610  *
611  * @param s: symbol of the main variable of specified element of the regular chain
612  **/
613  void lowerSlice(const Symbol& s);
614 
615  /**
616  * Compute a triangular decomposition of the list of input polynomials.
617  *
618  * @param F: a vector of recursively viewed polynomials
619  **/
620  std::vector<RegularChain<Field,RecursivePoly>> triangularize(const std::vector<RecursivePoly>& F);
621 
622  /**
623  * Compute the common solutions of the input polynomial and the current regular chain.
624  * More precisely, this routine computes the intersection of the varieties of the input polynomial and the
625  * current regular chain, expressed as a set of regular chains.
626  *
627  * @param p: a recursively viewed polynomial
628  **/
629  std::vector<RegularChain<Field,RecursivePoly>> intersect(const RecursivePoly& p) const;
630 
631  /**
632  * Compute a decomposition of the current object such that on each component the input polynomial is either
633  * zero or regular modulo the saturated ideal of that component. If the polynomial is zero, (0, T_i) is returned;
634  * 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.
635  *
636  * @param p: a recursively viewed polynomial
637  **/
638  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularize(const RecursivePoly& p) const;
639 
640  /**
641  * 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
642  * polynomials g_i and regular chains T_i, where g_i is gcd(p,q) modulo the saturated ideal of T_i.
643  *
644  * @param p: a recursively viewed polynomial
645  * @param q: a recursively viewed polynomial
646  * @param v: the common main variable of p and q
647  * @param src: the subresultant chain of p and q
648  **/
649  std::vector<PolyChainPair<RecursivePoly,RegularChain<Field,RecursivePoly>>> regularGCD(const RecursivePoly& p, const RecursivePoly& q, const Symbol& v, const SubResultantChain<RecursivePoly,RecursivePoly>& src) const;
650 
651  /**
652  * A routine that decomposes the regular chain formed from the current object and an input polynomial into a set of squarefree regular chains.
653  *
654  * @param p: a recursively viewed polynomial such that init(p) is regular modulo the saturated ideal of the current object
655  * @param v: the main variable of p
656  * @param options: a bitwise or of RegularChainOption values (default assume that T+p is a regular chain, where T is the current object)
657  **/
658  std::vector<RegularChain<Field,RecursivePoly>> squareFreePart(const RecursivePoly& p, const Symbol& v, int options=ASSUME_REGULAR) const;
659 
660 
661  /**
662  * Generate a random regular chain based on the number of terms of the polynomials in the chain.
663  *
664  * @param nVars: number of variables
665  * @param nAlgVars: number of algebraic variables
666  * @param nTrcVars: number of transcendental variables
667  * @param nTerms: number of terms in each polynomial
668  * @param coefBound: bound on the coefficient size
669  * @param pSparsity: sparsity of the polynomial in the term separation sense
670  * @param includeNeg: whether to include negative coefficients
671  *
672  **/
673  void randomRegularChain(int nVars, int nAlgVars, int nTrcVars, int nTerms, unsigned long int coefBound, int pSparsity, bool includeNeg);
674 
675  /**
676  * Generate a random regular chain based on a list of maximum degrees of variables in the polynomials in the chain.
677  *
678  * @param nVars: number of variables
679  * @param nAlgVars: number of algebraic variables
680  * @param nTrcVars: number of transcendental variables
681  * @param maxDegs: maximum degrees among the full list of variables
682  * @param coefBound: bound on the coefficient size
683  * @param pSparsity: sparsity of the polynomial in the term separation sense
684  * @param includeNeg: whether to include negative coefficients
685  *
686  **/
687  void randomRegularChain(int nVars, int nAlgVars, int nTrcVars, std::vector<int> maxDegs, unsigned long int coefBound, double pSparsity, bool includeNeg);
688 
689 };
690 
691 #endif
bool operator!=(RegularChain< Field, RecursivePoly > &a)
Negated identity operator !=.
void randomRegularChain(int nVars, int nAlgVars, int nTrcVars, int nTerms, unsigned long int coefBound, int pSparsity, bool includeNeg)
Generate a random regular chain based on the number of terms of the polynomials in the chain...
A triangular set templated by a multivariate polynomial over a field.
Definition: triangularset.hpp:42
std::vector< Symbol > variables() const
Get the variable names in decreasing order.
Definition: triangularset.hpp:311
static std::vector< RegularChain< Field, RecursivePoly > > removeRedundantChains(const std::vector< RegularChain< Field, RecursivePoly >> &lrc)
Remove redundancy from the input list of regular chains.
std::vector< RegularChain< Field, RecursivePoly > > intersect(const RecursivePoly &p) const
Compute the common solutions of the input polynomial and the current regular chain.
void upper(const Symbol &s, BPASTriangularSet< Field, RecursivePoly > &ts) const
Returns the regular chain consisting of polynomials with main variable strictly greater than s...
void lowerSlice(const Symbol &s)
Destructively converts the current object into lower(s) by changing the set of (potentially algebraic...
int numberOfVariables() const
Get the number of variables.
Definition: triangularset.hpp:275
A class for handling regular chains in dimension zero.
Definition: regularchain.hpp:10
void lower(const Symbol &s, BPASTriangularSet< Field, RecursivePoly > &ts) const
Returns the regular chain consisting of polynomials with main variable strictly less than s...
RecursivePoly select(const Symbol &s) const
Select a polynomial given the leading variable; if no such polynomial, 0 is returned.
bool operator==(RegularChain< Field, RecursivePoly > &a)
Identity operator ==.
RecursivePoly select(const Symbol &s) const
Select the polynomial in the current object with main variable s, if it exists.
Definition: regularchain.hpp:585
bool isInSaturatedIdeal(const RecursivePoly &p) const
Find out if the input polynomial is in the saturated ideal of the current regular chain...
static bool compareHeuristicNoSplit(const RegularChain< Field, RecursivePoly > &rc1, const RegularChain< Field, RecursivePoly > &rc2)
Determine whether or not the quasicomponent of the first regular chain is contained in the quasicompo...
void setOptions(int opts)
Set the encoded options of the regular chain.
bool isKnownToBeSquareFree() const
Find out if the regular chain is known to be squarefree.
static bool compareCertifiedNoSplit(const RegularChain< Field, RecursivePoly > &rc1, const RegularChain< Field, RecursivePoly > &rc2)
Determine whether or not the quasicomponent of the first regular chain is contained in the quasicompo...
RegularChain< Field, RecursivePoly > & operator+=(const RecursivePoly &p)
Add assignment operator +=: Adds a polynomial to a regular chain, assuming that the main variable of ...
std::vector< RegularChain< Field, RecursivePoly > > triangularize(const std::vector< RecursivePoly > &F)
Compute a triangular decomposition of the list of input polynomials.
std::vector< Symbol > variables() const
Get the (potentially algebriac) variable names in decreasing order.
Definition: regularchain.hpp:576
int options() const
Get the encoded options of the regular chain, a bitwise or of RegularChainOption values.
RegularChain< Field, RecursivePoly > operator+(const RecursivePoly &p) const
Add operator +: Adds a polynomial to a regular chain and returns a new regular chain, assuming that the main variable of p is above any in the current object and that init(p) is regular modulo the saturated ideal of the current object.
A class for handling regular chains of arbitrary dimension.
Definition: regularchain.hpp:33
int numberOfVariables() const
Get the number of (potentially algebraic) variables in the current object.
Definition: regularchain.hpp:491
An encapsulation of a mathematical symbol.
Definition: Symbol.hpp:23
std::vector< PolyChainPair< RecursivePoly, RegularChain< Field, RecursivePoly > > > regularGCD(const RecursivePoly &p, const RecursivePoly &q, const Symbol &v, const SubResultantChain< RecursivePoly, RecursivePoly > &src) const
Compute the gcd of two input polynomials p and q modulo the saturated ideal of the current object...
RegularChain< Field, RecursivePoly > & operator=(const ZeroDimensionalRegularChain< Field, RecursivePoly > &a)
Assignment operator = for a zero-dimensional regular chain.
An abstract class defining the interface of a regular chain.
Definition: polynomial.h:220
bool isInRadicalSaturatedIdeal(const RecursivePoly &p) const
Find out if the input polynomial is in the radical saturated ideal of the current regular chain...
std::vector< PolyChainPair< RecursivePoly, RegularChain< Field, RecursivePoly > > > regularize(const RecursivePoly &p) const
Compute a decomposition of the current object such that on each component the input polynomial is eit...
bool isRegular(const RecursivePoly &p) const
Find out if the input polynomial is regular modulo the saturated ideal of the current regular chain...