bridge/class-master/depend/pari/src/basemath/polarit3.c
/* record the degrees of Euclidean remainders (make them as large as
 * possible : smaller values correspond to a degenerate sequence) */
record the degrees of Euclidean remainders (make them as large as
possible : smaller values correspond to a degenerate sequence)
record the degrees of Euclidean remainders ( make them as large as possible : smaller values correspond to a degenerate sequence )
static void
Flx_resultant_set_dglist(GEN a, GEN b, GEN dglist, ulong p)
{
  long da,db,dc, ind;
  pari_sp av = avma;
  if (lgpol(a)==0 || lgpol(b)==0) return;
  da = degpol(a);
  db = degpol(b);
  if (db > da)
  { swapspec(a,b, da,db); }
  else if (!da) return;
  ind = 0;
  while (db)
  {
    GEN c = Flx_rem(a,b, p);
    a = b; b = c; dc = degpol(c);
    if (dc < 0) break;
    ind++;
    if (dc > dglist[ind]) dglist[ind] = dc;
    if (gc_needed(av,2))
    {
      if (DEBUGMEM>1) pari_warn(warnmem,"Flx_resultant_all");
      gerepileall(av, 2, &a,&b);
    }
    db = dc; 
  }
  if (ind+1 > lg(dglist)) setlg(dglist,ind+1);
  avma = av; return;
}
static void Flx_resultant_set_dglist ( GEN a , GEN b , GEN dglist , ulong p ) { long da , db , dc , ind ; pari_sp av = avma ; if ( lgpol ( a ) == 0 || lgpol ( b ) == 0 ) return ; da = degpol ( a ) ; db = degpol ( b ) ; if ( db > da ) { swapspec ( a , b , da , db ) ; } else if ( ! da ) return ; ind = 0 ; while ( db ) { GEN c = Flx_rem ( a , b , p ) ; a = b ; b = c ; dc = degpol ( c ) ; if ( dc < 0 ) break ; ind ++ ; if ( dc > dglist [ ind ] ) dglist [ ind ] = dc ; if ( gc_needed ( av , 2 ) ) { if ( DEBUGMEM > 1 ) pari_warn ( warnmem , " " ) ; gerepileall ( av , 2 , & a , & b ) ; } db = dc ; } if ( ind + 1 > lg ( dglist ) ) setlg ( dglist , ind + 1 ) ; avma = av ; return ; }
record the degrees of Euclidean remainders (make them as large as
 possible : smaller values correspond to a degenerate sequence)
record the degrees of Euclidean remainders ( make them as large as possible : smaller values correspond to a degenerate sequence )
/* = degpol(b) */