if(cptcovdageprod >0){
/* if(j==Tprod[ijp]) { */ /* not necessary */
/* printf("Tprod[%d]=%d, j=%d\n", ij, Tprod[ijp], j); */
- if(ijp <=cptcovprod) { /* Product Vn*Vm and age*VN*Vm*/
- if(DummyV[Tvardk[ijp][1]]==0){/* Vn is dummy */
- if(DummyV[Tvardk[ijp][2]]==0){/* Vn and Vm are dummy */
- /* fprintf(ficgp,"+p%d*%d*%d",i+j+2+nagesqr-1,nbcode[Tvard[ijp][1]][codtabm(k1,j)],nbcode[Tvard[ijp][2]][codtabm(k1,j)]); */
- fprintf(ficgp,"+p%d*%d*%d*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvard[ijp][1]],Tinvresult[nres][Tvard[ijp][2]]);
- }else{ /* Vn is dummy and Vm is quanti */
- /* fprintf(ficgp,"+p%d*%d*%f",i+j+2+nagesqr-1,nbcode[Tvard[ijp][1]][codtabm(k1,j)],Tqinvresult[nres][Tvard[ijp][2]]); */
- fprintf(ficgp,"+p%d*%d*%f*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvardk[ijp][1]],Tqinvresult[nres][Tvardk[ijp][2]]);
- }
+ if(ijp <=cptcovprod) { /* Product Vn*Vm and age*VN*Vm*/
+ /*for (i = 1; i <= cptcovt; i++)printf("DEB i=%d,Tvardk[i][1]=%d, Tvardk[i][2]=%d\n", i, Tvardk[i][1], Tvardk[i][2]);*/
+ /*for (i = 1; i <= cptcovprod; i++)printf("DEB i=%d,Tvard[i][1]=%d, Tvard[i][2]=%d\n", i, Tvard[i][1], Tvard[i][2]); printf("DEBUG ijp=%d Tvard[ijp][1]=%d \n", ijp, Tvard[ijp][1]);*/
+ if(DummyV[Tvardk[j][1]]==0){/* Vn is dummy */
+ if(DummyV[Tvardk[j][2]]==0){/* Vn and Vm are dummy */
+ /* fprintf(ficgp,"+p%d*%d*%d",i+j+2+nagesqr-1,nbcode[Tvard[ijp][1]][codtabm(k1,j)],nbcode[Tvard[ijp][2]][codtabm(k1,j)]); */
+ fprintf(ficgp,"+p%d*%d*%d*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvardk[j][1]],Tinvresult[nres][Tvardk[j][2]]);
+ }else{ /* Vn is dummy and Vm is quanti */
+ /* fprintf(ficgp,"+p%d*%d*%f",i+j+2+nagesqr-1,nbcode[Tvard[ijp][1]][codtabm(k1,j)],Tqinvresult[nres][Tvard[ijp][2]]); */
+ fprintf(ficgp,"+p%d*%d*%f*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvardk[j][1]],Tqinvresult[nres][Tvardk[j][2]]);
+ }
}else{ /* age* Vn*Vm Vn is quanti HERE */
- if(DummyV[Tvard[ijp][2]]==0){
- fprintf(ficgp,"+p%d*%d*%f*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvardk[ijp][2]],Tqinvresult[nres][Tvardk[ijp][1]]);
- }else{ /* Both quanti */
- fprintf(ficgp,"+p%d*%f*%f*x",i+j+2+nagesqr-1,Tqinvresult[nres][Tvardk[ijp][1]],Tqinvresult[nres][Tvardk[ijp][2]]);
- }
+ if(DummyV[Tvard[ijp][2]]==0){
+ fprintf(ficgp,"+p%d*%d*%f*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvardk[j][2]],Tqinvresult[nres][Tvardk[j][1]]);
+ }else{ /* Both quanti */
+ fprintf(ficgp,"+p%d*%f*%f*x",i+j+2+nagesqr-1,Tqinvresult[nres][Tvardk[j][1]],Tqinvresult[nres][Tvardk[j][2]]);
+ }
}
ijp++;
- }
+ }
/* } */ /* end Tprod */
}
break;
/* if(j==Tprod[ijp]) { /\* *\/ */
/* printf("Tprod[%d]=%d, j=%d\n", ij, Tprod[ijp], j); */
if(ijp <=cptcovprod) { /* Product */
- if(DummyV[Tvardk[ijp][1]]==0){/* Vn is dummy */
- if(DummyV[Tvardk[ijp][2]]==0){/* Vn and Vm are dummy */
+ if(DummyV[Tvardk[j][1]]==0){/* Vn is dummy */
+ if(DummyV[Tvardk[j][2]]==0){/* Vn and Vm are dummy */
/* fprintf(ficgp,"+p%d*%d*%d",i+j+2+nagesqr-1,nbcode[Tvard[ijp][1]][codtabm(k1,j)],nbcode[Tvard[ijp][2]][codtabm(k1,j)]); */
- fprintf(ficgp,"+p%d*%d*%d*x",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tinvresult[nres][Tvardk[ijp][1]],Tinvresult[nres][Tvardk[ijp][2]]);
+ fprintf(ficgp,"+p%d*%d*%d*x",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tinvresult[nres][Tvardk[j][1]],Tinvresult[nres][Tvardk[j][2]]);
/* fprintf(ficgp,"+p%d*%d*%d",i+j+2+nagesqr-1,Tinvresult[nres][Tvard[ijp][1]],Tinvresult[nres][Tvard[ijp][2]]); */
}else{ /* Vn is dummy and Vm is quanti */
/* fprintf(ficgp,"+p%d*%d*%f",i+j+2+nagesqr-1,nbcode[Tvard[ijp][1]][codtabm(k1,j)],Tqinvresult[nres][Tvard[ijp][2]]); */
- fprintf(ficgp,"+p%d*%d*%f*x",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tinvresult[nres][Tvardk[ijp][1]],Tqinvresult[nres][Tvardk[ijp][2]]);
+ fprintf(ficgp,"+p%d*%d*%f*x",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tinvresult[nres][Tvardk[j][1]],Tqinvresult[nres][Tvardk[j][2]]);
/* fprintf(ficgp,"+p%d*%d*%f*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvard[ijp][1]],Tqinvresult[nres][Tvard[ijp][2]]); */
}
}else{ /* Vn*Vm Vn is quanti */
if(DummyV[Tvardk[ijp][2]]==0){
- fprintf(ficgp,"+p%d*%d*%f",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tinvresult[nres][Tvardk[ijp][2]],Tqinvresult[nres][Tvardk[ijp][1]]);
+ fprintf(ficgp,"+p%d*%d*%f",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tinvresult[nres][Tvardk[j][2]],Tqinvresult[nres][Tvardk[j][1]]);
/* fprintf(ficgp,"+p%d*%d*%f*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvard[ijp][2]],Tqinvresult[nres][Tvard[ijp][1]]); */
}else{ /* Both quanti */
- fprintf(ficgp,"+p%d*%f*%f",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tqinvresult[nres][Tvardk[ijp][1]],Tqinvresult[nres][Tvardk[ijp][2]]);
+ fprintf(ficgp,"+p%d*%f*%f",k3+(cpt-1)*ncovmodel+1+j+nagesqr,Tqinvresult[nres][Tvardk[j][1]],Tqinvresult[nres][Tvardk[j][2]]);
/* fprintf(ficgp,"+p%d*%f*%f*x",i+j+2+nagesqr-1,Tqinvresult[nres][Tvard[ijp][1]],Tqinvresult[nres][Tvard[ijp][2]]); */
}
}