bridge/class-master/depend/pari/src/basemath/galconj.c
/* Check whether f is (with high probability) a solution and compute its
 * permutation */
Check whether f is (with high probability) a solution and compute its
permutation
Check whether f is ( with high probability ) a solution and compute its permutation
static int
poltopermtest(GEN f, struct galois_lift *gl, GEN pf)
{
  pari_sp av;
  GEN fx, fp, B = gl->gb->bornesol;
  long i, j, ll;
  for (i = 2; i < lg(f); i++)
    if (abscmpii(gel(f,i),B) > 0)
    {
      if (DEBUGLEVEL>=4) err_printf("GaloisConj: Solution too large.\n");
      if (DEBUGLEVEL>=8) err_printf("f=%Ps\n borne=%Ps\n",f,B);
      return 0;
    }
  ll = lg(gl->L);
  fp = const_vecsmall(ll-1, 1); 
  av = avma;
  for (i = 1; i < ll; i++, avma = av)
  {
    fx = FpX_eval(f, gel(gl->L,i), gl->gb->ladicsol);
    for (j = 1; j < ll; j++)
      if (fp[j] && equalii(fx, gel(gl->Lden,j))) { pf[i]=j; fp[j]=0; break; }
    if (j == ll) return 0;
  }
  return 1;
}
static int poltopermtest ( GEN f , struct galois_lift * gl , GEN pf ) { pari_sp av ; GEN fx , fp , B = gl -> gb -> bornesol ; long i , j , ll ; for ( i = 2 ; i < lg ( f ) ; i ++ ) if ( abscmpii ( gel ( f , i ) , B ) > 0 ) { if ( DEBUGLEVEL >= 4 ) err_printf ( " \n " ) ; if ( DEBUGLEVEL >= 8 ) err_printf ( " \n \n " , f , B ) ; return 0 ; } ll = lg ( gl -> L ) ; fp = const_vecsmall ( ll - 1 , 1 ) ; av = avma ; for ( i = 1 ; i < ll ; i ++ , avma = av ) { fx = FpX_eval ( f , gel ( gl -> L , i ) , gl -> gb -> ladicsol ) ; for ( j = 1 ; j < ll ; j ++ ) if ( fp [ j ] && equalii ( fx , gel ( gl -> Lden , j ) ) ) { pf [ i ] = j ; fp [ j ] = 0 ; break ; } if ( j == ll ) return 0 ; } return 1 ; }
Check whether f is (with high probability) a solution and compute its
 permutation
Check whether f is ( with high probability ) a solution and compute its permutation
/* left on stack */