5903 Intro Scientific Prog:
Optimization Function A: Specification

There are many algorithms to minimie/maximize a function f(x).  Their run time is assessed by counting the number of times they evaluate f, the gradient of f, and the second gradient of f.  Your task is to make a function that computes (and counts keeps track of the number of times it has been evaluated) the function defined by
   function definition
for a given value of n.  You can either #define n in a header file or read it in from the vctor file format.
  1. The driver should read a sequence from standard in (as always redirectable from a file)
  2. I modified the vector file format to allow tabs as well as new lines.  It wil make stuff easier to read.
  3. You should call your C procedure with an extra integer argument. To be specific: 0 for compute the function and 1 for give me the count of the current number of evaluations. 
  4. The output should be a list of the requested values printed to standard out followed by the total number of times each f has been evaluated followed by a runtime in milli seconds.
  5. The function f should be implemented in a separate file.
  6. You are not allowed to use global variables
  7. The code should be able to be run as "MyProg < in > out"
  8. You need to use either implicit rules or automatic variables in your makefile.
  9. Main should be brief and well documented.  
  10. We will be exchanging this code.  
  11. As always ask in class if you do not understand what the specifications say.
  12. There was a request for some test values.  For the input vector x.vec I get f=0.113663 and the gradient and hessian are in the files GradF.vec, and HessianF.mat respectively