Overview of the main program (either language)


    Your sample program (diffusion) will accomplish the following tasks:
  1. Set up a matrix A (which is N by N, N chosen at run time) as well as the corresponding right hand side b for the system to be solved, A x = b, for a computed value x_computed. These have been chosen to describe the heat diffusion structure.
  2. Call the routine sgeco to perform Gaussian Elimination with partial pivoting. The work is
    
    2N^3 - 3N^2 + N                      N^3 - N
    ---------------  Adds/Subtracts      -------  Multiplies/Divides
          6                                  3 
    
    
    For "large enough" N, both of these terms is dominated by its high order term which is N^3/3 for both counts.
  3. Call the routine sgesl to solve the system A x = b for the computed answer, x_computed. The work is
    N^2 - N  Adds/Subtracts       N^2 Multiplies/Divides
    
    For "large enough" N, both of these terms are dominated by N^2.
  4. Output statistics of the run:
Back to Diffusion Problem