bridge/class-master/depend/pari/src/modules/krasner.c
/* pol is a ZXY defining a polynomial over the field defined by fdata
   If flag != 0, return 1 as soon as a root is found. Computations are done with
   a precision of pr. */
pol is a ZXY defining a polynomial over the field defined by fdata
If flag != 0, return 1 as soon as a root is found. Computations are done with
a precision of pr.
pol is a ZXY defining a polynomial over the field defined by fdata If flag ! = 0 return 1 as soon as a root is found . Computations are done with a precision of pr .
static long
RootCountingAlgorithm(KRASNER_t *data, FAD_t *fdata, GEN pol, long flag)
{
  long j, l, d;
  GEN P = cgetg_copy(pol, &l);
  P[1] = pol[1];
  d = l-3;
  for (j = 0; j < d; j++)
  {
    GEN cf = gel(pol, j+2);
    if (typ(cf) == t_INT)
      cf = diviiexact(cf, data->p);
    else
      cf = ZX_Z_divexact(cf, data->p);
    gel(P, j+2) = Fq_mul(cf, gel(fdata->pik, j+1), fdata->topr, data->pr);
  }
  gel(P, d+2) = gel(fdata->pik, d+1); 
  return RootCongruents(data, fdata, P, NULL, diviiexact(data->pr, data->p), data->pr, 0, flag);
}
static long RootCountingAlgorithm ( KRASNER_t * data , FAD_t * fdata , GEN pol , long flag ) { long j , l , d ; GEN P = cgetg_copy ( pol , & l ) ; P [ 1 ] = pol [ 1 ] ; d = l - 3 ; for ( j = 0 ; j < d ; j ++ ) { GEN cf = gel ( pol , j + 2 ) ; if ( typ ( cf ) == t_INT ) cf = diviiexact ( cf , data -> p ) ; else cf = ZX_Z_divexact ( cf , data -> p ) ; gel ( P , j + 2 ) = Fq_mul ( cf , gel ( fdata -> pik , j + 1 ) , fdata -> topr , data -> pr ) ; } gel ( P , d + 2 ) = gel ( fdata -> pik , d + 1 ) ; return RootCongruents ( data , fdata , P , NULL , diviiexact ( data -> pr , data -> p ) , data -> pr , 0 , flag ) ; }
pol is a ZXY defining a polynomial over the field defined by fdata
If flag != 0, return 1 as soon as a root is found.
pol is a ZXY defining a polynomial over the field defined by fdata If flag ! = 0 return 1 as soon as a root is found .
/* pik[d] = pi^d/p */