bridge/class-master/depend/pari/src/modules/krasner.c
/* Return the number of roots of pol congruent to alpha modulo pi working
   modulo pp (all roots if alpha is NULL); if flag is non-zero, return 1
   as soon as a root is found. (Note: ppp = pp*p for DivideByPi) */
Return the number of roots of pol congruent to alpha modulo pi working
modulo pp (all roots if alpha is NULL); if flag is non-zero, return 1
as soon as a root is found. (Note: ppp = pp*p for DivideByPi)
Return the number of roots of pol congruent to alpha modulo pi working modulo pp ( all roots if alpha is NULL ) ; if flag is non - zero return 1 as soon as a root is found . ( Note : ppp = pp * p for DivideByPi )
static long
RootCongruents(KRASNER_t *data, FAD_t *fdata, GEN pol, GEN alpha, GEN pp, GEN ppp, long sl, long flag)
{
  GEN R;
  long s, i;
  if (alpha)
  {
    long l;
    pol = GetSharp(fdata, pp, ppp, pol, alpha, &l);
    if (l <= 1) return l;
    sl += l;
    if (sl >= data->e)
    {
      sl -= data->e;
      ppp = pp;
      pp = diviiexact(pp, data->p);
    }
  }
  R  = Quick_FqX_roots(data, pol);
  for (s = 0, i = 1; i < lg(R); i++)
  {
    s += RootCongruents(data, fdata, pol, gel(R, i), pp, ppp, sl, flag);
    if (flag && s) return 1;
  }
  return s;
}
static long RootCongruents ( KRASNER_t * data , FAD_t * fdata , GEN pol , GEN alpha , GEN pp , GEN ppp , long sl , long flag ) { GEN R ; long s , i ; if ( alpha ) { long l ; pol = GetSharp ( fdata , pp , ppp , pol , alpha , & l ) ; if ( l <= 1 ) return l ; sl += l ; if ( sl >= data -> e ) { sl -= data -> e ; ppp = pp ; pp = diviiexact ( pp , data -> p ) ; } } R = Quick_FqX_roots ( data , pol ) ; for ( s = 0 , i = 1 ; i < lg ( R ) ; i ++ ) { s += RootCongruents ( data , fdata , pol , gel ( R , i ) , pp , ppp , sl , flag ) ; if ( flag && s ) return 1 ; } return s ; }
Return the number of roots of pol congruent to alpha modulo pi working
modulo pp (all roots if alpha is NULL); if flag is non-zero, return 1
as soon as a root is found.
Return the number of roots of pol congruent to alpha modulo pi working modulo pp ( all roots if alpha is NULL ) ; if flag is non - zero return 1 as soon as a root is found .
/* decrease precision if sl gets bigger than a multiple of e */