36 gmoModelStatSet(
gmo, ModelStat_ErrorNoSolution);
37 gmoSolveStatSet(
gmo, SolveStat_SolverErr);
38 gevLogStat(
gev,
"Error: OS result does not have header.");
43 gmoModelStatSet(
gmo, ModelStat_ErrorNoSolution);
44 gmoSolveStatSet(
gmo, SolveStat_SolverErr);
45 gevLogStatPChar(
gev,
"Error: OS result reports error: ");
51 gevLogStatPChar(
gev,
"Warning: OS result reports warning: ");
55 gmoSolveStatSet(
gmo, SolveStat_Normal);
59 gmoModelStatSet(
gmo, ModelStat_NoSolutionReturned);
63 gmoModelStatSet(
gmo, ModelStat_Unbounded);
67 gmoModelStatSet(
gmo, ModelStat_OptimalGlobal);
71 gmoModelStatSet(
gmo, ModelStat_OptimalLocal);
75 gmoModelStatSet(
gmo, ModelStat_OptimalGlobal);
79 gmoModelStatSet(
gmo, ModelStat_NonOptimalIntermed);
83 gmoModelStatSet(
gmo, ModelStat_NonOptimalIntermed);
87 gmoModelStatSet(
gmo, ModelStat_InfeasibleGlobal);
91 gmoSolveStatSet(
gmo, SolveStat_Iteration);
92 gmoModelStatSet(
gmo, ModelStat_InfeasibleIntermed);
96 gmoModelStatSet(
gmo, ModelStat_InfeasibleIntermed);
100 gmoModelStatSet(
gmo, ModelStat_ErrorUnknown);
104 gmoModelStatSet(
gmo, ModelStat_InfeasibleIntermed);
108 gmoModelStatSet(
gmo, ModelStat_ErrorUnknown);
113 gevLogStat(
gev,
"Error: Number of variables in OS result does not match with gams model.");
114 gmoModelStatSet(
gmo, ModelStat_ErrorNoSolution);
115 gmoSolveStatSet(
gmo, SolveStat_SystemErr);
120 gevLogStat(
gev,
"Error: Number of constraints in OS result does not match with gams model.");
121 gmoModelStatSet(
gmo, ModelStat_ErrorNoSolution);
122 gmoSolveStatSet(
gmo, SolveStat_SystemErr);
128#define SMAG_DBL_NA -1E20
129 int* colBasStat = CoinCopyOfArray((
int*)NULL, gmoN(
gmo), (
int)Bstat_Super);
130 int* colIndic = CoinCopyOfArray((
int*)NULL, gmoN(
gmo), (
int)Cstat_OK);
131 double* colMarg = CoinCopyOfArray((
double*)NULL, gmoN(
gmo),
SMAG_DBL_NA);
132 double* colLev = CoinCopyOfArray((
double*)NULL, gmoN(
gmo),
SMAG_DBL_NA);
134 int* rowBasStat = CoinCopyOfArray((
int*)NULL, gmoM(
gmo), (
int)Bstat_Super);
135 int* rowIndic = CoinCopyOfArray((
int*)NULL, gmoM(
gmo), (
int)Cstat_OK);
136 double* rowLev = CoinCopyOfArray((
double*)NULL, gmoM(
gmo),
SMAG_DBL_NA);
137 double* rowMarg = CoinCopyOfArray((
double*)NULL, gmoM(
gmo),
SMAG_DBL_NA);
144 if (sol->constraints && sol->constraints->dualValues)
148 for (
int i=0; i < sol->constraints->dualValues->numberOfCon; i++)
149 rowMarg[sol->constraints->dualValues->con[i]->idx] = sol->constraints->dualValues->con[i]->value;
150 if (sol->variables && sol->variables->values)
154 for (
int i=0; i < sol->variables->values->numberOfVar; i++)
155 colLev[sol->variables->values->var[i]->idx] = sol->variables->values->var[i]->value;
157 for (
int i=0; i<sol->variables->numberOfOtherVariableResults; ++i)
159 if (sol->variables->other[i]->name==
"reduced_costs")
164 for (
int j=0; j < sol->variables->other[i]->numberOfVar; j++)
165 colLev[sol->variables->other[i]->var[j]->idx] = atof(sol->variables->other[i]->var[j]->value.c_str());
170 gmoSetSolution8(
gmo, colLev, colMarg, rowMarg, rowLev, colBasStat, colIndic, rowBasStat, rowIndic);
181 if (sol->objectives && sol->objectives->values && sol->objectives->values->obj[0])
182 gmoSetHeadnTail(
gmo, HobjVal, sol->objectives->values->obj[0]->value);