GAMSlinks  0.4
Functions
GamsFinalize.hpp File Reference
#include "GamsModel.hpp"
#include "GamsMessageHandler.hpp"
#include "OsiSolverInterface.hpp"
Include dependency graph for GamsFinalize.hpp:

Go to the source code of this file.

Functions

void GamsFinalizeOsi (GamsModel *gm, GamsMessageHandler *myout, OsiSolverInterface *solver, bool TimeLimitExceeded=false, bool HaveFeasibleSolution=false, bool swapRowStatus=false)
 Analyze solution stored in an OsiSolverInterface and writes GAMS solution file. More...
 
void GamsWriteSolutionOsi (GamsModel *gm, GamsMessageHandler *myout, OsiSolverInterface *solver, bool swapRowStatus=false)
 Writes GAMS solution file for a solution stored in an OsiSolverInterface. More...
 

Function Documentation

void GamsFinalizeOsi ( GamsModel gm,
GamsMessageHandler myout,
OsiSolverInterface *  solver,
bool  TimeLimitExceeded = false,
bool  HaveFeasibleSolution = false,
bool  swapRowStatus = false 
)

Analyze solution stored in an OsiSolverInterface and writes GAMS solution file.

See Also
GamsWriteSolutionOsi on how the solution is written.
Parameters
gmThe GamsModel.
myoutA GAMS message handler for output.
solverThe OSI solver interface to read the solution from.
TimeLimitExceededIndicate, whether a time limit was exceeded. (Time Limits are not directly supported by OsiSolverInterface.)
HaveFeasibleSolutionIn case that time or iteration limit is exceeded, this indicates whether a feasible solution was found. (Feasibility checks are not directly supported by OsiSolverInterface.)
swapRowStatusSome OSI solvers think in term of artifical variables when dealing with the basis status of a row. Hence, the row status CoinWarmStartBasis::atLowerBound correponds to GamsModel::NonBasicUpper, and similar for atUpperBound. Setting swapRowStatus to true swaps atLowerBound and atUpperBound so that the row status in GAMS is correct again.
void GamsWriteSolutionOsi ( GamsModel gm,
GamsMessageHandler myout,
OsiSolverInterface *  solver,
bool  swapRowStatus = false 
)

Writes GAMS solution file for a solution stored in an OsiSolverInterface.

If solver->optimalBasisIsAvailable() returns positive, the basis returned by solver->getBasisStatus is used. Else, if solver->getWarmStart() returns a basis, then this basis is used. Otherwise we try to guess a basis, which is likely to fail.

Parameters
gmThe GamsModel.
myoutA GAMS message handler for output.
solverThe OSI solver interface to read the solution from.
swapRowStatusSome OSI solvers think in term of artifical variables when dealing with the basis status of a row. Hence, the row status CoinWarmStartBasis::atLowerBound correponds to GamsModel::NonBasicUpper, and similar for atUpperBound. Setting swapRowStatus to true swaps atLowerBound and atUpperBound so that the row status in GAMS is correct again.