next up previous contents
Next: Computing the determinant Up: Linear Systems of Algebraic Previous: Solving the upper triangular   Contents

General algorithms

For the LU decomposition we have

DO j=1,n-1
   DO i=j+1,n
      m = - A(i,j)/A(j,j)
      DO k=j+1,n
         A(i,k) = A(i,k) - m*A(j,k)
      END DO
      A(i,j) = m
   END DO
END DO
The number of multiplications and divisions used is


Similarly, the number of sumations is .

For the backward substitution the algorithm that

b(n) = b(n)/A(n,n)
DO j=n-1,1,-1
   DO k=j+1,n
      b(j) = b(j) - A(j,k)*b(k)
   END DO
   b(j) = b(j)/A(j,j)
END DO

The number of multiplications is about .



Adrian Sandu 2001-08-26