ANSWER QUESTION 3 ONLY Update THIS CODE to answer HW 1 Deadline 9/25/2017 1-Add
ID: 3869836 • Letter: A
Question
ANSWER QUESTION 3 ONLY Update THIS CODE to answerHW 1 Deadline 9/25/2017 1-Add to the uploaded Gauss Elimination code on blackboard lines of code to check the size compatibility of the coefficient matrix A with the known input vector b. 2-Add to the uploaded Gauss Elimination code on blackboard lines of code to check the input vector b to see if it is a column vector or not. If it is not a column vector, then convert it from a row vector to a column vector and inform the user using a display message. 3-Modify the uploaded Gauss Elimination code on blackboard in a way that it is able to read and solve several input vectors at the same time and find the solution for each vector and display the results to the user. In this case the input b will appear as a matrix, and every column is an input vector. This for example means that the below matrix is 3 separate input vector. b 3 0 -1 5 7 3 Please note that in this case, for every column vector of b, there is a unique solution. Assume that the coefficient matrix A is the same for all b vectors. The code should be generic and it should work ifb is 2X1 (meaning two equations, 2 unknown), 2X2 (meaning two equations, 2 unknown but two different inputs are used, and corresponding to each input an output is expected), 4X1 (meaning for equations, 4 unknown, and 1 set of input), and so on.
Explanation / Answer
//Gauss Elimination #include #include using namespace std; int main() { int n,i,j,k; cout.precision(4); //set precision cout.setf(ios::fixed); coutn; //input the no. of equations float a[n][n+1],x[n]; //declare an array to store the elements of augmented-matrix coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.