![]() |
| ||
| Need HELP!!!!! I NEED HELP WITH THIS PROBLEM!!!! ANYONE!!!! /*3. Write the function: double max_norm(double *v, int n) to compute the maximum norm of vector v[] with n elements. The max norm of a vector is computed by taking the maximum absolute value of its elements. In prob3() compute x1[]=a[][]*x0[], call max_norm() to compute the max_norm x1[]. In order to normalize (or convert it to a unit vector), divide each element of x1[] by the norm. Print the normalized x1[] using %12.4e. Then copy x1[] as x0[] (to perform updating) and repeat the process nine more times . */ double a[5][5]={ 1.0, 0.2, 0.6, 0.3,-0.2, 0.2, 3.0,-0.1, 0.2, 0.7, 0.6,-0.1, 2.0, 0.7, 0.1, 0.3, 0.2, 0.7, 5.5, 0.2, -0.2, 0.7, 0.1, 0.2, 4.5 }; double x1[5], x0[5]={0.1, -0.5, 0.1, 1.0, 0.9}; |
| ||
| Re: Need HELP!!!!! Exactly, where are you having problems with? Be more specific and post relevant portion of code you have tried already and it is not working. |
| ||
| Re: Need HELP!!!!! I'm completely lost....I don't understand how to write the first function then call on it??? |
| ||
| Re: Need HELP!!!!! ...then ask your teacher to divide your homework grade by 2 and send the second half to the author of the best answer... |
| ||
| Re: Need HELP!!!!! /*3. Write the function: double max_norm(double *v, int n) to compute the maximum norm of vector v[] with n elements. The max norm of a vector is computed by taking the maximum absolute value of its elements. In prob3() compute x1[]=a[][]*x0[], call max_norm() to compute the max_norm x1[]. In order to normalize (or convert it to a unit vector), divide each element of x1[] by the norm. Print the normalized x1[] using %12.4e. Then copy x1[] as x0[] (to perform updating) and repeat the process nine more times. */ double a[5][5]={ 1.0, 0.2, 0.6, 0.3,-0.2, |
| All times are GMT -4. The time now is 10:17 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC