--- imach/src/imach.c 2022/09/02 14:26:02 1.337 +++ imach/src/imach.c 2022/09/04 17:40:33 1.338 @@ -1,6 +1,13 @@ -/* $Id: imach.c,v 1.337 2022/09/02 14:26:02 brouard Exp $ +/* $Id: imach.c,v 1.338 2022/09/04 17:40:33 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.338 2022/09/04 17:40:33 brouard + Summary: 0.99r36 + + * imach.c (Module): Now the easy runs i.e. without result or + model=1+age only did not work. The defautl combination should be 1 + and not 0 because everything hasn't been tranformed yet. + Revision 1.337 2022/09/02 14:26:02 brouard Summary: version 0.99r35 @@ -1294,12 +1301,12 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.337 2022/09/02 14:26:02 brouard Exp $ */ +/* $Id: imach.c,v 1.338 2022/09/04 17:40:33 brouard Exp $ */ /* $State: Exp $ */ #include "version.h" char version[]=__IMACH_VERSION__; char copyright[]="September 2022,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2020, Nihon University 2021-202, INED 2000-2022"; -char fullversion[]="$Revision: 1.337 $ $Date: 2022/09/02 14:26:02 $"; +char fullversion[]="$Revision: 1.338 $ $Date: 2022/09/04 17:40:33 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -1517,7 +1524,7 @@ int **nbcode, *Tvar; /**< model=V2 => Tv /*TnsdVar[Tvar] 1 2 3 */ /*Tvaraff[nsd] 4 3 1 */ /* ID of single dummy cova fixed or timevary*/ /*TvarsD[nsd] 4 3 1 */ /* ID of single dummy cova fixed or timevary*/ -/*TvarsDind[k] 2 3 9 */ /* position K of single dummy cova */ +/*TvarsDind[nsd] 2 3 9 */ /* position K of single dummy cova */ /* nsq 1 2 */ /* Counting single quantit tv */ /* TvarsQ[k] 5 2 */ /* Number of single quantitative cova */ /* TvarsQind 1 6 */ /* position K of single quantitative cova */ @@ -2510,7 +2517,8 @@ void powell(double p[], double **xi, int xits=vector(1,n); *fret=(*func)(p); for (j=1;j<=n;j++) pt[j]=p[j]; - rcurr_time = time(NULL); + rcurr_time = time(NULL); + fp=(*fret); /* Initialisation */ for (*iter=1;;++(*iter)) { ibig=0; del=0.0; @@ -2824,7 +2832,7 @@ void powell(double p[], double **xi, int double **prevalim(double **prlim, int nlstate, double x[], double age, double **oldm, double **savm, double ftolpl, int *ncvyear, int ij, int nres) { - /**< Computes the prevalence limit in each live state at age x and for covariate combination ij + /**< Computes the prevalence limit in each live state at age x and for covariate combination ij . Nicely done * (and selected quantitative values in nres) * by left multiplying the unit * matrix by transitions matrix until convergence is reached with precision ftolpl @@ -5129,7 +5137,7 @@ Title=%s
Datafile=%s Firstpass=%d La /* }else */ /* TODO TODO codtabm(j1,z1) or codtabm(j1,Tvaraff[z1]]z1)*/ /* if( iind >=imx-3) printf("Searching error iind=%d Tvaraff[z1]=%d covar[Tvaraff[z1]][iind]=%.f TnsdVar[Tvaraff[z1]]=%d, cptcoveff=%d, cptcovs=%d \n",iind, Tvaraff[z1], covar[Tvaraff[z1]][iind],TnsdVar[Tvaraff[z1]],cptcoveff, cptcovs); */ if(Tvaraff[z1]<1 || Tvaraff[z1]>=NCOVMAX) - printf("Error Tvaraff[z1]=%d<1 or >=%d, cptcoveff=%d model=%s\n",Tvaraff[z1],NCOVMAX, cptcoveff, model); + printf("Error Tvaraff[z1]=%d<1 or >=%d, cptcoveff=%d model=1+age+%s\n",Tvaraff[z1],NCOVMAX, cptcoveff, model); if (covar[Tvaraff[z1]][iind]!= nbcode[Tvaraff[z1]][codtabm(j1,TnsdVar[Tvaraff[z1]])]){ /* for combination j1 of covariates */ /* Tests if the value of the covariate z1 for this individual iind responded to combination j1 (V4=1 V3=0) */ bool=0; /* bool should be equal to 1 to be selected, one covariate value failed */ @@ -5439,7 +5447,7 @@ Title=%s
Datafile=%s Firstpass=%d La printf("# This combination (%d) is not valid and no result will be produced\n",j1); invalidvarcomb[j1]=1; }else{ - fprintf(ficresphtm,"\n

This combination (%d) is valid and result will be produced.

",j1); + fprintf(ficresphtm,"\n

This combination (%d) is valid and result will be produced (or no resultline).

",j1); invalidvarcomb[j1]=0; } fprintf(ficresphtmfr,"\n"); @@ -7208,9 +7216,9 @@ To be simple, these graphs help to under /* Including quantitative variables of the resultline to be done */ for (z1=1; z1<=cptcovs; z1++){ /* Loop on each variable of this resultline */ - printf("Varprob modelresult[%d][%d]=%d model=%s \n",nres, z1, modelresult[nres][z1], model); - fprintf(ficlog,"Varprob modelresult[%d][%d]=%d model=%s \n",nres, z1, modelresult[nres][z1], model); - /* fprintf(ficlog,"Varprob modelresult[%d][%d]=%d model=%s resultline[%d]=%s \n",nres, z1, modelresult[nres][z1], model, nres, resultline[nres]); */ + printf("Varprob modelresult[%d][%d]=%d model=1+age+%s \n",nres, z1, modelresult[nres][z1], model); + fprintf(ficlog,"Varprob modelresult[%d][%d]=%d model=1+age+%s \n",nres, z1, modelresult[nres][z1], model); + /* fprintf(ficlog,"Varprob modelresult[%d][%d]=%d model=1+age+%s resultline[%d]=%s \n",nres, z1, modelresult[nres][z1], model, nres, resultline[nres]); */ if(Dummy[modelresult[nres][z1]]==0){/* Dummy variable of the variable in position modelresult in the model corresponding to z1 in resultline */ if(Fixed[modelresult[nres][z1]]==0){ /* Fixed referenced to model equation */ fprintf(ficresprob,"V%d=%d ",Tvresult[nres][z1],Tresult[nres][z1]); /* Output of each value for the combination TKresult[nres], ordere by the covariate values in the resultline */ @@ -7581,7 +7589,8 @@ void printinghtml(char fileresu[], char fprintf(fichtm," \n