#include #include #include #define FACTOR 0.85 typedef float(*FuncType1)(float*, int, float); /********************************* parameters: c - pointer to array of coeficients n - polynom order x - point of evaluation returned value: polynom evaluation at x *********************************/ float Polynom(float *c, int n, float x); /********************************* parameters: f1,f2 - pointers to two user defined functions c,n - polynom coefficients and order x0,x1 - lower and upper evalation range dx - evaluation interval y - pointer to array of function evaluations returned value: none *********************************/ void MyFunction(FuncType1 f1, float *c, int n, float x0, float x1, float dx, float *y); int main() { FILE *fp_in,*fp_out; int i,nc,ny; float *pc,*py,dx,x0,x1,x; // initializing variables dx = 0.1; x0 = 0.0; x1 = 10.0; ny = (int)(x1-x0)/dx+1; py = malloc(ny*sizeof(float)); memset(py,0,ny*sizeof(float)); // loading data from input file fp_in = fopen("/home/ohadbara/Programming/demo/Input.dat","rb"); fscanf(fp_in,"%d",&nc); pc = malloc(nc*sizeof(float)); for(i=0; i