bridge/class-master/depend/pari/src/modules/algebras.c
/*
 * Given a simple algebra al of dimension d^2 over its center of degree n,
 * find an idempotent e in al with rank n (which is minimal).
*/
Given a simple algebra al of dimension d^2 over its center of degree n,
find an idempotent e in al with rank n (which is minimal).
Given a simple algebra al of dimension d^2 over its center of degree n find an idempotent e in al with rank n ( which is minimal ) .
static GEN
alg_idempotent(GEN al, long n, long d)
{
  pari_sp av = avma;
  long i, N = alg_get_absdim(al);
  GEN e, p = alg_get_char(al), x;
  for(i=2; i<=N; i++) {
    x = col_ei(N,i);
    e = try_split(al, x, n, d);
    if (e) return e;
    avma = av;
  }
  for(;;) {
    x = random_FpC(N,p);
    e = try_split(al, x, n, d);
    if (e) return e;
    avma = av;
  }
}
static GEN alg_idempotent ( GEN al , long n , long d ) { pari_sp av = avma ; long i , N = alg_get_absdim ( al ) ; GEN e , p = alg_get_char ( al ) , x ; for ( i = 2 ; i <= N ; i ++ ) { x = col_ei ( N , i ) ; e = try_split ( al , x , n , d ) ; if ( e ) return e ; avma = av ; } for ( ; ; ) { x = random_FpC ( N , p ) ; e = try_split ( al , x , n , d ) ; if ( e ) return e ; avma = av ; } }
Given a simple algebra al of dimension d^2 over its center of degree n,
 find an idempotent e in al with rank n (which is minimal).
Given a simple algebra al of dimension d^2 over its center of degree n find an idempotent e in al with rank n ( which is minimal ) .