From fb3951f6ed0e99e8cfafccb1c6d0454c8dceb51c Mon Sep 17 00:00:00 2001 From: Nicolas Brouard Date: Thu, 12 Sep 2024 10:31:44 +0200 Subject: [PATCH] * src/imach.c: Still bugs fixed in graphing comples models --- src/imach.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/imach.c b/src/imach.c index 6091e8f..5dc1a9e 100644 --- a/src/imach.c +++ b/src/imach.c @@ -11201,24 +11201,26 @@ set ter svg size 640, 480\nunset log y\nplot [%.f:%.f] ", ageminpar, agemaxpar) 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; @@ -11313,22 +11315,22 @@ set ter svg size 640, 480\nunset log y\nplot [%.f:%.f] ", ageminpar, agemaxpar) /* 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]]); */ } } -- 2.43.0