My Project
Functions
ratgring.cc File Reference
#include "kernel/mod2.h"
#include "kernel/GBEngine/ratgring.h"
#include "polys/nc/nc.h"
#include "polys/monomials/ring.h"
#include "kernel/polys.h"
#include "coeffs/numbers.h"
#include "kernel/ideals.h"
#include "polys/matpol.h"
#include "polys/kbuckets.h"
#include "kernel/GBEngine/kstd1.h"
#include "polys/sbuckets.h"
#include "polys/prCopy.h"
#include "polys/operations/p_Mult_q.h"
#include "polys/clapsing.h"
#include "misc/options.h"

Go to the source code of this file.

Functions

void pLcmRat (poly a, poly b, poly m, int rat_shift)
 
poly p_HeadRat (poly p, int ishift, ring r)
 
void p_ExpVectorDiffRat (poly pr, poly p1, poly p2, int ishift, ring r)
 
ideal ncGCD2 (poly p, poly q, const ring r)
 
ideal ncGCD (poly p, poly q, const ring r)
 
poly nc_rat_CreateSpoly (poly pp1, poly pp2, int ishift, const ring r)
 
poly nc_rat_ReduceSpolyNew (const poly p1, poly p2, int ishift, const ring r)
 
BOOLEAN p_DivisibleByRat (poly a, poly b, int ishift, const ring r)
 
int redRat (poly *h, poly *reducer, int *red_length, int rl, int ishift, ring r)
 
BOOLEAN p_LmIsConstantRat (const poly p, const ring r)
 
BOOLEAN p_LmIsConstantCompRat (const poly p, const ring r)
 

Function Documentation

◆ nc_rat_CreateSpoly()

poly nc_rat_CreateSpoly ( poly  pp1,
poly  pp2,
int  ishift,
const ring  r 
)

Definition at line 340 of file ratgring.cc.

341 {
342 
343  poly p1 = p_Copy(pp1,r);
344  poly p2 = p_Copy(pp2,r);
345 
346  const long lCompP1 = p_GetComp(p1,r);
347  const long lCompP2 = p_GetComp(p2,r);
348 
349  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
350  {
351 #ifdef PDEBUG
352  WerrorS("nc_rat_CreateSpoly: different non-zero components!");
353 #endif
354  return(NULL);
355  }
356 
357  if ( (p_LmIsConstantRat(p1,r)) || (p_LmIsConstantRat(p2,r)) )
358  {
359  p_Delete(&p1,r);
360  p_Delete(&p2,r);
361  return( NULL );
362  }
363 
364 
365 /* note: prod. crit does not apply! */
366  poly pL=pOne();
367  poly m1=pOne();
368  poly m2=pOne();
369  int is = ishift; /* TODO */
370  pLcmRat(p1,p2,pL,is);
371  p_Setm(pL,r);
372 #ifdef PDEBUG
373  p_Test(pL,r);
374 #endif
375  poly pr1 = p_GetExp_k_n(p1,1,ishift,r); /* rat D-exp of p1 */
376  poly pr2 = p_GetExp_k_n(p2,1,ishift,r); /* rat D-exp of p2 */
377  p_ExpVectorDiff(m1,pL,pr1,r); /* purely in D part by construction */
378  p_ExpVectorDiff(m2,pL,pr2,r); /* purely in D part by construction */
379  p_Delete(&pr1,r);
380  p_Delete(&pr2,r);
381  p_Delete(&pL,r);
382 #ifdef PDEBUG
383  p_Test(m1,r);
384  PrintS("d^{gamma-alpha} = "); p_wrp(m1,r); PrintLn();
385  p_Test(m2,r);
386  PrintS("d^{gamma-beta} = "); p_wrp(m2,r); PrintLn();
387 #endif
388 
389  poly HF = NULL;
390  HF = p_HeadRat(p1,is,r); // lm_D(f)
391  HF = nc_mm_Mult_p(m1, HF, r); // // d^{gamma-alpha} lm_D(f)
392  poly C = p_GetCoeffRat(HF, is, r); // c = lc_D(h_f) in the paper
393 
394  poly HG = NULL;
395  HG = p_HeadRat(p2,is,r); // lm_D(g)
396  HG = nc_mm_Mult_p(m2, HG, r); // // d^{gamma-beta} lm_D(g)
397  poly K = p_GetCoeffRat(HG, is, r); // k = lc_D(h_g) in the paper
398 
399 #ifdef PDEBUG
400  PrintS("f: "); p_wrp(p1,r); PrintS("\n");
401  PrintS("c: "); p_wrp(C,r); PrintS("\n");
402  PrintS("g: "); p_wrp(p2,r); PrintS("\n");
403  PrintS("k: "); p_wrp(K,r); PrintS("\n");
404 #endif
405 
406  ideal ncsyz = ncGCD(C,K,r);
407  poly KK = ncsyz->m[0]; ncsyz->m[0]=NULL; //p_Copy(ncsyz->m[0],r); // k'
408  poly CC = ncsyz->m[1]; ncsyz->m[1]= NULL; //p_Copy(ncsyz->m[1],r); // c'
409  id_Delete(&ncsyz,r);
410 
411  p_LmDeleteAndNextRat(&p1, is, r); // t_f
412  p_LmDeleteAndNextRat(&HF, is, r); // r_f = h_f - lt_D(h_f)
413 
414  p_LmDeleteAndNextRat(&p2, is, r); // t_g
415  p_LmDeleteAndNextRat(&HG, is, r); // r_g = h_g - lt_D(h_g)
416 
417 
418 #ifdef PDEBUG
419  PrintS(" t_f: "); p_wrp(p1,r); PrintS("\n");
420  PrintS(" t_g: "); p_wrp(p2,r); PrintS("\n");
421  PrintS(" r_f: "); p_wrp(HF,r); PrintS("\n");
422  PrintS(" r_g: "); p_wrp(HG,r); PrintS("\n");
423  PrintS(" c': "); p_wrp(CC,r); PrintS("\n");
424  PrintS(" k': "); p_wrp(KK,r); PrintS("\n");
425 
426 #endif
427 
428  // k'(r_f + d^{gamma-alpha} t_f)
429 
430  p1 = p_Mult_q(m1, p1, r); // p1 = d^{gamma-alpha} t_f
431  p1 = p_Add_q(p1,HF,r); // p1 = r_f + d^{gamma-alpha} t_f
432  p1 = p_Mult_q(KK,p1,r); // p1 = k'(r_f + d^{gamma-alpha} t_f)
433 
434  // c'(r_f + d^{gamma-beta} t_g)
435 
436  p2 = p_Mult_q(m2, p2, r); // p2 = d^{gamma-beta} t_g
437  p2 = p_Add_q(p2,HG,r); // p2 = r_g + d^{gamma-beta} t_g
438  p2 = p_Mult_q(CC,p2,r); // p2 = c'(r_g + d^{gamma-beta} t_g)
439 
440 #ifdef PDEBUG
441  p_Test(p1,r);
442  p_Test(p2,r);
443  PrintS(" k'(r_f + d^{gamma-alpha} t_f): "); p_wrp(p1,r);
444  PrintS(" c'(r_g + d^{gamma-beta} t_g): "); p_wrp(p2,r);
445 #endif
446 
447  poly out = p_Add_q(p1,p2,r); // delete p1, p2; // the sum
448 
449 #ifdef PDEBUG
450  p_Test(out,r);
451 #endif
452 
453  // if ( out!=NULL ) pCleardenom(out); // postponed to enterS
454  return(out);
455 }
void WerrorS(const char *s)
Definition: feFopen.cc:24
static poly nc_mm_Mult_p(const poly m, poly p, const ring r)
Definition: nc.h:233
#define p_GetComp(p, r)
Definition: monomials.h:64
#define NULL
Definition: omList.c:12
void p_LmDeleteAndNextRat(poly *p, int ishift, ring r)
Definition: p_polys.cc:1692
poly p_GetCoeffRat(poly p, int ishift, ring r)
Definition: p_polys.cc:1714
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:908
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1086
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
Definition: p_polys.h:1446
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:233
static poly p_GetExp_k_n(poly p, int l, int k, const ring r)
Definition: p_polys.h:1344
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:873
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:818
#define p_Test(p, r)
Definition: p_polys.h:162
void p_wrp(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:373
#define pOne()
Definition: polys.h:315
BOOLEAN p_LmIsConstantRat(const poly p, const ring r)
Definition: ratgring.cc:642
void pLcmRat(poly a, poly b, poly m, int rat_shift)
Definition: ratgring.cc:30
poly p_HeadRat(poly p, int ishift, ring r)
Definition: ratgring.cc:64
ideal ncGCD(poly p, poly q, const ring r)
Definition: ratgring.cc:160
void PrintS(const char *s)
Definition: reporter.cc:284
void PrintLn()
Definition: reporter.cc:310
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix

◆ nc_rat_ReduceSpolyNew()

poly nc_rat_ReduceSpolyNew ( const poly  p1,
poly  p2,
int  ishift,
const ring  r 
)

Definition at line 465 of file ratgring.cc.

466 {
467  const long lCompP1 = p_GetComp(p1,r);
468  const long lCompP2 = p_GetComp(p2,r);
469 
470  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
471  {
472 #ifdef PDEBUG
473  WerrorS("nc_rat_ReduceSpolyNew: different non-zero components!");
474 #endif
475  return(NULL);
476  }
477 
478  if (p_LmIsConstantRat(p1,r))
479  {
480  return( NULL );
481  }
482 
483 
484  int is = ishift; /* TODO */
485 
486  poly m = pOne();
487  p_ExpVectorDiffRat(m, p2, p1, ishift, r); // includes X and D parts
488  //p_Setm(m,r);
489  // m = p_GetExp_k_n(m,1,ishift,r); /* rat D-exp of m */
490 #ifdef PDEBUG
491  p_Test(m,r);
492  PrintS("d^alpha = "); p_wrp(m,r); PrintLn();
493 #endif
494 
495  /* pSetComp(m,r)=0? */
496  poly HH = NULL;
497  poly H = NULL;
498  HH = p_HeadRat(p1,is,r); //p_Copy(p_HeadRat(p1,is,r),r); // lm_D(g)
499 // H = r->nc->p_Procs.mm_Mult_p(m, p_Copy(HH, r), r); // d^aplha lm_D(g)
500  H = nc_mm_Mult_p(m, HH, r); // d^aplha lm_D(g) == h_g in the paper
501 
502  poly K = p_GetCoeffRat(H, is, r); //p_Copy( p_GetCoeffRat(H, is, r), r); // k in the paper
503  poly P = p_GetCoeffRat(p2, is, r); //p_Copy( p_GetCoeffRat(p2, is, r), r); // lc_D(p_2) == lc_D(f)
504 
505 #ifdef PDEBUG
506  PrintS("k: "); p_wrp(K,r); PrintS("\n");
507  PrintS("p: "); p_wrp(P,r); PrintS("\n");
508  PrintS("f: "); p_wrp(p2,r); PrintS("\n");
509  PrintS("g: "); p_wrp(p1,r); PrintS("\n");
510 #endif
511  // alt:
512  poly out = p_Copy(p1,r);
513  p_LmDeleteAndNextRat(&out, is, r); // out == t_g
514 
515  ideal ncsyz = ncGCD(P,K,r);
516  poly KK = ncsyz->m[0]; ncsyz->m[0]=NULL; //p_Copy(ncsyz->m[0],r); // k'
517  poly PP = ncsyz->m[1]; ncsyz->m[1]= NULL; //p_Copy(ncsyz->m[1],r); // p'
518 
519 #ifdef PDEBUG
520  PrintS("t_g: "); p_wrp(out,r);
521  PrintS("k': "); p_wrp(KK,r); PrintS("\n");
522  PrintS("p': "); p_wrp(PP,r); PrintS("\n");
523 #endif
524  id_Delete(&ncsyz,r);
525  p_LmDeleteAndNextRat(&p2, is, r); // t_f
526  p_LmDeleteAndNextRat(&H, is, r); // r_g = h_g - lt_D(h_g)
527 
528 #ifdef PDEBUG
529  PrintS(" t_f: "); p_wrp(p2,r);
530  PrintS(" r_g: "); p_wrp(H,r);
531 #endif
532 
533  p2 = p_Mult_q(KK, p2, r); // p2 = k' t_f
534 
535 #ifdef PDEBUG
536  p_Test(p2,r);
537  PrintS(" k' t_f: "); p_wrp(p2,r);
538 #endif
539 
540 // out = r->nc->p_Procs.mm_Mult_p(m, out, r); // d^aplha t_g
541  out = nc_mm_Mult_p(m, out, r); // d^aplha t_g
542  p_Delete(&m,r);
543 
544 #ifdef PDEBUG
545  PrintS(" d^a t_g: "); p_wrp(out,r);
546  PrintS(" end reduction\n");
547 #endif
548 
549  out = p_Add_q(H, out, r); // r_g + d^a t_g
550 
551 #ifdef PDEBUG
552  p_Test(out,r);
553 #endif
554  out = p_Mult_q(PP, out, r); // p' (r_g + d^a t_g)
555  out = p_Add_q(p2,out,r); // delete out, p2; // the sum
556 
557 #ifdef PDEBUG
558  p_Test(out,r);
559 #endif
560 
561  // if ( out!=NULL ) pCleardenom(out); // postponed to enterS
562  return(out);
563 }
int m
Definition: cfEzgcd.cc:128
CanonicalForm H
Definition: facAbsFact.cc:60
void p_ExpVectorDiffRat(poly pr, poly p1, poly p2, int ishift, ring r)
Definition: ratgring.cc:81

◆ ncGCD()

ideal ncGCD ( poly  p,
poly  q,
const ring  r 
)

Definition at line 160 of file ratgring.cc.

161 {
162  // destroys p and q
163  // assume: p,q are in the comm. ring
164  // to be used in the coeff business
165 #ifdef PDEBUG
166  PrintS(" GCD_start:");
167 #endif
168  poly g = singclap_gcd(p_Copy(p,r),p_Copy(q,r), r);
169 #ifdef PDEBUG
170  p_wrp(g,r);
171  PrintS(" GCD_end;\n");
172 #endif
173  poly u = singclap_pdivide(q, g, r); //q/g
174  poly v = singclap_pdivide(p, g, r); //p/g
175  v = p_Neg(v,r);
176  p_Delete(&p,r);
177  p_Delete(&q,r);
178  ideal h = idInit(2,1);
179  h->m[0] = u; // p_Copy(u,r);
180  h->m[1] = v; // p_Copy(v,r);
181  return(h);
182 }
int p
Definition: cfModGcd.cc:4078
g
Definition: cfModGcd.cc:4090
poly singclap_pdivide(poly f, poly g, const ring r)
Definition: clapsing.cc:601
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
STATIC_VAR Poly * h
Definition: janet.cc:971
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1079
poly singclap_gcd(poly f, poly g, const ring r)
polynomial gcd via singclap_gcd_r resp. idSyzygies destroys f and g
Definition: polys.cc:380
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35

◆ ncGCD2()

ideal ncGCD2 ( poly  p,
poly  q,
const ring  r 
)

Definition at line 112 of file ratgring.cc.

113 {
114  // todo: must destroy p,q
115  intvec *w = NULL;
116  ideal h = idInit(2,1);
117  h->m[0] = p_Copy(p,r);
118  h->m[1] = p_Copy(q,r);
119 #ifdef PDEBUG
120  PrintS("running syzygy comp. for nc_GCD:\n");
121 #endif
122  ideal sh = idSyzygies(h, testHomog, &w);
123 #ifdef PDEBUG
124  PrintS("done syzygy comp. for nc_GCD\n");
125 #endif
126  /* in comm case, there is only 1 syzygy */
127  /* singclap_gcd(); */
128  poly K, K1, K2;
129  K = sh->m[0]; /* take just the first element - to be enhanced later */
130  K1 = pTakeOutComp(&K, 1); // 1st component is taken out from K
131 // pShift(&K,-2); // 2nd component to 0th comp.
132  K2 = pTakeOutComp(&K, 1);
133 // K2 = K;
134 
135  PrintS("syz1: "); p_wrp(K1,r);
136  PrintS("syz2: "); p_wrp(K2,r);
137 
138  /* checking signs before multiplying */
139  number ck1 = p_GetCoeff(K1,r);
140  number ck2 = p_GetCoeff(K2,r);
141  BOOLEAN bck1, bck2;
142  bck1 = n_GreaterZero(ck1,r);
143  bck2 = n_GreaterZero(ck2,r);
144  /* K1 <0, K2 <0 (-K1,-K2) */
145 // if ( !(bck1 && bck2) ) /* - , - */
146 // {
147 // K1 = p_Neg(K1,r);
148 // K2 = p_Neg(K2,r);
149 // }
150  id_Delete(&h,r);
151  h = idInit(2,1);
152  h->m[0] = p_Copy(K1,r);
153  h->m[1] = p_Copy(K2,r);
154  id_Delete(&sh,r);
155  return(h);
156 }
int BOOLEAN
Definition: auxiliary.h:87
Definition: intvec.h:23
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
Definition: coeffs.h:494
const CanonicalForm & w
Definition: facAbsFact.cc:51
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
Definition: ideals.cc:830
#define p_GetCoeff(p, r)
Definition: monomials.h:50
void pTakeOutComp(poly *p, long comp, poly *q, int *lq, const ring R=currRing)
Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other ...
Definition: polys.h:339
@ testHomog
Definition: structs.h:38

◆ p_DivisibleByRat()

BOOLEAN p_DivisibleByRat ( poly  a,
poly  b,
int  ishift,
const ring  r 
)

Definition at line 569 of file ratgring.cc.

570 {
571 #ifdef PDEBUG
572  PrintS("invoke p_DivByRat with a = ");
573  p_wrp(p_Head(a,r),r);
574  PrintS(" and b= ");
575  p_wrp(p_Head(b,r),r);
576  PrintLn();
577 #endif
578  int i;
579  for(i=r->N; i>ishift; i--)
580  {
581 #ifdef PDEBUG
582  Print("i=%d,",i);
583 #endif
584  if (p_GetExp(a,i,r) > p_GetExp(b,i,r)) return FALSE;
585  }
586  return ((p_GetComp(a,r)==p_GetComp(b,r)) || (p_GetComp(a,r)==0));
587 }
#define FALSE
Definition: auxiliary.h:96
int i
Definition: cfEzgcd.cc:132
CanonicalForm b
Definition: cfModGcd.cc:4103
#define Print
Definition: emacs.cc:80
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
Definition: p_polys.h:832
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:469

◆ p_ExpVectorDiffRat()

void p_ExpVectorDiffRat ( poly  pr,
poly  p1,
poly  p2,
int  ishift,
ring  r 
)

Definition at line 81 of file ratgring.cc.

82 {
83  p_LmCheckPolyRing1(p1, r);
84  p_LmCheckPolyRing1(p2, r);
85  p_LmCheckPolyRing1(pr, r);
86  int i;
87  poly t=pr;
88  int e1,e2;
89  for (i=ishift+1; i<=r->N; i++)
90  {
91  e1 = p_GetExp(p1, i, r);
92  e2 = p_GetExp(p2, i, r);
93  // pAssume1(p_GetExp(p1, i, r) >= p_GetExp(p2, i, r));
94  if (e1 < e2)
95  {
96 #ifdef PDEBUG
97  PrintS("negative ExpVectorDiff\n");
98 #endif
99  p_Delete(&t,r);
100  break;
101  }
102  else
103  {
104  p_SetExp(t,i, e1-e2,r);
105  }
106  }
107  p_Setm(t,r);
108 }
#define p_LmCheckPolyRing1(p, r)
Definition: monomials.h:177
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:488

◆ p_HeadRat()

poly p_HeadRat ( poly  p,
int  ishift,
ring  r 
)

Definition at line 64 of file ratgring.cc.

65 {
66  poly q = pNext(p);
67  if (q == NULL) return p;
68  poly res = p_Head(p,r);
69  const long cmp = p_GetComp(p, r);
70  while ( (q!=NULL) && (p_Comp_k_n(p, q, ishift+1, r)) && (p_GetComp(q, r) == cmp) )
71  {
72  res = p_Add_q(res,p_Head(q,r),r);
73  q = pNext(q);
74  }
75  p_SetCompP(res,cmp,r);
76  return res;
77 }
CanonicalForm res
Definition: facAbsFact.cc:60
#define pNext(p)
Definition: monomials.h:36
static int p_Comp_k_n(poly a, poly b, int k, ring r)
Definition: p_polys.h:640
static void p_SetCompP(poly p, int i, ring r)
Definition: p_polys.h:254

◆ p_LmIsConstantCompRat()

BOOLEAN p_LmIsConstantCompRat ( const poly  p,
const ring  r 
)

Definition at line 651 of file ratgring.cc.

652 {
653  int i = r->real_var_end;
654 
655  while ( (p_GetExp(p,i,r)==0) && (i>=r->real_var_start))
656  {
657  i--;
658  }
659  return ( i+1 == r->real_var_start );
660 }

◆ p_LmIsConstantRat()

BOOLEAN p_LmIsConstantRat ( const poly  p,
const ring  r 
)

Definition at line 642 of file ratgring.cc.

643 {
644  if (p_LmIsConstantCompRat(p, r))
645  return (p_GetComp(p, r) == 0);
646  return FALSE;
647 }
BOOLEAN p_LmIsConstantCompRat(const poly p, const ring r)
Definition: ratgring.cc:651

◆ pLcmRat()

void pLcmRat ( poly  a,
poly  b,
poly  m,
int  rat_shift 
)

Definition at line 30 of file ratgring.cc.

31 {
32  /* rat_shift is the last exp one should count with */
33  int i;
34  for (i=(currRing->N); i>=rat_shift; i--)
35  {
36  pSetExp(m,i, si_max( pGetExp(a,i), pGetExp(b,i)));
37  }
39  /* Don't do a pSetm here, otherwise hres/lres chockes */
40 }
static int si_max(const int a, const int b)
Definition: auxiliary.h:124
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pSetComp(p, v)
Definition: polys.h:38
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
#define pSetExp(p, i, v)
Definition: polys.h:42

◆ redRat()

int redRat ( poly *  h,
poly *  reducer,
int *  red_length,
int  rl,
int  ishift,
ring  r 
)

Definition at line 593 of file ratgring.cc.

594 {
595  if ((*h)==NULL) return 0;
596 
597  int j,i,l;
598 
599  loop
600  {
601  j=rl;l=MAX_INT_VAL;
602  for(i=rl-1;i>=0;i--)
603  {
604  // Print("test %d, l=%d (curr=%d, l=%d\n",i,red_length[i],j,l);
605  if ((l>red_length[i]) && (p_DivisibleByRat(reducer[i],*h,ishift,r)))
606  {
607  j=i; l=red_length[i];
608  // PrintS(" yes\n");
609  }
610  // else PrintS(" no\n");
611  }
612  if (j >=rl)
613  {
614  return 1; // not reducible
615  }
616 
617  if (TEST_OPT_DEBUG)
618  {
619  PrintS("reduce ");
620  p_wrp(*h,r);
621  PrintS(" with ");
622  p_wrp(reducer[j],r);
623  }
624  poly hh=nc_rat_ReduceSpolyNew(reducer[j], *h, ishift, r);
625  // p_Delete(h,r);
626  *h=hh;
627  if (TEST_OPT_DEBUG)
628  {
629  PrintS(" to ");
630  p_wrp(*h,r);
631  PrintLn();
632  }
633  if ((*h)==NULL)
634  {
635  return 0;
636  }
637  }
638 }
int l
Definition: cfEzgcd.cc:100
int j
Definition: facHensel.cc:110
const int MAX_INT_VAL
Definition: mylimits.h:12
#define TEST_OPT_DEBUG
Definition: options.h:108
BOOLEAN p_DivisibleByRat(poly a, poly b, int ishift, const ring r)
Definition: ratgring.cc:569
poly nc_rat_ReduceSpolyNew(const poly p1, poly p2, int ishift, const ring r)
Definition: ratgring.cc:465
#define loop
Definition: structs.h:75