bridge/class-master/depend/pari/src/basemath/alglin1.c
/* assume dim A >= 1, A invertible + upper triangular, 1s on diagonal  */
assume dim A >= 1, A invertible + upper triangular, 1s on diagonal
assume dim A > = 1 A invertible + upper triangular 1s on diagonal
static GEN
FpM_inv_upper_1_ind(GEN A, long index, GEN p)
{
  long n = lg(A)-1, i = index, j;
  GEN u = zerocol(n);
  gel(u,i) = gen_1;
  for (i--; i>0; i--)
  {
    pari_sp av = avma;
    GEN m = negi(mulii(gcoeff(A,i,i+1),gel(u,i+1))); 
    for (j=i+2; j<=n; j++) m = subii(m, mulii(gcoeff(A,i,j),gel(u,j)));
    gel(u,i) = gerepileuptoint(av, modii(m,p));
  }
  return u;
}
static GEN FpM_inv_upper_1_ind ( GEN A , long index , GEN p ) { long n = lg ( A ) - 1 , i = index , j ; GEN u = zerocol ( n ) ; gel ( u , i ) = gen_1 ; for ( i -- ; i > 0 ; i -- ) { pari_sp av = avma ; GEN m = negi ( mulii ( gcoeff ( A , i , i + 1 ) , gel ( u , i + 1 ) ) ) ; for ( j = i + 2 ; j <= n ; j ++ ) m = subii ( m , mulii ( gcoeff ( A , i , j ) , gel ( u , j ) ) ) ; gel ( u , i ) = gerepileuptoint ( av , modii ( m , p ) ) ; } return u ; }
assume dim A >= 1, A invertible + upper triangular, 1s on diagonal
assume dim A > = 1 A invertible + upper triangular 1s on diagonal
/* j = i+1 */