/* * 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 SIZE 100000 #define ma 3 typedef struct Coord { float x1; float x2; } coord, *pcoord; coord tabcoord[SIZE]; float tabx[SIZE]; float taby[SIZE]; float sig[SIZE]; float afunc[ma+1]; int ia[ma+1]; float a[ma+1]; void funcs( float i, float afunc[ma+1], int ma2) { afunc[1]=1; afunc[2]=tabcoord[(int)i].x1; afunc[3]=tabcoord[(int)i].x1*tabcoord[(int)i].x1*tabcoord[(int)i].x2; //printf("%f %f %f \n",afunc[0],afunc[1],afunc[2]); } int main(int argc, char * argv[]) { float total=0.0; float ecart=0.0; /* long double total=0.0; */ /* long double ecart=0.0; */ char *filename = argv[1]; int k,i; FILE * res; int ndat=atoi(argv[2]); float ** covar; float *chisq = (float *)malloc(sizeof(float)); res = fopen(filename,"r"); covar = (float**) malloc((ma+1) *sizeof(float*)); for (i=0;i %f %d %d\n", k, tmpfloat, i-j, j); sig[k]=1; tabx[k]=k; } for (k=1;k