36 gmoModelStatSet(
gmo, ModelStat_ErrorNoSolution);
37 gmoSolveStatSet(
gmo, SolveStat_SolverErr);
38 gevLogStat(
gev,
"Error: OS result does not have header.");
41 else if (
osresult.getGeneralStatusType() ==
"error")
43 gmoModelStatSet(
gmo, ModelStat_ErrorNoSolution);
44 gmoSolveStatSet(
gmo, SolveStat_SolverErr);
45 gevLogStatPChar(
gev,
"Error: OS result reports error: ");
46 gevLogStat(
gev,
osresult.getGeneralMessage().c_str());
49 else if (
osresult.getGeneralStatusType() ==
"warning")
51 gevLogStatPChar(
gev,
"Warning: OS result reports warning: ");
52 gevLogStat(
gev,
osresult.getGeneralMessage().c_str());
55 gmoSolveStatSet(
gmo, SolveStat_Normal);
57 if (
osresult.getSolutionNumber() == 0)
59 gmoModelStatSet(
gmo, ModelStat_NoSolutionReturned);
61 else if (
osresult.getSolutionStatusType(0) ==
"unbounded")
63 gmoModelStatSet(
gmo, ModelStat_Unbounded);
65 else if (
osresult.getSolutionStatusType(0) ==
"globallyOptimal")
67 gmoModelStatSet(
gmo, ModelStat_OptimalGlobal);
69 else if (
osresult.getSolutionStatusType(0) ==
"locallyOptimal")
71 gmoModelStatSet(
gmo, ModelStat_OptimalLocal);
73 else if (
osresult.getSolutionStatusType(0) ==
"optimal")
75 gmoModelStatSet(
gmo, ModelStat_OptimalGlobal);
77 else if (
osresult.getSolutionStatusType(0) ==
"bestSoFar")
79 gmoModelStatSet(
gmo, ModelStat_NonOptimalIntermed);
81 else if (
osresult.getSolutionStatusType(0) ==
"feasible")
83 gmoModelStatSet(
gmo, ModelStat_NonOptimalIntermed);
85 else if (
osresult.getSolutionStatusType(0) ==
"infeasible")
87 gmoModelStatSet(
gmo, ModelStat_InfeasibleGlobal);
89 else if (
osresult.getSolutionStatusType(0) ==
"stoppedByLimit")
91 gmoSolveStatSet(
gmo, SolveStat_Iteration);
92 gmoModelStatSet(
gmo, ModelStat_InfeasibleIntermed);
94 else if (
osresult.getSolutionStatusType(0) ==
"unsure")
96 gmoModelStatSet(
gmo, ModelStat_InfeasibleIntermed);
98 else if (
osresult.getSolutionStatusType(0) ==
"error")
100 gmoModelStatSet(
gmo, ModelStat_ErrorUnknown);
102 else if (
osresult.getSolutionStatusType(0) ==
"other")
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);
170 gmoSetSolution8(
gmo, colLev, colMarg, rowMarg, rowLev, colBasStat, colIndic, rowBasStat, rowIndic);