} \r
\r
/************ Frequencies ********************/\r
-void freqsummary(char fileres[], int agemin, int agemax, int **s, double **agev, int nlstate, int imx, int *Tvar, int **nbcode, int *ncodemax, int fprev1,int lprev1)\r
+void freqsummary(char fileres[], int agemin, int agemax, int **s, double **agev, int nlstate, int imx, int *Tvar, int **nbcode, int *ncodemax, int fprev1,int lprev1,double **mint,double **anint)\r
{ /* Some frequencies */\r
\r
- int i, m, jk, k1, i1, j1, bool, z1,z2,j;\r
+ int i, m, jk, k1, k2,i1, j1, bool, z1,z2,j;\r
double ***freq; /* Frequencies */\r
double *pp;\r
double pos;\r
char fileresp[FILENAMELENGTH];\r
\r
pp=vector(1,nlstate);\r
- probs= ma3x(1,130 ,1,8, 1,8);\r
+ probs= ma3x(1,130 ,1,8, 1,8);\r
strcpy(fileresp,"p");\r
strcat(fileresp,fileres);\r
if((ficresp=fopen(fileresp,"w"))==NULL) {\r
bool=0;\r
}\r
if (bool==1) {\r
- for(m=fprev1; m<=lprev1; m++){\r
+ for(m=fprev1; m<=lprev1; m++){\r
+ k2=anint[m][i]+(mint[m][i]/12.);\r
+ if ((k2>=1984) && (k2<=1988.5)) {\r
if(agev[m][i]==0) agev[m][i]=agemax+1;\r
if(agev[m][i]==1) agev[m][i]=agemax+2;\r
freq[s[m][i]][s[m+1][i]][(int)agev[m][i]] += weight[i];\r
freq[s[m][i]][s[m+1][i]][(int) agemax+3] += weight[i];\r
- }\r
- }\r
+ }\r
+ }\r
+ }\r
}\r
if (cptcovn>0) {\r
fprintf(ficresp, "\n#********** Variable "); \r
free_imatrix(outcome,1,maxwav+1,1,n);\r
free_vector(moisnais,1,n);\r
free_vector(annais,1,n);\r
- free_matrix(mint,1,maxwav,1,n);\r
- free_matrix(anint,1,maxwav,1,n);\r
+ /* free_matrix(mint,1,maxwav,1,n);\r
+ free_matrix(anint,1,maxwav,1,n);*/\r
free_vector(moisdc,1,n);\r
free_vector(andc,1,n);\r
\r
}\r
}\r
} \r
-\r
-\r
- /*for(i=1; i <=m ;i++){ \r
- for(k=1; k <=cptcovn; k++){\r
- printf("i=%d k=%d %d %d",i,k,codtab[i][k], cptcoveff);\r
- }\r
- printf("\n");\r
- }\r
- scanf("%d",i);*/\r
\r
/* Calculates basic frequencies. Computes observed prevalence at single age\r
and prints on file fileres'p'. */\r
- freqsummary(fileres, agemin, agemax, s, agev, nlstate, imx,Tvar,nbcode, ncodemax, fprev, lprev);\r
-\r
- pmmij= matrix(1,nlstate+ndeath,1,nlstate+ndeath); /* creation */\r
+ freqsummary(fileres, agemin, agemax, s, agev, nlstate, imx,Tvar,nbcode, ncodemax, fprev, lprev,mint,anint);\r
+ \r
+ free_matrix(mint,1,maxwav,1,n);\r
+ free_matrix(anint,1,maxwav,1,n);\r
+ \r
+ pmmij= matrix(1,nlstate+ndeath,1,nlstate+ndeath); /* creation */\r
oldms= matrix(1,nlstate+ndeath,1,nlstate+ndeath); /* creation */\r
newms= matrix(1,nlstate+ndeath,1,nlstate+ndeath); /* creation */\r
savms= matrix(1,nlstate+ndeath,1,nlstate+ndeath); /* creation */\r