|
|
| version 1.309, 2021/05/20 12:39:14 | version 1.310, 2022/03/17 08:45:53 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ | /* $Id$ |
| $State$ | $State$ |
| $Log$ | $Log$ |
| Revision 1.310 2022/03/17 08:45:53 brouard | |
| Summary: 99r25 | |
| Improving detection of errors: result lines should be compatible with | |
| the model. | |
| Revision 1.309 2021/05/20 12:39:14 brouard | Revision 1.309 2021/05/20 12:39:14 brouard |
| Summary: Version 0.99r24 | Summary: Version 0.99r24 |
| Line 1574 char *cutl(char *blocc, char *alocc, cha | Line 1580 char *cutl(char *blocc, char *alocc, cha |
| { | { |
| /* cuts string in into blocc and alocc where blocc ends before FIRST occurence of char 'occ' | /* cuts string in into blocc and alocc where blocc ends before FIRST occurence of char 'occ' |
| and alocc starts after first occurence of char 'occ' : ex cutv(blocc,alocc,"abcdef2ghi2j",'2') | and alocc starts after first occurence of char 'occ' : ex cutv(blocc,alocc,"abcdef2ghi2j",'2') |
| gives blocc="abcdef" and alocc="ghi2j". | gives alocc="abcdef" and blocc="ghi2j". |
| If occ is not found blocc is null and alocc is equal to in. Returns blocc | If occ is not found blocc is null and alocc is equal to in. Returns blocc |
| */ | */ |
| char *s, *t; | char *s, *t; |
| Line 9619 int decoderesult ( char resultline[], in | Line 9625 int decoderesult ( char resultline[], in |
| return (0); | return (0); |
| } | } |
| if( j != cptcovs ){ /* Be careful if a variable is in a product but not single */ | if( j != cptcovs ){ /* Be careful if a variable is in a product but not single */ |
| printf("ERROR: the number of variable in the resultline, %d, differs from the number of variable used in the model line, %d.\n",j, cptcovs); | printf("ERROR: the number of variables in the resultline, %d, differs from the number of variables used in the model line, %d.\n",j, cptcovs); |
| fprintf(ficlog,"ERROR: the number of variable in the resultline, %d, differs from the number of variable used in the model line, %d.\n",j, cptcovs); | fprintf(ficlog,"ERROR: the number of variables in the resultline, %d, differs from the number of variables used in the model line, %d.\n",j, cptcovs); |
| } | } |
| for(k=1; k<=j;k++){ /* Loop on any covariate of the result line */ | for(k=1; k<=j;k++){ /* Loop on any covariate of the result line */ |
| if(nbocc(resultsav,'=') >1){ | if(nbocc(resultsav,'=') >1){ |
| cutl(stra,strb,resultsav,' '); /* keeps in strb after the first ' ' | cutl(stra,strb,resultsav,' '); /* keeps in strb after the first ' ' |
| resultsav= V4=1 V5=25.1 V3=0 strb=V3=0 stra= V4=1 V5=25.1 */ | resultsav= V4=1 V5=25.1 V3=0 stra= V5=25.1 V3=0 strb= V4=1 */ |
| cutl(strc,strd,strb,'='); /* strb:V4=1 strc=1 strd=V4 */ | cutl(strc,strd,strb,'='); /* strb:V4=1 strc=1 strd=V4 */ |
| }else | }else |
| cutl(strc,strd,resultsav,'='); | cutl(strc,strd,resultsav,'='); |
| Line 9650 int decoderesult ( char resultline[], in | Line 9656 int decoderesult ( char resultline[], in |
| } | } |
| } | } |
| if(match == 0){ | if(match == 0){ |
| printf("Error in result line: %d value missing; result: %s, model=%s\n",k1, resultline, model); | printf("Error in result line: V%d is missing in result: %s according to model=%s\n",k1, resultline, model); |
| fprintf(ficlog,"Error in result line: V%d is missing in result: %s according to model=%s\n",k1, resultline, model); | |
| return 1; | |
| } | } |
| } | } |
| } | } |
| Line 9667 int decoderesult ( char resultline[], in | Line 9675 int decoderesult ( char resultline[], in |
| } | } |
| if(match == 0){ | if(match == 0){ |
| printf("Error in result line: %d value missing; result: %s, model=%s\n",k1, resultline, model); | printf("Error in result line: %d value missing; result: %s, model=%s\n",k1, resultline, model); |
| fprintf(ficlog,"Error in result line: %d value missing; result: %s, model=%s\n",k1, resultline, model); | |
| return 1; | |
| }else if(match > 1){ | }else if(match > 1){ |
| printf("Error in result line: %d doubled; result: %s, model=%s\n",k2, resultline, model); | printf("Error in result line: %d doubled; result: %s, model=%s\n",k2, resultline, model); |
| fprintf(ficlog,"Error in result line: %d doubled; result: %s, model=%s\n",k2, resultline, model); | |
| return 1; | |
| } | } |
| } | } |
| Line 12509 Please run with mle=-1 to get a correct | Line 12521 Please run with mle=-1 to get a correct |
| fprintf(ficlog,"ERROR: Current version of IMaCh limits the number of resultlines to %d, you used %d\nYou can use the 'r' parameter file '%s' which uses option mle=0 to get other results. ",MAXRESULTLINES,nresult,rfileres); | fprintf(ficlog,"ERROR: Current version of IMaCh limits the number of resultlines to %d, you used %d\nYou can use the 'r' parameter file '%s' which uses option mle=0 to get other results. ",MAXRESULTLINES,nresult,rfileres); |
| goto end; | goto end; |
| } | } |
| decoderesult(resultline, nresult); /* Fills TKresult[nresult] combination and Tresult[nresult][k4+1] combination values */ | if(!decoderesult(resultline, nresult)){ /* Fills TKresult[nresult] combination and Tresult[nresult][k4+1] combination values */ |
| fprintf(ficparo,"result: %s\n",resultline); | fprintf(ficparo,"result: %s\n",resultline); |
| fprintf(ficres,"result: %s\n",resultline); | fprintf(ficres,"result: %s\n",resultline); |
| fprintf(ficlog,"result: %s\n",resultline); | fprintf(ficlog,"result: %s\n",resultline); |
| } else | |
| goto end; | |
| break; | break; |
| case 14: | case 14: |
| printf("Error: Unknown command '%s'\n",line); | printf("Error: Unknown command '%s'\n",line); |