#include "header.h" int main(void) { Vector x; Vector df; Matrix ddf; int flag; float ans=0; clock_t start, end; double runtime; Int3 counts; counts=countset(1,1,1); //read the vector in from the file. while(ReadVector(&x)==1) { printf("the vector from input is:\n"); PrintVector(x); df=CreateVector(x.n); ddf=CreateMatrix(x.n,x.n); // time begins start=clock(); ///////////////////////////////////////// //return the count of the running times // time begins flag=fB(x,&ans,&df,&ddf,counts); end=clock(); runtime=(double)(end-start)/CLOCKS_PER_SEC; //print out: function value and the count and the runtime. printf("the value of the function is : %f\n",ans); printf("________________________________________\n"); printf("the value of the df of the function is :\n"); PrintVector(df); printf("________________________________________\n"); printf("the value of the ddf of the function is :\n"); PrintMatrix(ddf); printf("________________________________________\n"); printf("the running time of this function is %f\n",runtime); DestroyVector(&x); DestroyVector(&df); DestroyMatrix(&ddf); } ///////////////////////////////////////// return 0; }