/* Programming template for Final Part 2 Question 2 Refer to Exercise 4.7 from the text. Consider the underdetermined system Ax=b where A is a m x n matrix with m #include #include #include "matrixlib.h" #define M 4 #define N 16 double A[M][N] = { {-3, -2, 7, 2, -3, 3, 5, -5, -1, 2, -6, 7, -5, 8, 5, -4}, {-2, -7, -0, -5, -4, -1, 2, 1, -1, -3, 6, 3, 1, -1, -3, 5}, { 4, -4, -1, -6, 7, -4, -3, -2, 6, -1, -3, -6, -1, -5, -2, 5}, {-4, 5, -8, -0, -4, 2, -8, 3, 7, 7, -2, -0, -2, 3, -3, -6}}; double b[M] = {7, 4, -4, 6}; double xgold[N] = { -0.27614700835926598, -0.22110834746877939, -0.04157058765128363, -0.18063390490155223, -0.34581044195606775, 0.08855790447178240, -0.02641799063545121, -0.02437364725820414, 0.17141471409301212, 0.14204694827411254, -0.00104446795047347, 0.30504086362707772, -0.17234209664819994, 0.26272280322091501, -0.07944203453328721, -0.06705152726498441 }; double x[N]; // Find the solution to the underdetermined system Ax=b of least norm. void undsolve(int m,int n,double A[m][n],double x[n],double b[m]){ double AAT[m][m]; bzero(AAT,sizeof(double)*m*m); for(int i=0;i