--- imach096d/src/imach.c 2003/06/23 17:54:56 1.88
+++ imach096d/src/imach.c 2003/06/24 12:34:15 1.90
@@ -1,6 +1,16 @@
-/* $Id: imach.c,v 1.88 2003/06/23 17:54:56 brouard Exp $
+/* $Id: imach.c,v 1.90 2003/06/24 12:34:15 brouard Exp $
$State: Exp $
$Log: imach.c,v $
+ Revision 1.90 2003/06/24 12:34:15 brouard
+ (Module): Some bugs corrected for windows. Also, when
+ mle=-1 a template is output in file "or"mypar.txt with the design
+ of the covariance matrix to be input.
+
+ Revision 1.89 2003/06/24 12:30:52 brouard
+ (Module): Some bugs corrected for windows. Also, when
+ mle=-1 a template is output in file "or"mypar.txt with the design
+ of the covariance matrix to be input.
+
Revision 1.88 2003/06/23 17:54:56 brouard
* imach.c (Repository): Create a sub-directory where all the secondary files are. Only imach, htm, gp and r(imach) are on the main directory. Correct time and other things.
@@ -164,11 +174,11 @@
#define ODIRSEPARATOR '/'
#endif
-/* $Id: imach.c,v 1.88 2003/06/23 17:54:56 brouard Exp $ */
+/* $Id: imach.c,v 1.90 2003/06/24 12:34:15 brouard Exp $ */
/* $State: Exp $ */
char version[]="Imach version 0.96a, June 2003, INED-EUROREVES ";
-char fullversion[]="$Revision: 1.88 $ $Date: 2003/06/23 17:54:56 $";
+char fullversion[]="$Revision: 1.90 $ $Date: 2003/06/24 12:34:15 $";
int erreur; /* Error number */
int nvar;
int cptcovn=0, cptcovage=0, cptcoveff=0,cptcov;
@@ -320,10 +330,10 @@ static int split( char *path, char *dirc
/******************************************/
-void replace(char *s, char*t)
+void replace_back_to_slash(char *s, char*t)
{
int i;
- int lg=20;
+ int lg=0;
i=0;
lg=strlen(t);
for(i=0; i<= lg; i++) {
@@ -2627,7 +2637,7 @@ void varevsij(char optionfilefiname[], d
/* fprintf(fichtm,"\n
Probability is computed over estepm=%d months and then divided by estepm and multiplied by %.0f in order to have the probability to die over a year
\n", stepm,YEARM,digitp,digit);
*/
/* fprintf(ficgp,"\nset out \"varmuptjgr%s%s%s.png\";replot;",digitp,optionfilefiname,digit); */
- fprintf(ficgp,"\nset out \"%s%s.png\";replot;",digitp,subdirf3(optionfilefiname,"varmuptjgr",digitp),digit);
+ fprintf(ficgp,"\nset out \"%s%s.png\";replot;\n",subdirf3(optionfilefiname,"varmuptjgr",digitp),digit);
free_vector(xp,1,npar);
free_matrix(doldm,1,nlstate,1,nlstate);
@@ -3079,7 +3089,7 @@ fprintf(fichtm," \n
- Graphs
}
for(cpt=1; cpt<=nlstate;cpt++) {
fprintf(fichtm,"\n
- Health life expectancies by age and initial health state (%d): %s%d%d.png
\
-",cpt,subdirf2(optionfilefiname,"exo"),cpt,jj1,subdirf2(optionfilefiname,"exp"),cpt,jj1);
+",cpt,subdirf2(optionfilefiname,"exp"),cpt,jj1,subdirf2(optionfilefiname,"exp"),cpt,jj1);
}
fprintf(fichtm,"\n
- Total life expectancy by age and \
health expectancies in states (1) and (2): %s%d.png
\
@@ -3129,7 +3139,7 @@ fprintf(fichtm," - Graphs
for(cpt=1; cpt<=nlstate;cpt++) {
fprintf(fichtm,"
- Observed and period prevalence (with confident\
interval) in state (%d): %s%d%d.png
\
-",cpt,subdirf2(optionfilefiname,"pe"),cpt,jj1,subdirf2(optionfilefiname,"pe"),cpt,jj1);
+",cpt,subdirf2(optionfilefiname,"v"),cpt,jj1,subdirf2(optionfilefiname,"v"),cpt,jj1);
}
} /* end i1 */
}/* End k1 */
@@ -3138,7 +3148,7 @@ interval) in state (%d): %s%d%d.png
}
/******************* Gnuplot file **************/
-void printinggnuplot(char fileres[], char optionfilefiname[], double ageminpar, double agemaxpar, double fage , char path[], double p[]){
+void printinggnuplot(char fileres[], char optionfilefiname[], double ageminpar, double agemaxpar, double fage , char pathc[], double p[]){
char dirfileres[132],optfileres[132];
int m,cpt,k1,i,k,j,jk,k2,k3,ij,l;
@@ -3149,7 +3159,7 @@ void printinggnuplot(char fileres[], cha
/* } */
/*#ifdef windows */
- fprintf(ficgp,"cd \"%s\" \n",path);
+ fprintf(ficgp,"cd \"%s\" \n",pathc);
/*#endif */
m=pow(2,cptcoveff);
@@ -3245,6 +3255,7 @@ plot [%.f:%.f] \"%s\" every :::%d::%d u
fprintf(ficgp,"\nset out \"%s%d%d.png\" \n",subdirf2(optionfilefiname,"p"),cpt,k1);
fprintf(ficgp,"set xlabel \"Age\" \nset ylabel \"Probability\" \n\
set ter png small\nset size 0.65,0.65\n\
+unset log y\n\
plot [%.f:%.f] \"%s\" u ($1==%d ? ($3):1/0):($%d/($%d",ageminpar,agemaxpar,subdirf2(fileres,"pij"),k1,k+cpt+1,k+1);
for (i=1; i< nlstate ; i ++)
@@ -4487,8 +4498,6 @@ Title=%s
Datafile=%s Firstpass=%d La
strcat(lfileres,"/");
strcat(lfileres,optionfilefiname);
- /* replace(pathc,path);*/
-
/* Calculates basic frequencies. Computes observed prevalence at single age
and prints on file fileres'p'. */
freqsummary(fileres, agemin, agemax, s, agev, nlstate, imx,Tvaraff,nbcode, ncodemax,mint,anint);
@@ -4686,7 +4695,8 @@ Interval (in months) between two waves:
/* freqsummary(fileres, agemin, agemax, s, agev, nlstate, imx,Tvaraff,nbcode, ncodemax,mint,anint);*/
/*,dateprev1,dateprev2,jprev1, mprev1,anprev1,jprev2, mprev2,anprev2);*/
- printinggnuplot(fileres, optionfilefiname,ageminpar,agemaxpar,fage, path,p);
+ replace_back_to_slash(pathc,path); /* Even gnuplot wants a / */
+ printinggnuplot(fileres, optionfilefiname,ageminpar,agemaxpar,fage, pathc,p);
printinghtml(fileres,title,datafile, firstpass, lastpass, stepm, weightopt,\
model,imx,jmin,jmax,jmean,rfileres,popforecast,estepm,\