Annotation of imach/src/prevlim.h, revision 1.1
1.1 ! brouard 1: /*--------------- Prevalence limit (period or stable prevalence) --------------*/
! 2:
! 3: strcpy(filerespl,"pl");
! 4: strcat(filerespl,fileres);
! 5: if((ficrespl=fopen(filerespl,"w"))==NULL) {
! 6: printf("Problem with period (stable) prevalence resultfile: %s\n", filerespl);goto end;
! 7: fprintf(ficlog,"Problem with period (stable) prevalence resultfile: %s\n", filerespl);goto end;
! 8: }
! 9: printf("Computing period (stable) prevalence: result on file '%s' \n", filerespl);
! 10: fprintf(ficlog,"Computing period (stable) prevalence: result on file '%s' \n", filerespl);
! 11: pstamp(ficrespl);
! 12: fprintf(ficrespl,"# Period (stable) prevalence \n");
! 13: fprintf(ficrespl,"#Age ");
! 14: for(i=1; i<=nlstate;i++) fprintf(ficrespl,"%d-%d ",i,i);
! 15: fprintf(ficrespl,"\n");
! 16:
! 17: prlim=matrix(1,nlstate,1,nlstate);
! 18:
! 19: agebase=ageminpar;
! 20: agelim=agemaxpar;
! 21: ftolpl=1.e-10;
! 22: i1=pow(2,cptcoveff);
! 23: if (cptcovn < 1){i1=1;}
! 24:
! 25: for(cptcov=1,k=0;cptcov<=i1;cptcov++){
! 26: /* for(cptcov=1,k=0;cptcov<=1;cptcov++){ */
! 27: //for(cptcod=1;cptcod<=ncodemax[cptcov];cptcod++){
! 28: k=k+1;
! 29: /* to clean */
! 30: //printf("cptcov=%d cptcod=%d codtab=%d\n",cptcov, cptcod,codtab[cptcod][cptcov]);
! 31: fprintf(ficrespl,"\n#******");
! 32: printf("\n#******");
! 33: fprintf(ficlog,"\n#******");
! 34: for(j=1;j<=cptcoveff;j++) {
! 35: fprintf(ficrespl," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtab[k][j]]);
! 36: printf(" V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtab[k][j]]);
! 37: fprintf(ficlog," V%d=%d ",Tvaraff[j],nbcode[Tvaraff[j]][codtab[k][j]]);
! 38: }
! 39: fprintf(ficrespl,"******\n");
! 40: printf("******\n");
! 41: fprintf(ficlog,"******\n");
! 42:
! 43: fprintf(ficrespl,"#Age ");
! 44: for(j=1;j<=cptcoveff;j++) {
! 45: fprintf(ficrespl,"V%d %d",Tvaraff[j],nbcode[Tvaraff[j]][codtab[k][j]]);
! 46: }
! 47: for(i=1; i<=nlstate;i++) fprintf(ficrespl,"%d-%d ",i,i);
! 48: fprintf(ficrespl,"\n");
! 49:
! 50: for (age=agebase; age<=agelim; age++){
! 51: /* for (age=agebase; age<=agebase; age++){ */
! 52: prevalim(prlim, nlstate, p, age, oldm, savm,ftolpl,k);
! 53: fprintf(ficrespl,"%.0f ",age );
! 54: for(j=1;j<=cptcoveff;j++)
! 55: fprintf(ficrespl,"%d %d ",Tvaraff[j],nbcode[Tvaraff[j]][codtab[k][j]]);
! 56: for(i=1; i<=nlstate;i++)
! 57: fprintf(ficrespl," %.5f", prlim[i][i]);
! 58: fprintf(ficrespl,"\n");
! 59: } /* Age */
! 60: /* was end of cptcod */
! 61: } /* cptcov */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>