Annotation of imach/src/prevlim.h, revision 1.2

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>