1 | #ifndef POLYS_H |
---|
2 | #define POLYS_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id$ */ |
---|
7 | /* |
---|
8 | * ABSTRACT - all basic methods to manipulate polynomials of the |
---|
9 | currRing |
---|
10 | */ |
---|
11 | |
---|
12 | #include <kernel/p_polys.h> |
---|
13 | /* |
---|
14 | Some general remarks: |
---|
15 | We divide poly operations into roughly 4 categories: |
---|
16 | Level 2: operations on monomials/polynomials with constant time, |
---|
17 | or operations which are just dispatchers to other |
---|
18 | poly routines |
---|
19 | - implemented in: pInline2.h |
---|
20 | - debugging only if PDEBUG >= 2 |
---|
21 | - normally inlined, unless PDEBUG >= 2 || NO_INLINE2 |
---|
22 | Level 1: operations on monomials with time proportional to length |
---|
23 | - implemented in: pInline1.h |
---|
24 | - debugging only if PDEBUG >= 1 |
---|
25 | - normally inlined, unless PDEBUG >= 1 || NO_INLINE1 |
---|
26 | Level 0: short operations on polynomials with time proportional to |
---|
27 | length of poly |
---|
28 | - implemented in pInline0.cc |
---|
29 | - debugging if PDEBUG |
---|
30 | - normally _not_ inlined: can be forced with |
---|
31 | #define DO_PINLINE0 |
---|
32 | #include "pInline0.h" |
---|
33 | Misc : operations on polynomials which do not fit in any of the |
---|
34 | above categories |
---|
35 | - implemented in: polys*.cc |
---|
36 | - never inlined |
---|
37 | - debugging if PDEBUG >= 0 |
---|
38 | |
---|
39 | You can set PDEBUG on a per-file basis, before including "mod2.h" like |
---|
40 | #define PDEBUG 2 |
---|
41 | #include "mod2.h" |
---|
42 | However, PDEBUG will only be in effect, if !NDEBUG. |
---|
43 | |
---|
44 | All p_* operations take as last argument a ring |
---|
45 | and are ring independent. Their corresponding p* operations are usually |
---|
46 | just macros to the respective p_*(..,currRing). |
---|
47 | |
---|
48 | */ |
---|
49 | |
---|
50 | /*************************************************************** |
---|
51 | * |
---|
52 | * Primitives for accessing and setting fields of a poly |
---|
53 | * poly must be != NULL |
---|
54 | * |
---|
55 | ***************************************************************/ |
---|
56 | // deletes old coeff before setting the new one |
---|
57 | #define pSetCoeff(p,n) p_SetCoeff(p,n,currRing) |
---|
58 | |
---|
59 | // Order |
---|
60 | #define pGetOrder(p) p_GetOrder(p, currRing) |
---|
61 | |
---|
62 | // Component |
---|
63 | #define pGetComp(p) _p_GetComp(p, currRing) |
---|
64 | #define pSetComp(p,v) p_SetComp(p,v, currRing) |
---|
65 | #define pAddComp(p,v) p_AddComp(p,v,currRing) |
---|
66 | #define pSubComp(p,v) p_SubComp(p,v,currRing) |
---|
67 | |
---|
68 | // Exponent |
---|
69 | #define pGetExp(p,i) p_GetExp(p, i, currRing) |
---|
70 | #define pSetExp(p,i,v) p_SetExp(p, i, v, currRing) |
---|
71 | #define pIncrExp(p,i) p_IncrExp(p,i, currRing) |
---|
72 | #define pDecrExp(p,i) p_DecrExp(p,i, currRing) |
---|
73 | #define pAddExp(p,i,v) p_AddExp(p,i,v, currRing) |
---|
74 | #define pSubExp(p,i,v) p_SubExp(p,i,v, currRing) |
---|
75 | #define pMultExp(p,i,v) p_MultExp(p,i,v, currRing) |
---|
76 | #define pGetExpSum(p1, p2, i) p_GetExpSum(p1, p2, i, currRing) |
---|
77 | #define pGetExpDiff(p1, p2, i) p_GetExpDiff(p1, p2, i, currRing) |
---|
78 | |
---|
79 | /*************************************************************** |
---|
80 | * |
---|
81 | * Allocation/Initalization/Deletion |
---|
82 | * except for pHead, all polys must be != NULL |
---|
83 | * |
---|
84 | ***************************************************************/ |
---|
85 | // allocates the space for a new monomial -- no initialization !!! |
---|
86 | #define pNew() p_New(currRing) |
---|
87 | // allocates a new monomial and initializes everything to 0 |
---|
88 | #define pInit() p_Init(currRing) |
---|
89 | // like pInit, except that expvector is initialized to that of p, |
---|
90 | // p must be != NULL |
---|
91 | #define pLmInit(p) p_LmInit(p, currRing) |
---|
92 | // returns newly allocated copy of Lm(p), coef is copied, next=NULL, |
---|
93 | // p might be NULL |
---|
94 | #define pHead(p) p_Head(p, currRing) |
---|
95 | // frees the space of the monomial m, assumes m != NULL |
---|
96 | // coef is not freed, m is not advanced |
---|
97 | static inline void pLmFree(poly p) {p_LmFree(p, currRing);} |
---|
98 | // like pLmFree, but advances p |
---|
99 | static inline void pLmFree(poly *p) {p_LmFree(p, currRing);} |
---|
100 | // assumes p != NULL, deletes p, returns pNext(p) |
---|
101 | #define pLmFreeAndNext(p) p_LmFreeAndNext(p, currRing) |
---|
102 | // assume p != NULL, deletes Lm(p)->coef and Lm(p) |
---|
103 | #define pLmDelete(p) p_LmDelete(p, currRing) |
---|
104 | // like pLmDelete, returns pNext(p) |
---|
105 | #define pLmDeleteAndNext(p) p_LmDeleteAndNext(p, currRing) |
---|
106 | // used by iparith.cc |
---|
107 | extern poly pHeadProc(poly p); |
---|
108 | |
---|
109 | /*************************************************************** |
---|
110 | * |
---|
111 | * Operation on ExpVectors: assumes polys != NULL |
---|
112 | * |
---|
113 | ***************************************************************/ |
---|
114 | |
---|
115 | #define pExpVectorCopy(d_p, s_p) p_ExpVectorCopy(d_p, s_p, currRing) |
---|
116 | #define pExpVectorAdd(p1, p2) p_ExpVectorAdd(p1, p2, currRing) |
---|
117 | #define pExpVectorSub(p1, p2) p_ExpVectorSub(p1, p2, currRing) |
---|
118 | #define pExpVectorAddSub(p1, p2, p3)p_ExpVectorAddSub(p1, p2, p3, currRing) |
---|
119 | #define pExpVectorSum(pr, p1, p2) p_ExpVectorSum(pr, p1, p2, currRing) |
---|
120 | #define pExpVectorDiff(pr, p1, p2) p_ExpVectorDiff(pr, p1, p2, currRing) |
---|
121 | #define pExpVectorEqual(p1, p2) p_ExpVectorEqual(p1, p2, currRing) |
---|
122 | |
---|
123 | // Gets a copy of (resp. set) the exponent vector, where e is assumed |
---|
124 | // to point to (r->N +1)*sizeof(long) memory. Exponents are |
---|
125 | // filled in as follows: comp, e_1, .., e_n |
---|
126 | #define pGetExpV(p, e) p_GetExpV(p, e, currRing) |
---|
127 | #define pSetExpV(p, e) p_SetExpV(p, e, currRing) |
---|
128 | |
---|
129 | /*************************************************************** |
---|
130 | * |
---|
131 | * Comparisons: they are all done without regarding coeffs |
---|
132 | * |
---|
133 | ***************************************************************/ |
---|
134 | // returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering |
---|
135 | #define pLmCmp(p,q) p_LmCmp(p,q,currRing) |
---|
136 | // executes axtionE|actionG|actionS if p=q|p>q|p<q w.r.t monomial ordering |
---|
137 | // action should be a "goto ..." |
---|
138 | #define pLmCmpAction(p,q, actionE, actionG, actionS) \ |
---|
139 | _p_LmCmpAction(p,q,currRing, actionE, actionG,actionS) |
---|
140 | |
---|
141 | #define pLmEqual(p1, p2) pExpVectorEqual(p1, p2) |
---|
142 | |
---|
143 | // pCmp: args may be NULL |
---|
144 | // returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) |
---|
145 | #define pCmp(p1, p2) p_Cmp(p1, p2, currRing) |
---|
146 | |
---|
147 | |
---|
148 | /*************************************************************** |
---|
149 | * |
---|
150 | * Divisiblity tests, args must be != NULL, except for |
---|
151 | * pDivisbleBy |
---|
152 | * |
---|
153 | ***************************************************************/ |
---|
154 | // returns TRUE, if leading monom of a divides leading monom of b |
---|
155 | // i.e., if there exists a expvector c > 0, s.t. b = a + c; |
---|
156 | #define pDivisibleBy(a, b) p_DivisibleBy(a,b,currRing) |
---|
157 | // like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL |
---|
158 | #define pLmDivisibleBy(a,b) p_LmDivisibleBy(a,b,currRing) |
---|
159 | // like pLmDivisibleBy, does not check components |
---|
160 | #define pLmDivisibleByNoComp(a, b) p_LmDivisibleByNoComp(a,b,currRing) |
---|
161 | // Divisibility tests based on Short Exponent vectors |
---|
162 | // sev_a == pGetShortExpVector(a) |
---|
163 | // not_sev_b == ~ pGetShortExpVector(b) |
---|
164 | #define pLmShortDivisibleBy(a, sev_a, b, not_sev_b) \ |
---|
165 | p_LmShortDivisibleBy(a, sev_a, b, not_sev_b, currRing) |
---|
166 | #define pLmRingShortDivisibleBy(a, sev_a, b, not_sev_b) \ |
---|
167 | p_LmRingShortDivisibleBy(a, sev_a, b, not_sev_b, currRing) |
---|
168 | // returns the "Short Exponent Vector" -- used to speed up divisibility |
---|
169 | // tests (see polys-impl.cc ) |
---|
170 | #define pGetShortExpVector(a) p_GetShortExpVector(a, currRing) |
---|
171 | |
---|
172 | /*************************************************************** |
---|
173 | * |
---|
174 | * Copying/Deleteion of polys: args may be NULL |
---|
175 | * |
---|
176 | ***************************************************************/ |
---|
177 | // return a copy of the poly |
---|
178 | #define pCopy(p) p_Copy(p, currRing) |
---|
179 | #define pDelete(p_ptr) p_Delete(p_ptr, currRing) |
---|
180 | |
---|
181 | /*************************************************************** |
---|
182 | * |
---|
183 | * Copying/Deletion of polys: args may be NULL |
---|
184 | * - p/q as arg mean a poly |
---|
185 | * - m a monomial |
---|
186 | * - n a number |
---|
187 | * - pp (resp. qq, mm, nn) means arg is constant |
---|
188 | * - p (resp, q, m, n) means arg is destroyed |
---|
189 | * |
---|
190 | ***************************************************************/ |
---|
191 | #define pNeg(p) p_Neg(p, currRing) |
---|
192 | #define ppMult_nn(p, n) pp_Mult_nn(p, n, currRing) |
---|
193 | #define pMult_nn(p, n) p_Mult_nn(p, n, currRing) |
---|
194 | #define ppMult_mm(p, m) pp_Mult_mm(p, m, currRing) |
---|
195 | #define pMult_mm(p, m) p_Mult_mm(p, m, currRing) |
---|
196 | #define pAdd(p, q) p_Add_q(p, q, currRing) |
---|
197 | #define pPower(p, q) p_Power(p, q, currRing) |
---|
198 | #define pMinus_mm_Mult_qq(p, m, q) p_Minus_mm_Mult_qq(p, m, q, currRing) |
---|
199 | #define pPlus_mm_Mult_qq(p, m, q) p_Plus_mm_Mult_qq(p, m, q, currRing) |
---|
200 | #define pMult(p, q) p_Mult_q(p, q, currRing) |
---|
201 | #define ppMult_qq(p, q) pp_Mult_qq(p, q, currRing) |
---|
202 | // p*Coeff(m) for such monomials pm of p, for which m is divisble by pm |
---|
203 | #define ppMult_Coeff_mm_DivSelect(p, m) pp_Mult_Coeff_mm_DivSelect(p, m, currRing) |
---|
204 | /************************************************************************* |
---|
205 | * |
---|
206 | * Sort routines |
---|
207 | * |
---|
208 | *************************************************************************/ |
---|
209 | // sorts p, assumes all monomials in p are different |
---|
210 | #define pSortMerger(p) pSort(p) |
---|
211 | #define pSort(p) p_SortMerge(p, currRing) |
---|
212 | |
---|
213 | // sorts p, p may have equal monomials |
---|
214 | #define pSortAdd(p) p_SortAdd(p, currRing) |
---|
215 | |
---|
216 | |
---|
217 | // Assume: If considerd only as poly in any component of p |
---|
218 | // (say, monomials of other components of p are set to 0), |
---|
219 | // then p is already sorted correctly |
---|
220 | #define pSortCompCorrect(p) pSort(p) |
---|
221 | |
---|
222 | /*************************************************************** |
---|
223 | * |
---|
224 | * Predicates on polys/Lm's |
---|
225 | * |
---|
226 | ***************************************************************/ |
---|
227 | // return true if all p is eihter NULL, or if all exponents |
---|
228 | // of p are 0 and Comp of p is zero |
---|
229 | #define pIsConstantComp(p) p_IsConstantComp(p, currRing) |
---|
230 | // like above, except that Comp might be != 0 |
---|
231 | #define pIsConstant(p) p_IsConstant(p,currRing) |
---|
232 | // return true if the Lm is a constant <>0 |
---|
233 | #define pIsUnit(p) p_IsUnit(p,currRing) |
---|
234 | // like above, except that p must be != NULL |
---|
235 | #define pLmIsConstantComp(p) p_LmIsConstantComp(p, currRing) |
---|
236 | #define pLmIsConstant(p) p_LmIsConstant(p,currRing) |
---|
237 | |
---|
238 | // return TRUE if all monomials of p are constant |
---|
239 | #define pIsConstantPoly(p) p_IsConstantPoly(p, currRing) |
---|
240 | |
---|
241 | #define pIsPurePower(p) p_IsPurePower(p, currRing) |
---|
242 | #define pIsUnivariate(p) p_IsUnivariate(p, currRing) |
---|
243 | #define pIsVector(p) (pGetComp(p)>0) |
---|
244 | #define pGetVariables(p,e) p_GetVariables(p, e, currRing) |
---|
245 | |
---|
246 | /*************************************************************** |
---|
247 | * |
---|
248 | * Old stuff |
---|
249 | * |
---|
250 | ***************************************************************/ |
---|
251 | |
---|
252 | typedef poly* polyset; |
---|
253 | extern int pVariables; |
---|
254 | extern int pOrdSgn; |
---|
255 | extern BOOLEAN pLexOrder; |
---|
256 | extern poly ppNoether; |
---|
257 | extern BOOLEAN pVectorOut; |
---|
258 | |
---|
259 | /*-------------predicate on polys ----------------------*/ |
---|
260 | BOOLEAN pHasNotCF(poly p1, poly p2); /*has no common factor ?*/ |
---|
261 | void pSplit(poly p, poly * r); /*p => IN(p), r => REST(p) */ |
---|
262 | |
---|
263 | |
---|
264 | |
---|
265 | /*-------------ring management:----------------------*/ |
---|
266 | //extern void pChangeRing(ring newRing); |
---|
267 | extern void pSetGlobals(const ring r, BOOLEAN complete = TRUE); |
---|
268 | // resets the pFDeg and pLDeg: if pLDeg is not given, it is |
---|
269 | // set to currRing->pLDegOrig, i.e. to the respective LDegProc which |
---|
270 | // only uses pFDeg (and not pDeg, or pTotalDegree, etc). |
---|
271 | // If you use this, make sure your procs does not make any assumptions |
---|
272 | // on oredering and/or OrdIndex -- otherwise they might return wrong results |
---|
273 | // on strat->tailRing |
---|
274 | extern void pSetDegProcs(pFDegProc new_FDeg, pLDegProc new_lDeg = NULL); |
---|
275 | // restores pFDeg and pLDeg: |
---|
276 | extern void pRestoreDegProcs(pFDegProc old_FDeg, pLDegProc old_lDeg); |
---|
277 | |
---|
278 | /*-----------the ordering of monomials:-------------*/ |
---|
279 | #define pSetm(p) p_Setm(p, currRing) |
---|
280 | // TODO: |
---|
281 | #define pSetmComp pSetm |
---|
282 | |
---|
283 | /*************************************************************** |
---|
284 | * |
---|
285 | * Degree stuff -- see p_polys.cc for explainations |
---|
286 | * |
---|
287 | ***************************************************************/ |
---|
288 | extern pLDegProc pLDeg; |
---|
289 | extern pFDegProc pFDeg; |
---|
290 | int pWeight(int c, const ring r = currRing); |
---|
291 | long pDeg(poly p,const ring r = currRing); |
---|
292 | static inline long pTotaldegree(poly p) { return p_Totaldegree(p,currRing); } |
---|
293 | long pWTotaldegree(poly p,const ring r = currRing); |
---|
294 | long pWDegree(poly p,const ring r = currRing); |
---|
295 | long pLDeg0(poly p,int *l,const ring r = currRing); |
---|
296 | long pLDeg0c(poly p,int *l,const ring r = currRing); |
---|
297 | long pLDegb(poly p,int *l,const ring r = currRing); |
---|
298 | long pLDeg1(poly p,int *l,const ring r = currRing); |
---|
299 | long pLDeg1c(poly p,int *l,const ring r = currRing); |
---|
300 | long pLDeg1_Deg(poly p,int *l,const ring r = currRing); |
---|
301 | long pLDeg1c_Deg(poly p,int *l,const ring r = currRing); |
---|
302 | long pLDeg1_Totaldegree(poly p,int *l,const ring r = currRing); |
---|
303 | long pLDeg1c_Totaldegree(poly p,int *l,const ring r = currRing); |
---|
304 | long pLDeg1_WFirstTotalDegree(poly p,int *l,const ring r=currRing); |
---|
305 | long pLDeg1c_WFirstTotalDegree(poly p,int *l,const ring r=currRing); |
---|
306 | |
---|
307 | /*-------------pComp for syzygies:-------------------*/ |
---|
308 | |
---|
309 | void pSetModDeg(intvec *w); |
---|
310 | |
---|
311 | |
---|
312 | |
---|
313 | |
---|
314 | poly pmInit(const char *s, BOOLEAN &ok); /* monom -> poly, interpreter */ |
---|
315 | const char * p_Read(const char *s, poly &p,const ring r); /* monom -> poly */ |
---|
316 | |
---|
317 | /*-------------operations on polynomials:------------*/ |
---|
318 | poly pSub(poly a, poly b); |
---|
319 | poly p_Power(poly p, int i, const ring r); |
---|
320 | |
---|
321 | // ----------------- define to enable new p_procs -----*/ |
---|
322 | |
---|
323 | poly pDivide(poly a, poly b); |
---|
324 | poly pDivideM(poly a, poly b); |
---|
325 | void pLcm(poly a, poly b, poly m); |
---|
326 | poly pDiff(poly a, int k); |
---|
327 | poly pDiffOp(poly a, poly b,BOOLEAN multiply); |
---|
328 | |
---|
329 | #define pMaxComp(p) p_MaxComp(p, currRing) |
---|
330 | #define pMinComp(p) p_MinComp(p, currRing) |
---|
331 | int pMaxCompProc(poly p); |
---|
332 | |
---|
333 | #define pOneComp(p) p_OneComp(p, currRing) |
---|
334 | #define pSetCompP(a,i) p_SetCompP(a, i, currRing) |
---|
335 | |
---|
336 | // let's inline those, so that we can call them from the debugger |
---|
337 | inline char* pString(poly p) {return p_String(p, currRing, currRing);} |
---|
338 | inline char* pString0(poly p) {return p_String0(p, currRing, currRing);} |
---|
339 | inline void pWrite(poly p) {p_Write(p, currRing, currRing);} |
---|
340 | inline void pWrite0(poly p) {p_Write0(p, currRing, currRing);} |
---|
341 | inline void wrp(poly p) {p_wrp(p, currRing, currRing);} |
---|
342 | |
---|
343 | void pEnlargeSet(polyset *p, int length, int increment); |
---|
344 | #define pISet(i) p_ISet(i,currRing) |
---|
345 | #define pNSet(n) p_NSet(n,currRing) |
---|
346 | |
---|
347 | poly p_One(const ring r); |
---|
348 | #define pOne() p_One(currRing) |
---|
349 | |
---|
350 | void p_Content(poly p, const ring r); |
---|
351 | void pSimpleContent(poly p, int s); |
---|
352 | poly p_Cleardenom(poly p, const ring r); |
---|
353 | void p_Cleardenom_n(poly p, const ring r,number &c); |
---|
354 | void p_Normalize(poly p,const ring r); |
---|
355 | number p_GetAllDenom(poly ph, const ring r); |
---|
356 | #define pNormalize(p) p_Normalize(p,currRing) |
---|
357 | int pSize( poly p ); |
---|
358 | |
---|
359 | |
---|
360 | // homogenizes p by multiplying certain powers of the varnum-th variable |
---|
361 | poly pHomogen (poly p, int varnum); |
---|
362 | |
---|
363 | // replaces the maximal powers of the leading monomial of p2 in p1 by |
---|
364 | // the same powers of n, utility for dehomogenization |
---|
365 | poly pDehomogen (poly p1,poly p2,number n); |
---|
366 | BOOLEAN pIsHomogeneous (poly p); |
---|
367 | |
---|
368 | // returns the leading monomial of p1 divided by the maximal power of |
---|
369 | // that of p2 |
---|
370 | poly pDivByMonom (poly p1,poly p2); |
---|
371 | |
---|
372 | // Returns as i-th entry of P the coefficient of the (i-1) power of |
---|
373 | // the leading monomial of p2 in p1 |
---|
374 | void pCancelPolyByMonom (poly p1,poly p2,polyset * P,int * SizeOfSet); |
---|
375 | |
---|
376 | poly pPermPoly (poly p, int * perm,const ring OldRing, nMapFunc nMap, |
---|
377 | int *par_perm=NULL, int OldPar=0); |
---|
378 | |
---|
379 | /*BOOLEAN pVectorHasUnitM(poly p, int * k);*/ |
---|
380 | BOOLEAN pVectorHasUnitB(poly p, int * k); |
---|
381 | void pVectorHasUnit(poly p, int * k, int * len); |
---|
382 | poly pTakeOutComp1(poly * p, int k); |
---|
383 | // Splits *p into two polys: *q which consists of all monoms with |
---|
384 | // component == comp and *p of all other monoms *lq == pLength(*q) |
---|
385 | // On return all components pf *q == 0 |
---|
386 | void pTakeOutComp(poly *p, long comp, poly *q, int *lq); |
---|
387 | // Similar to pTakeOutComp, except that only those components are |
---|
388 | // taken out whose Order == order |
---|
389 | // ASSUME: monomial ordering is Order compatible, i.e., if m1, m2 Monoms then |
---|
390 | // m1 >= m2 ==> pGetOrder(m1) >= pGetOrder(m2) |
---|
391 | void pDecrOrdTakeOutComp(poly *p, long comp, long order, |
---|
392 | poly *q, int *lq); |
---|
393 | // This is something weird -- Don't use it, unless you know what you are doing |
---|
394 | poly pTakeOutComp(poly * p, int k); |
---|
395 | void pSetPolyComp(poly p, int comp); |
---|
396 | void pDeleteComp(poly * p,int k); |
---|
397 | void pNorm(poly p); |
---|
398 | poly pSubst(poly p, int n, poly e); |
---|
399 | poly ppJet(poly p, int m); |
---|
400 | poly pJet(poly p, int m); |
---|
401 | poly ppJetW(poly p, int m, short * iv); |
---|
402 | poly pJetW(poly p, int m, short * iv); |
---|
403 | int pMinDeg(poly p,intvec *w=NULL); |
---|
404 | poly pSeries(int n,poly p,poly u=NULL,intvec *w=NULL); |
---|
405 | poly pInvers(int n, poly p,intvec *w=NULL); |
---|
406 | // maximum weigthed degree of all monomials of p, w is indexed from |
---|
407 | // 1..pVariables |
---|
408 | long pDegW(poly p, const short *w); |
---|
409 | |
---|
410 | /*-----------type conversions ----------------------------*/ |
---|
411 | poly pPolys2Vec(polyset p, int len); |
---|
412 | void pVec2Polys(poly v, polyset *p, int *len); |
---|
413 | int p_Var(poly mi,const ring r); |
---|
414 | #define pVar(m) p_Var(m,currRing) |
---|
415 | |
---|
416 | /*-----------specials for spoly-computations--------------*/ |
---|
417 | BOOLEAN pCompareChain (poly p,poly p1,poly p2,poly lcm); |
---|
418 | BOOLEAN pCompareChainPart (poly p,poly p1,poly p2,poly lcm); |
---|
419 | #define pEqualPolys(p1,p2) p_EqualPolys(p1,p2,currRing) |
---|
420 | BOOLEAN pComparePolys(poly p1,poly p2); |
---|
421 | |
---|
422 | |
---|
423 | |
---|
424 | /*************************************************************** |
---|
425 | * |
---|
426 | * PDEBUG stuff |
---|
427 | * |
---|
428 | ***************************************************************/ |
---|
429 | #ifdef PDEBUG |
---|
430 | #define pTest(p) _p_Test(p, currRing, PDEBUG) |
---|
431 | #define pLmTest(p) _p_LmTest(p, currRing, PDEBUG) |
---|
432 | |
---|
433 | #else // ! PDEBUG |
---|
434 | |
---|
435 | #define pTest(p) ((void)0) |
---|
436 | #define pLmTest(p) ((void)0) |
---|
437 | #endif |
---|
438 | |
---|
439 | #endif // POLYS_H |
---|