--- imach/src/imach.c 2017/04/04 17:46:59 1.260 +++ imach/src/imach.c 2017/04/05 10:14:09 1.261 @@ -1,6 +1,9 @@ -/* $Id: imach.c,v 1.260 2017/04/04 17:46:59 brouard Exp $ +/* $Id: imach.c,v 1.261 2017/04/05 10:14:09 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.261 2017/04/05 10:14:09 brouard + Summary: Bug in E_ as well as in T_ fixed nres-1 vs k1-1 + Revision 1.260 2017/04/04 17:46:59 brouard Summary: Gnuplot indexations fixed (humm) @@ -982,12 +985,12 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.260 2017/04/04 17:46:59 brouard Exp $ */ +/* $Id: imach.c,v 1.261 2017/04/05 10:14:09 brouard Exp $ */ /* $State: Exp $ */ #include "version.h" char version[]=__IMACH_VERSION__; char copyright[]="February 2016,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2018"; -char fullversion[]="$Revision: 1.260 $ $Date: 2017/04/04 17:46:59 $"; +char fullversion[]="$Revision: 1.261 $ $Date: 2017/04/05 10:14:09 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -6777,20 +6780,20 @@ void printinggnuplot(char fileresu[], ch fprintf(ficgp,"\nreplot "); for (i=1; i<= nlstate+1 ; i ++) { k=2*i; - fprintf(ficgp,"\"%s\" every :::%d::%d u 1:($2==%d && $4!=0 ?$4 : 1/0) \"%%lf %%lf %%lf",subdirf2(fileresu,"T_"),k1-1,k1-1, vpopbased); + fprintf(ficgp,"\"%s\" every :::%d::%d u 1:($2==%d && $4!=0 ?$4 : 1/0) \"%%lf %%lf %%lf",subdirf2(fileresu,"T_"),nres-1,nres-1, vpopbased); for (j=1; j<= nlstate+1 ; j ++) { if (j==i) fprintf(ficgp," %%lf (%%lf)"); else fprintf(ficgp," %%*lf (%%*lf)"); } if (i== 1) fprintf(ficgp,"\" t\"TLE\" w l lt %d, \\\n",i); else fprintf(ficgp,"\" t\"LE in state (%d)\" w l lt %d, \\\n",i-1,i+1); - fprintf(ficgp,"\"%s\" every :::%d::%d u 1:($2==%d && $4!=0 ? $4-$5*2 : 1/0) \"%%lf %%lf %%lf",subdirf2(fileresu,"T_"),k1-1,k1-1,vpopbased); + fprintf(ficgp,"\"%s\" every :::%d::%d u 1:($2==%d && $4!=0 ? $4-$5*2 : 1/0) \"%%lf %%lf %%lf",subdirf2(fileresu,"T_"),nres-1,nres-1,vpopbased); for (j=1; j<= nlstate+1 ; j ++) { if (j==i) fprintf(ficgp," %%lf (%%lf)"); else fprintf(ficgp," %%*lf (%%*lf)"); } fprintf(ficgp,"\" t\"\" w l lt 0,"); - fprintf(ficgp,"\"%s\" every :::%d::%d u 1:($2==%d && $4!=0 ? $4+$5*2 : 1/0) \"%%lf %%lf %%lf",subdirf2(fileresu,"T_"),k1-1,k1-1,vpopbased); + fprintf(ficgp,"\"%s\" every :::%d::%d u 1:($2==%d && $4!=0 ? $4+$5*2 : 1/0) \"%%lf %%lf %%lf",subdirf2(fileresu,"T_"),nres-1,nres-1,vpopbased); for (j=1; j<= nlstate+1 ; j ++) { if (j==i) fprintf(ficgp," %%lf (%%lf)"); else fprintf(ficgp," %%*lf (%%*lf)"); @@ -6811,7 +6814,7 @@ void printinggnuplot(char fileresu[], ch continue; for (cpt=1; cpt<= nlstate ; cpt ++) { - fprintf(ficgp,"\n# 3d: Life expectancy with EXP_ files: combination=%d state=%d",k1, cpt); + fprintf(ficgp,"\n\n# 3d: Life expectancy with EXP_ files: combination=%d state=%d",k1, cpt); for (k=1; k<=cptcoveff; k++){ /* For each covariate and each value */ lv= decodtabm(k1,k,cptcoveff); /* Should be the covariate number corresponding to k1 combination */ /* decodtabm(1,1,4) = 1 because h=1 k= (1) 1 1 1 */ @@ -6833,7 +6836,7 @@ void printinggnuplot(char fileresu[], ch k=2+(nlstate+1)*(cpt-1); fprintf(ficgp,"\nset out \"%s_%d-%d-%d.svg\" \n",subdirf2(optionfilefiname,"EXP_"),cpt,k1,nres); fprintf(ficgp,"set ter svg size 640, 480\n\ -plot [%.f:%.f] \"%s\" every :::%d::%d u 1:%d t \"e%d1\" w l",ageminpar,fage,subdirf2(fileresu,"E_"),k1-1,k1-1,k,cpt); +plot [%.f:%.f] \"%s\" every :::%d::%d u 1:%d t \"e%d1\" w l",ageminpar,fage,subdirf2(fileresu,"E_"),nres-1,nres-1,k,cpt); /*fprintf(ficgp,",\"e%s\" every :::%d::%d u 1:($%d-2*$%d) \"\%%lf ",fileres,k1-1,k1-1,k,k+1); for (i=1; i<= nlstate*2 ; i ++) fprintf(ficgp,"\%%lf (\%%lf) "); fprintf(ficgp,"\" t \"e%d1\" w l",cpt); @@ -6843,11 +6846,11 @@ plot [%.f:%.f] \"%s\" every :::%d::%d u */ for (i=1; i< nlstate ; i ++) { - fprintf(ficgp," ,\"%s\" every :::%d::%d u 1:%d t \"e%d%d\" w l",subdirf2(fileresu,"E_"),k1-1,k1-1,k+i,cpt,i+1); + fprintf(ficgp," ,\"%s\" every :::%d::%d u 1:%d t \"e%d%d\" w l",subdirf2(fileresu,"E_"),nres-1,nres-1,k+i,cpt,i+1); /* fprintf(ficgp," ,\"%s\" every :::%d::%d u 1:%d t \"e%d%d\" w l",subdirf2(fileres,"e"),k1-1,k1-1,k+2*i,cpt,i+1);*/ } - fprintf(ficgp," ,\"%s\" every :::%d::%d u 1:%d t \"e%d.\" w l",subdirf2(fileresu,"E_"),k1-1,k1-1,k+nlstate,cpt); + fprintf(ficgp," ,\"%s\" every :::%d::%d u 1:%d t \"e%d.\" w l",subdirf2(fileresu,"E_"),nres-1,nres-1,k+nlstate,cpt); } } /* end nres */ } /* end kl 3eme */