#include //Io //#include //Pows and stuff. #include //Serves some purpose, I think it's atof(). #include //gives clock and timing controls. #include //For answering size questions. #include "libvecmat.h" //For the vector and matrix things; I made it into a library and link it in. //Recall the -L. libvecmat.a to bring in the vector/matrix library. //Recall the -lm to link in the above math header file. //Recall the -pg to make data for the profiler afterwards typedef struct fla {unsigned int f0; unsigned int f1; unsigned int f2;} flagbox3; //Because we have to use so many flags to control how we access the functions, //This stores a set of three flags, related to the funks as follows: //f0 is the function itself //f1 is the gradiant of the function //f2 is the hessian of the function //This allows me to group like control flags together with a single silly name. int main(void); void parseinput(flagbox3 *flags, vector * vecin); flagbox3 processinput(const flagbox3 computeflag, vector * vecin, double timer[3], const flagbox3 printflags, const flagbox3 modeflags, flagbox3 *currentTallies); double funk(double a, double b, double c); double sumfunk(vector * vecin, vector * f); void gradfunk(vector * vecin, vector * df, double result, double interval); void hessfunk(vector * vecin, matrix * ddf, double result, double inteval); void printoutput(const flagbox3,double timer[3], const flagbox3); //Global variables #define INTERVAL .00001 //How far to step dx in the calculus related steps above. //#define THISISPROGRAM11 1 //If this is program 11, please switch this to 1 //This is actually changed in the makefile so it can compile programs 11 and 13.