]> henry.ined.fr Git - .git/commitdiff
(Module): Some bugs corrected for windows. Also, when
authorN. Brouard <brouard@ined.fr>
Tue, 24 Jun 2003 12:30:52 +0000 (12:30 +0000)
committerN. Brouard <brouard@ined.fr>
Tue, 24 Jun 2003 12:30:52 +0000 (12:30 +0000)
mle=-1 a template is output in file "or"mypar.txt with the design
of the covariance matrix to be input.

src/imach.c

index 8fd3120c1a33a3376197986b92c61eb412913638..daf9023d3b30e489d9d23f0eb7acff41f17413db 100644 (file)
@@ -1,6 +1,9 @@
 /* $Id$
   $State$
   $Log$
+  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.
+
   Revision 1.87  2003/06/18 12:26:01  brouard
   Version 0.96
 
@@ -317,10 +320,10 @@ static    int split( char *path, char *dirc, char *name, char *ext, char *finame )
 
 /******************************************/
 
-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++) {
@@ -2624,7 +2627,7 @@ void varevsij(char optionfilefiname[], double ***vareij, double **matcov, double
   /*  fprintf(fichtm,"\n<br> 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 <br> <img src=\"varmuptjgr%s%s.png\"> <br>\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);
@@ -3076,7 +3079,7 @@ fprintf(fichtm," \n<ul><li><b>Graphs</b></li><p>");
        }
      for(cpt=1; cpt<=nlstate;cpt++) {
         fprintf(fichtm,"\n<br>- Health life expectancies by age and initial health state (%d): %s%d%d.png <br> \
-<img src=\"%s%d%d.png\">",cpt,subdirf2(optionfilefiname,"exo"),cpt,jj1,subdirf2(optionfilefiname,"exp"),cpt,jj1);
+<img src=\"%s%d%d.png\">",cpt,subdirf2(optionfilefiname,"exp"),cpt,jj1,subdirf2(optionfilefiname,"exp"),cpt,jj1);
      }
      fprintf(fichtm,"\n<br>- Total life expectancy by age and \
 health expectancies in states (1) and (2): %s%d.png<br>\
@@ -3126,7 +3129,7 @@ fprintf(fichtm," <ul><li><b>Graphs</b></li><p>");
      for(cpt=1; cpt<=nlstate;cpt++) {
        fprintf(fichtm,"<br>- Observed and period prevalence (with confident\
 interval) in state (%d): %s%d%d.png <br>\
-<img src=\"%s%d%d.png\">",cpt,subdirf2(optionfilefiname,"pe"),cpt,jj1,subdirf2(optionfilefiname,"pe"),cpt,jj1);  
+<img src=\"%s%d%d.png\">",cpt,subdirf2(optionfilefiname,"vr"),cpt,jj1,subdirf2(optionfilefiname,"vr"),cpt,jj1);  
      }
    } /* end i1 */
  }/* End k1 */
@@ -3135,7 +3138,7 @@ interval) in state (%d): %s%d%d.png <br>\
 }
 
 /******************* 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;
@@ -3146,7 +3149,7 @@ void printinggnuplot(char fileres[], char optionfilefiname[], double ageminpar,
 /*   } */
 
   /*#ifdef windows */
-  fprintf(ficgp,"cd \"%s\" \n",path);
+  fprintf(ficgp,"cd \"%s\" \n",pathc);
     /*#endif */
   m=pow(2,cptcoveff);
 
@@ -3242,6 +3245,7 @@ plot [%.f:%.f] \"%s\" every :::%d::%d u 1:%d t \"e%d1\" w l",ageminpar,fage,subd
       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 ++)
@@ -4484,8 +4488,6 @@ Title=%s <br>Datafile=%s Firstpass=%d Lastpass=%d Stepm=%d Weight=%d Model=%s<br
   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);
@@ -4683,7 +4685,8 @@ Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf<br>\n",\
   /*  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,\