bridge/class-master/depend/pari/src/basemath/nffactor.c
/* Compute rational lifting for all the components of M modulo mod.
 * Assume all Fp_ratlift preconditions are met; we allow centerlifts but in
 * that case are no longer stack clean. If one component fails, return NULL.
 * If denom != NULL, check that the denominators divide denom.
 *
 * We suppose gcd(mod, denom) = 1, then a and b are coprime; so we can use
 * mkfrac rather than gdiv */
Compute rational lifting for all the components of M modulo mod.
Assume all Fp_ratlift preconditions are met; we allow centerlifts but in
that case are no longer stack clean. If one component fails, return NULL.
If denom != NULL, check that the denominators divide denom.

We suppose gcd(mod, denom) = 1, then a and b are coprime; so we can use
mkfrac rather than gdiv
Compute rational lifting for all the components of M modulo mod . Assume all Fp_ratlift preconditions are met ; we allow centerlifts but in that case are no longer stack clean . If one component fails return NULL . If denom ! = NULL check that the denominators divide denom . We suppose gcd ( mod denom ) = 1 then a and b are coprime ; so we can use mkfrac rather than gdiv
GEN
FpC_ratlift(GEN P, GEN mod, GEN amax, GEN bmax, GEN denom)
{
  pari_sp ltop = avma;
  long j, l;
  GEN a, d, tdenom = NULL, Q = cgetg_copy(P, &l);
  if (l==1) return Q;
  for (j = 1; j < l; ++j)
  {
    a = lift_to_frac_tdenom(gel(P,j), mod, amax, bmax, denom, tdenom);
    if (!a) { avma = ltop; return NULL; }
    d = Q_denom(a);
    tdenom = tdenom ? cmpii(tdenom, d)<0? d: tdenom : d;
    gel(Q,j) = a;
  }
  return Q;
}
GEN FpC_ratlift ( GEN P , GEN mod , GEN amax , GEN bmax , GEN denom ) { pari_sp ltop = avma ; long j , l ; GEN a , d , tdenom = NULL , Q = cgetg_copy ( P , & l ) ; if ( l == 1 ) return Q ; for ( j = 1 ; j < l ; ++ j ) { a = lift_to_frac_tdenom ( gel ( P , j ) , mod , amax , bmax , denom , tdenom ) ; if ( ! a ) { avma = ltop ; return NULL ; } d = Q_denom ( a ) ; tdenom = tdenom ? cmpii ( tdenom , d ) < 0 ? d : tdenom : d ; gel ( Q , j ) = a ; } return Q ; }
Compute rational lifting for all the components of M modulo mod.
Compute rational lifting for all the components of M modulo mod .