Question: OBJECTIVE: SECTIONS: To become familiar with functions, dynamic memory, and structur Note that the above code is slightly different from that in the lecture notes.

OBJECTIVE: SECTIONS: To become familiar with functions, dynamic memory, and structur Note that the above code is slightly different from that in the lecture notes. In some places the braces were moved and some lines merged to minimize the code so it would fit on a single page We also used mattype" as our datatype for the matrix. This will make changing our code casier for the later labs. Run this code and you should get the following output: Gauss-Jordan Elimination with Maximum Pivoting 2. Infinite Series BONUS: Infinite Series of Arcsin(x) 125 10 0 22.19999599999995 01 0-24.59999999999993 001 6.799999 99999998 using nanespace sta define 0N9 3 idetine oontents 112, 4, 6, 9), typedel doubleateype 4.263256414560601-14 1.2789T6924368180-13 7,3, 10,2), (1,2, 5,7} 13162820 The first part is the input matrix; we can see this inside our code where we defined "contents". The second part is the output matrix after the Gauss Jordan elimination. This is somewhat different from the lecture slides as we've increased the output precision to 16 digits. The last portion shows the error when we back substitute the solutions into the original equations. We can see the emor is very small but it certainly isn't zero. This is duc1o the fact that the "double" datatype has limitations and we can see the round off errors start to add up. You can see the Gauss-Jordon procedure fail if you change the "contents" line in your code above to either: idofine contents 13,d, 6,9 6,8,12,18, (1,2,S,7 tcofin contents nattypo b. *t // Add code here to do naximn pivoting ,4, 6,93. 47 , 10,21. {1,2,5,1} Eliniration The first causes a problem since the first two equations are not unique. The second has a zero in the first pivot element so it will too fail Don't forget to switch contents back to the original value before continuing. Modify the GuassJondan" function to include maximum pivoting. Use the "br variable to remember the largest row; you may optionally use the "b" variable to remember the largast value. Write ONLY the code which runs befure the nomalization below ter [1++1: (x13.0 ide im a(k)[1] aljiti) * a(k) 151: -. return 0: cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
