bridge/class-master/depend/pari/src/basemath/bibli2.c
/* assume x and y are t_POL in the same variable whose coeffs can be
 * compared (used to sort polynomial factorizations) */
assume x and y are t_POL in the same variable whose coeffs can be
compared (used to sort polynomial factorizations)
assume x and y are t_POL in the same variable whose coeffs can be compared ( used to sort polynomial factorizations )
int
gen_cmp_RgX(void *data, GEN x, GEN y)
{
  int (*coeff_cmp)(GEN,GEN)=(int(*)(GEN,GEN))data;
  long i, lx = lg(x), ly = lg(y);
  int fl;
  if (lx > ly) return  1;
  if (lx < ly) return -1;
  for (i=lx-1; i>1; i--)
    if ((fl = coeff_cmp(gel(x,i), gel(y,i)))) return fl;
  return 0;
}
int gen_cmp_RgX ( void * data , GEN x , GEN y ) { int ( * coeff_cmp ) ( GEN , GEN ) = ( int ( * ) ( GEN , GEN ) ) data ; long i , lx = lg ( x ) , ly = lg ( y ) ; int fl ; if ( lx > ly ) return 1 ; if ( lx < ly ) return -1 ; for ( i = lx - 1 ; i > 1 ; i -- ) if ( ( fl = coeff_cmp ( gel ( x , i ) , gel ( y , i ) ) ) ) return fl ; return 0 ; }
assume x and y are t_POL in the same variable whose coeffs can be
 compared (used to sort polynomial factorizations)
assume x and y are t_POL in the same variable whose coeffs can be compared ( used to sort polynomial factorizations )