/* * StarPU * Copyright (C) INRIA 2008-2009 (see AUTHORS file) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU Lesser General Public License in COPYING.LGPL for more details. */ #include #include #include #include "nr.h" #define REAL float #define SIZE 2000000 #define ma 6 typedef struct Coord { REAL x1; REAL x2; REAL x3; } coord, *pcoord; coord tabcoord[SIZE]; REAL tabx[SIZE]; REAL taby[SIZE]; REAL sig[SIZE]; REAL afunc[ma+1]; int ia[ma+1]; REAL a[ma+1]; void funcs( REAL i, REAL afunc[ma+1], int ma2) { afunc[1]= 1; afunc[2]= tabcoord[(int)i].x1; afunc[3]= tabcoord[(int)i].x2; afunc[4]= tabcoord[(int)i].x1*tabcoord[(int)i].x2; afunc[5]= tabcoord[(int)i].x2*tabcoord[(int)i].x3; afunc[6]= tabcoord[(int)i].x1*tabcoord[(int)i].x2*tabcoord[(int)i].x3; //printf("%f %f %f \n",afunc[0],afunc[1],afunc[2]); } int main(int argc, char * argv[]) { REAL total=0.0; REAL ecart=0.0; int len=0; char str2[1000]; /* long double total=0.0; */ /* long double ecart=0.0; */ char *filename = argv[1]; char perf_h[1000]; char str[1000]; int k,i; FILE * res; FILE *out; FILE *perf; // FILE *tmpperf; int ndat=atoi(argv[2]); REAL ** covar; REAL *chisq = (REAL *)malloc(sizeof(REAL)); res = fopen(filename,"r"); covar = (REAL**) malloc((ma+1) *sizeof(REAL*)); for (i=0;i