#include #include #include #include #include // N-2 SIGMA i=1 {sin(xi * xi+1 + cos(xi-1 - xi))} #define N 3 //N used in the upper limit of the SIGMA found on the line above #define MILLISECOND 1000000.0 struct Vector { int n; //dimension (number of items) float *p; //values }; typedef struct Vector Vec; struct Matrix { int n; //# of rows int m; //# of columns float *p; //values }; typedef struct Matrix Mat; //array of three integers // (f, Df, DDf) 0 indicating compute and 1 indicating return counter typedef int ThreeIntsArry[3]; // vector/matrix allocation and resources free Vec * createVec(int n); void destroyVec(Vec * vecP); Mat * createMat(int n, int m); void destroyMat(Mat * matP); // Vector/Matrix io Vec * readVec(FILE * vecInFile); void writeVec(Vec * vecWriteP, FILE * outFile); Mat * readMat(FILE * matInFile); void writeMat(Mat * matP, FILE * outFile); //fuctions void * f(float x0, float x1, float x2, int option); void * Df(float x0, float x1, float x2, int option); void * DDf(float x0, float x1, float x2, int option);