bridge/class-master/depend/pari/src/basemath/alglin1.c
/* d a t_VECSMALL of integers in 1..n. Return the vector of the d[i]
 * followed by the missing indices */
d a t_VECSMALL of integers in 1..n. Return the vector of the d[i]
followed by the missing indices
d a t_VECSMALL of integers in 1 .. n . Return the vector of the d [ i ] followed by the missing indices
static GEN
perm_complete(GEN d, long n)
{
  GEN y = cgetg(n+1, t_VECSMALL);
  long i, j = 1, k = n, l = lg(d);
  pari_sp av = avma;
  char *T = stack_calloc(n+1);
  for (i = 1; i < l; i++) T[d[i]] = 1;
  for (i = 1; i <= n; i++)
    if (T[i]) y[j++] = i; else y[k--] = i;
  avma = av; return y;
}
static GEN perm_complete ( GEN d , long n ) { GEN y = cgetg ( n + 1 , t_VECSMALL ) ; long i , j = 1 , k = n , l = lg ( d ) ; pari_sp av = avma ; char * T = stack_calloc ( n + 1 ) ; for ( i = 1 ; i < l ; i ++ ) T [ d [ i ] ] = 1 ; for ( i = 1 ; i <= n ; i ++ ) if ( T [ i ] ) y [ j ++ ] = i ; else y [ k -- ] = i ; avma = av ; return y ; }
d a t_VECSMALL of integers in 1..n. Return the vector of the d[i]
 followed by the missing indices
d a t_VECSMALL of integers in 1 .. n . Return the vector of the d [ i ] followed by the missing indices