bridge/class-master/depend/pari/src/basemath/qfisom.c
/* Generates the matrix X which has as row per[i] the vector nr. x[i] from the
 * list V */
Generates the matrix X which has as row per[i] the vector nr. x[i] from the
list V
Generates the matrix X which has as row per [ i ] the vector nr . x [ i ] from the list V
static GEN
matgen(GEN x, GEN per, GEN V)
{
  long i, j;
  long dim = lg(x)-1;
  GEN X = cgetg(dim+1,t_MAT);
  for (i = 1; i <= dim; ++i)
  {
    long xi = x[i];
    GEN Xp = cgetg(dim+1,t_VECSMALL);
    for (j = 1; j <= dim; ++j)
      Xp[j] = xi > 0? mael(V,xi,j): -mael(V,-xi,j);
    gel(X,per[i]) = Xp;
  }
  return X;
}
static GEN matgen ( GEN x , GEN per , GEN V ) { long i , j ; long dim = lg ( x ) - 1 ; GEN X = cgetg ( dim + 1 , t_MAT ) ; for ( i = 1 ; i <= dim ; ++ i ) { long xi = x [ i ] ; GEN Xp = cgetg ( dim + 1 , t_VECSMALL ) ; for ( j = 1 ; j <= dim ; ++ j ) Xp [ j ] = xi > 0 ? mael ( V , xi , j ) : - mael ( V , - xi , j ) ; gel ( X , per [ i ] ) = Xp ; } return X ; }
Generates the matrix X which has as row per[i] the vector nr.
Generates the matrix X which has as row per [ i ] the vector nr .