bridge/class-master/depend/pari/src/basemath/base2.c
/* p not necessarily prime, but coprime to denom(basis) */
p not necessarily prime, but coprime to denom(basis)
p not necessarily prime but coprime to denom ( basis )
GEN
QXQV_to_FpM(GEN basis, GEN T, GEN p)
{
  long i, l = lg(basis), f = degpol(T);
  GEN z = cgetg(l, t_MAT);
  for (i = 1; i < l; i++)
  {
    GEN w = gel(basis,i);
    if (typ(w) == t_INT)
      w = scalarcol_shallow(w, f);
    else
    {
      GEN dx;
      w = Q_remove_denom(w, &dx);
      w = FpXQ_red(w, T, p);
      if (dx)
      {
        dx = Fp_inv(dx, p);
        if (!equali1(dx)) w = FpX_Fp_mul(w, dx, p);
      }
      w = RgX_to_RgC(w, f);
    }
    gel(z,i) = w; 
  }
  return z;
}
GEN QXQV_to_FpM ( GEN basis , GEN T , GEN p ) { long i , l = lg ( basis ) , f = degpol ( T ) ; GEN z = cgetg ( l , t_MAT ) ; for ( i = 1 ; i < l ; i ++ ) { GEN w = gel ( basis , i ) ; if ( typ ( w ) == t_INT ) w = scalarcol_shallow ( w , f ) ; else { GEN dx ; w = Q_remove_denom ( w , & dx ) ; w = FpXQ_red ( w , T , p ) ; if ( dx ) { dx = Fp_inv ( dx , p ) ; if ( ! equali1 ( dx ) ) w = FpX_Fp_mul ( w , dx , p ) ; } w = RgX_to_RgC ( w , f ) ; } gel ( z , i ) = w ; } return z ; }
p not necessarily prime, but coprime to denom(basis)
p not necessarily prime but coprime to denom ( basis )
/* w_i mod (T,p) */