bridge/class-master/depend/pari/src/modules/algebras.c
/* assumes al is CSA or CYCLIC */
assumes al is CSA or CYCLIC
assumes al is CSA or CYCLIC
static GEN
algcenter_precompute(GEN al, GEN p)
{
  GEN fa, pdec, nfprad, projs, nf = alg_get_center(al);
  long i, np;
  pdec = idealprimedec(nf, p);
  settyp(pdec, t_COL);
  np = lg(pdec)-1;
  fa = mkmat2(pdec, const_col(np, gen_1));
  if (dvdii(nf_get_disc(nf), p))
    nfprad = idealprodprime(nf, pdec);
  else
    nfprad = scalarmat_shallow(p, nf_get_degree(nf));
  fa = idealchineseinit(nf, fa);
  projs = cgetg(np+1, t_VEC);
  for (i=1; i<=np; i++) gel(projs, i) = idealchinese(nf, fa, vec_ei(np,i));
  return mkvec2(nfprad, projs);
}
static GEN algcenter_precompute ( GEN al , GEN p ) { GEN fa , pdec , nfprad , projs , nf = alg_get_center ( al ) ; long i , np ; pdec = idealprimedec ( nf , p ) ; settyp ( pdec , t_COL ) ; np = lg ( pdec ) - 1 ; fa = mkmat2 ( pdec , const_col ( np , gen_1 ) ) ; if ( dvdii ( nf_get_disc ( nf ) , p ) ) nfprad = idealprodprime ( nf , pdec ) ; else nfprad = scalarmat_shallow ( p , nf_get_degree ( nf ) ) ; fa = idealchineseinit ( nf , fa ) ; projs = cgetg ( np + 1 , t_VEC ) ; for ( i = 1 ; i <= np ; i ++ ) gel ( projs , i ) = idealchinese ( nf , fa , vec_ei ( np , i ) ) ; return mkvec2 ( nfprad , projs ) ; }
assumes al is CSA or CYCLIC
assumes al is CSA or CYCLIC