35 int main(
int argc,
char *argv[])
45 real_t maxNWSR, avgNWSR, maxCPUtime, avgCPUtime;
46 real_t maxStationarity, maxFeasibility, maxComplementarity;
49 int nfail = 0, npass = 0;
51 struct dirent **namelist;
52 char resstr[200], OQPproblem[200];
68 nproblems = scandir(
"../testing/c/data/problems", &namelist, NULL, alphasort);
84 printf(
"%10s %9s %9s %9s %6s %-12s\n",
"problem",
"stat",
85 "feas",
"compl",
"nWSR",
"result");
86 for (i = 0; i < nproblems; i++)
91 if (namelist[i]->d_name[0] ==
'.' || namelist[i]->d_name[0] ==
'c')
96 problem = namelist[i]->d_name;
103 fprintf(stdout,
"%-10s ", problem);
106 snprintf(OQPproblem, 199,
"../testing/c/data/problems/%s/", problem);
108 maxAllowedNWSR = 3500;
110 isSparse,useHotstarts,
111 &options,maxAllowedNWSR,
112 &maxNWSR,&avgNWSR,&maxCPUtime,&avgCPUtime,
113 &maxStationarity,&maxFeasibility,&maxComplementarity
116 && maxStationarity < TOL
117 && maxFeasibility < TOL
118 && maxComplementarity < TOL)
121 strncpy(resstr,
"pass", 199);
126 snprintf (resstr, 199,
"fail (%d)", returnvalue);
128 fprintf(stdout,
"%9.2e %9.2e %9.2e %6d %-12s\n", maxStationarity,
129 maxFeasibility, maxComplementarity, (
int)maxNWSR, resstr);
131 if (scannedDir) free(namelist[i]);
133 if (scannedDir) free(namelist);
137 printf(
"Testbench results:\n" );
138 printf(
"======================\n\n" );
139 printf(
"Pass: %3d\n", npass);
140 printf(
"Fail: %3d\n", nfail);
141 printf(
"Ratio: %5.1f%%\n", 100.0 * (
real_t)npass / (
real_t)(npass+nfail));
Allows to pass back messages to the calling function.
int main(int argc, char *argv[])
Provides a generic way to set and pass user-specified options.
returnValue qpOASES_myPrintf(const char *s)
returnValue Options_setToMPC(Options *_THIS)
returnValue Options_setToDefault(Options *_THIS)