Question: C + + is being used here Implement Gaussian Elimination Gaussian ( double * A , doublex, double * b , int N ) ;
C is being used here
Implement Gaussian Elimination Gaussiandouble A doublex, double b int N;
to solve a matrix loaded from file in the agreed to format
Compute the relative error of your solution
Load N A b from a file.
Ax b
eg Solve for x when given N A b solve for x
you have computed the solution x
compute Ax store as r
subtract r from b this is the same as bAx diff
find the two norm of the vector diff
hopefully once you divide the two norm by N you will be near or less
Gaussian Elimination Pseudo code
connect to data file
input n
allocate required vectors and matrix
input Ann input bn
begin solver
column by column
search for max entry in current column
for each row in current col row Amaxrowcol maxrow row; maxvalArowcol
once maxrow is identified, swap Amaxrowi with Acoli
temp Amaxrowi
AmaxrowiAcoli
Acolitemp
after that, swap the b values, temp bmaxrow bmaxrowbcol bcoltemp
for all columns in Acoli Acolimaxval
eliminate all subdiagonal values for col
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
