Black box optimization
Maximize the function double eval(int *vec) contained in each of the the two object files below. These are two black box functions and I want you to try maximize both. Black box means that you do not know what the function does -- all you know is that if you send it a (int *vec) , it will return a double , in the range 0 through (100 or 101). main.cpp contains a sample call and return from eval. The size of the integer vector is 100.
Not only do I want the maximum returned by the function, I also want the value of each element in vec when evaluating vec causes the function to reach its maximum.
A sample main.cpp and links to
You will defend your strategy and explain why it failed (or succeeded). In other words, if you find the correct solution, you have to explain how and why your algorithm worked. If it failed, I once again want to know why. Thus, simply applying an algorithm you found on the web is also not a viable option -- only apply an algorithm you know and understand.
You will also state and analyze your algorithms advantages and weaknesses.
You must use g++ for your compilation. You can use C or C++ to implement your algorithm but you must use g++ for compilation -- using gcc leads to wierd (probably namespace and paramenter passing) errors.
General rules
You may talk strategies but no code sharing. You are, of course, free to
use the web or other resources to come up with implementations that
attack the problem below. You cannot use a genetic or other evolutionary
computing algorithm.
Good Luck