bridge/class-master/depend/pari/src/basemath/alglin1.c
static GEN
RgM_inv_upper_ind(GEN A, long index)
{
  long n = lg(A)-1, i = index, j;
  GEN u = zerocol(n);
  gel(u,i) = ginv(gcoeff(A,i,i));
  for (i--; i>0; i--)
  {
    pari_sp av = avma;
    GEN m = gneg(gmul(gcoeff(A,i,i+1),gel(u,i+1))); /* j = i+1 */
    for (j=i+2; j<=n; j++) m = gsub(m, gmul(gcoeff(A,i,j),gel(u,j)));
    gel(u,i) = gerepileupto(av, gdiv(m, gcoeff(A,i,i)));
  }
  return u;
}
/* assume dim A >= 1, A invertible + upper triangular  */
assume dim A >= 1, A invertible + upper triangular
assume dim A > = 1 A invertible + upper triangular
static GEN
RgM_inv_upper_ind(GEN A, long index)
{
  long n = lg(A)-1, i = index, j;
  GEN u = zerocol(n);
  gel(u,i) = ginv(gcoeff(A,i,i));
  for (i--; i>0; i--)
  {
    pari_sp av = avma;
    GEN m = gneg(gmul(gcoeff(A,i,i+1),gel(u,i+1))); 
    for (j=i+2; j<=n; j++) m = gsub(m, gmul(gcoeff(A,i,j),gel(u,j)));
    gel(u,i) = gerepileupto(av, gdiv(m, gcoeff(A,i,i)));
  }
  return u;
}
static GEN RgM_inv_upper_ind ( GEN A , long index ) { long n = lg ( A ) - 1 , i = index , j ; GEN u = zerocol ( n ) ; gel ( u , i ) = ginv ( gcoeff ( A , i , i ) ) ; for ( i -- ; i > 0 ; i -- ) { pari_sp av = avma ; GEN m = gneg ( gmul ( gcoeff ( A , i , i + 1 ) , gel ( u , i + 1 ) ) ) ; for ( j = i + 2 ; j <= n ; j ++ ) m = gsub ( m , gmul ( gcoeff ( A , i , j ) , gel ( u , j ) ) ) ; gel ( u , i ) = gerepileupto ( av , gdiv ( m , gcoeff ( A , i , i ) ) ) ; } return u ; }
assume dim A >= 1, A invertible + upper triangular
assume dim A > = 1 A invertible + upper triangular
/* j = i+1 */