next up previous
Next: About this document ...

ESC 251 HW 27 Due: Nov. 10

1)
(5 pts) Write a subroutine that will add two vectors. Write a main program to test your subroutine. Use the vectors in the data file hw27_1.in
2)
(10 pts) Write a subroutine that will compute either the 1-norm, the 2-norm or the $\infty$-norm of a vector depending on the value of a flag variable. Your subroutine sequence should look something like
    SUBROUTINE getnorms(n,x,flag,outnorm)
If flag is 1, you should return the 1-norm, if flag is 2 you should return the 2-norm and if flag is 3, you should return the $\infty$-norm.

Write a main program to test your subroutine using the data file hw24_2.in





2017-11-08