bridge/class-master/depend/pari/src/modules/algebras.c
/* compute the multiplication table of the element x, where mt is a
 * multiplication table in an arbitrary ring */
compute the multiplication table of the element x, where mt is a
multiplication table in an arbitrary ring
compute the multiplication table of the element x where mt is a multiplication table in an arbitrary ring
static GEN
Rgmultable(GEN mt, GEN x)
{
  long i, l = lg(x);
  GEN z = NULL;
  for (i = 1; i < l; i++)
  {
    GEN c = gel(x,i);
    if (!gequal0(c))
    {
      GEN M = RgM_Rg_mul(gel(mt,i),c);
      z = z? RgM_add(z, M): M;
    }
  }
  return z;
}
static GEN Rgmultable ( GEN mt , GEN x ) { long i , l = lg ( x ) ; GEN z = NULL ; for ( i = 1 ; i < l ; i ++ ) { GEN c = gel ( x , i ) ; if ( ! gequal0 ( c ) ) { GEN M = RgM_Rg_mul ( gel ( mt , i ) , c ) ; z = z ? RgM_add ( z , M ) : M ; } } return z ; }
compute the multiplication table of the element x, where mt is a
 multiplication table in an arbitrary ring
compute the multiplication table of the element x where mt is a multiplication table in an arbitrary ring