bridge/class-master/depend/pari/src/modules/algebras.c
/* al is assumed to be simple */
al is assumed to be simple
al is assumed to be simple
static GEN
alg_pmaximal_i(GEN al, GEN p)
{
  GEN al2, prad, lord = gen_0, I, id, dec, zprad, projs, pre;
  long n, i;
  n = alg_get_absdim(al);
  id = matid(n);
  al2 = al;
  dbg_printf(0)("Round 2 (non-commutative) at p=%Ps, dim=%d\n", p, n);
  pre = algcenter_precompute(al,p);
  while (1) {
    zprad = algcenter_prad(al2, p, pre);
    projs = algcenter_p_projs(al2, p, pre);
    if (lg(projs) == 2) projs = NULL;
    prad = algpradical_i(al2,p,zprad,projs);
    if (typ(prad) == t_INT) break;
    lord = algleftordermodp(al2,prad,p);
    if (!cmp_universal(lord,id)) break;
    al2 = alg_change_overorder_shallow(al2,lord);
  }
  dec = algpdecompose0(al2,prad,p,projs);
  while (lg(dec)>2) {
    for (i=1; i<lg(dec); i++) {
      I = gel(dec,i);
      lord = algleftordermodp(al2,I,p);
      if (cmp_universal(lord,matid(n))) break;
    }
    if (i==lg(dec)) break;
    al2 = alg_change_overorder_shallow(al2,lord);
    zprad = algcenter_prad(al2, p, pre);
    projs = algcenter_p_projs(al2, p, pre);
    if (lg(projs) == 2) projs = NULL;
    dec = algpdecompose_i(al2,p,zprad,projs);
  }
  return al2;
}
static GEN alg_pmaximal_i ( GEN al , GEN p ) { GEN al2 , prad , lord = gen_0 , I , id , dec , zprad , projs , pre ; long n , i ; n = alg_get_absdim ( al ) ; id = matid ( n ) ; al2 = al ; dbg_printf ( 0 ) ( " \n " , p , n ) ; pre = algcenter_precompute ( al , p ) ; while ( 1 ) { zprad = algcenter_prad ( al2 , p , pre ) ; projs = algcenter_p_projs ( al2 , p , pre ) ; if ( lg ( projs ) == 2 ) projs = NULL ; prad = algpradical_i ( al2 , p , zprad , projs ) ; if ( typ ( prad ) == t_INT ) break ; lord = algleftordermodp ( al2 , prad , p ) ; if ( ! cmp_universal ( lord , id ) ) break ; al2 = alg_change_overorder_shallow ( al2 , lord ) ; } dec = algpdecompose0 ( al2 , prad , p , projs ) ; while ( lg ( dec ) > 2 ) { for ( i = 1 ; i < lg ( dec ) ; i ++ ) { I = gel ( dec , i ) ; lord = algleftordermodp ( al2 , I , p ) ; if ( cmp_universal ( lord , matid ( n ) ) ) break ; } if ( i == lg ( dec ) ) break ; al2 = alg_change_overorder_shallow ( al2 , lord ) ; zprad = algcenter_prad ( al2 , p , pre ) ; projs = algcenter_p_projs ( al2 , p , pre ) ; if ( lg ( projs ) == 2 ) projs = NULL ; dec = algpdecompose_i ( al2 , p , zprad , projs ) ; } return al2 ; }
al is assumed to be simple
al is assumed to be simple