bridge/class-master/depend/pari/src/basemath/alglin1.c
/* x a column, x0 same column in the original input matrix (for reference),
 * c list of pivots so far */
x a column, x0 same column in the original input matrix (for reference),
c list of pivots so far
x a column x0 same column in the original input matrix ( for reference ) c list of pivots so far
static long
gauss_get_pivot_max(GEN X, GEN X0, long ix, GEN c)
{
  GEN p, r, x = gel(X,ix), x0 = gel(X0,ix);
  long i, k = 0, ex = - (long)HIGHEXPOBIT, lx = lg(x);
  if (c)
  {
    for (i=1; i<lx; i++)
      if (!c[i])
      {
        long e = gexpo(gel(x,i));
        if (e > ex) { ex = e; k = i; }
      }
  }
  else
  {
    for (i=ix; i<lx; i++)
    {
      long e = gexpo(gel(x,i));
      if (e > ex) { ex = e; k = i; }
    }
  }
  if (!k) return lx;
  p = gel(x,k);
  r = gel(x0,k); if (isrationalzero(r)) r = x0;
  return approx_0(p, r)? lx: k;
}
static long gauss_get_pivot_max ( GEN X , GEN X0 , long ix , GEN c ) { GEN p , r , x = gel ( X , ix ) , x0 = gel ( X0 , ix ) ; long i , k = 0 , ex = - ( long ) HIGHEXPOBIT , lx = lg ( x ) ; if ( c ) { for ( i = 1 ; i < lx ; i ++ ) if ( ! c [ i ] ) { long e = gexpo ( gel ( x , i ) ) ; if ( e > ex ) { ex = e ; k = i ; } } } else { for ( i = ix ; i < lx ; i ++ ) { long e = gexpo ( gel ( x , i ) ) ; if ( e > ex ) { ex = e ; k = i ; } } } if ( ! k ) return lx ; p = gel ( x , k ) ; r = gel ( x0 , k ) ; if ( isrationalzero ( r ) ) r = x0 ; return approx_0 ( p , r ) ? lx : k ; }
x a column, x0 same column in the original input matrix (for reference),
 c list of pivots so far
x a column x0 same column in the original input matrix ( for reference ) c list of pivots so far