#include <GamsHandler.hpp>
Inheritance diagram for GamsHandler:
Public Types | |
LogMask = 0x1 | |
StatusMask = 0x2 | |
AllMask = LogMask|StatusMask | |
LastPrintMask | |
enum | PrintMask { LogMask = 0x1, StatusMask = 0x2, AllMask = LogMask|StatusMask, LastPrintMask } |
Distinguishing between message types. More... | |
Public Member Functions | |
GamsHandler () | |
Constructor. | |
virtual | ~GamsHandler () |
Destructor. | |
virtual void | print (PrintMask mask, const char *msg) const =0 |
Prints the given message into the GAMS output channels (log and/or status file). | |
virtual void | println (PrintMask mask, const char *msg) const =0 |
Prints the given message plus an extra newline into the GAMS output channels (log and/or status file). | |
virtual void | flush (PrintMask mask=AllMask) const =0 |
Flushes the buffer of a GAMS output channel. | |
virtual void | translateToGamsSpaceX (const double *x_, double objval_, double *x) const =0 |
Translates a given point as seem by the GamsModel or smag user into the original gams space. | |
virtual void | translateToGamsSpaceLB (const double *lb_, double *lb) const =0 |
Translates a given lower bound as seem by the GamsModel or smag user into the original gams space. | |
virtual void | translateToGamsSpaceUB (const double *ub_, double *ub) const =0 |
Translates a given upper bound as seem by the GamsModel or smag user into the original gams space. | |
virtual void | translateFromGamsSpaceX (const double *x_, double *x) const =0 |
Translates a given point from the original gams space into what the user sees in a GamsModel or smag. | |
virtual bool | translateFromGamsSpaceCol (const int *indices_, int *indices, int nr) const =0 |
Translates given column indices from the original gams space into what the user sees in a GamsModel or smag. | |
virtual int | translateToGamsSpaceCol (int colindex) const =0 |
Translates given column index into the original gams space. | |
virtual int | translateToGamsSpaceRow (int rowindex) const =0 |
Translates given row index into the original gams space. | |
virtual double | getMInfinity () const =0 |
GAMS value for minus infinity. | |
virtual double | getPInfinity () const =0 |
GAMS value for plus infinity. | |
virtual int | getObjSense () const =0 |
Objective sense: +1 for min, -1 for max. | |
virtual int | getColCount () const =0 |
The number of columns in the possibly transformed problem space. | |
virtual int | getColCountGams () const =0 |
The number of columns in the original gams space. | |
virtual int | getObjVariable () const =0 |
The index of the objective variable in the original gams space. | |
virtual int | getObjRow () const =0 |
The index of the objective row in the original gams space. | |
virtual const char * | getSystemDir () const =0 |
Path to GAMS system. | |
virtual bool | isDictionaryWritten () const =0 |
Indicates whether GAMS has written a dictionary file. | |
virtual const char * | dictionaryFile () const =0 |
Gives the name of a dictionary file, if any. | |
virtual int | dictionaryVersion () const =0 |
Gives the dictionary version. |
The use of this class is to provide a uniformed interface to some operations for different GAMS I/O libraries (iolib and smag). It is not meant to become a layer that allows an exchangable use of smag and iolib.
Definition at line 18 of file GamsHandler.hpp.
GamsHandler::GamsHandler | ( | ) | [inline] |
virtual GamsHandler::~GamsHandler | ( | ) | [inline, virtual] |
virtual void GamsHandler::print | ( | PrintMask | mask, | |
const char * | msg | |||
) | const [pure virtual] |
Prints the given message into the GAMS output channels (log and/or status file).
virtual void GamsHandler::println | ( | PrintMask | mask, | |
const char * | msg | |||
) | const [pure virtual] |
Prints the given message plus an extra newline into the GAMS output channels (log and/or status file).
virtual void GamsHandler::flush | ( | PrintMask | mask = AllMask |
) | const [pure virtual] |
Flushes the buffer of a GAMS output channel.
virtual void GamsHandler::translateToGamsSpaceX | ( | const double * | x_, | |
double | objval_, | |||
double * | x | |||
) | const [pure virtual] |
Translates a given point as seem by the GamsModel or smag user into the original gams space.
These are different because GamsModel and SMAG reformulate the objective function, if possible.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual void GamsHandler::translateToGamsSpaceLB | ( | const double * | lb_, | |
double * | lb | |||
) | const [pure virtual] |
Translates a given lower bound as seem by the GamsModel or smag user into the original gams space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual void GamsHandler::translateToGamsSpaceUB | ( | const double * | ub_, | |
double * | ub | |||
) | const [pure virtual] |
Translates a given upper bound as seem by the GamsModel or smag user into the original gams space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual void GamsHandler::translateFromGamsSpaceX | ( | const double * | x_, | |
double * | x | |||
) | const [pure virtual] |
Translates a given point from the original gams space into what the user sees in a GamsModel or smag.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual bool GamsHandler::translateFromGamsSpaceCol | ( | const int * | indices_, | |
int * | indices, | |||
int | nr | |||
) | const [pure virtual] |
Translates given column indices from the original gams space into what the user sees in a GamsModel or smag.
Here, input and output are allowed to be the same array.
indices_ | Array of column indices of length nr (input). | |
indices | Array of length nr to store column indices (output). | |
nr | Length of arrays. |
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual int GamsHandler::translateToGamsSpaceCol | ( | int | colindex | ) | const [pure virtual] |
Translates given column index into the original gams space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual int GamsHandler::translateToGamsSpaceRow | ( | int | rowindex | ) | const [pure virtual] |
Translates given row index into the original gams space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual double GamsHandler::getMInfinity | ( | ) | const [pure virtual] |
virtual double GamsHandler::getPInfinity | ( | ) | const [pure virtual] |
virtual int GamsHandler::getObjSense | ( | ) | const [pure virtual] |
virtual int GamsHandler::getColCount | ( | ) | const [pure virtual] |
The number of columns in the possibly transformed problem space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
Referenced by GamsBCH::getNumCols().
virtual int GamsHandler::getColCountGams | ( | ) | const [pure virtual] |
The number of columns in the original gams space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual int GamsHandler::getObjVariable | ( | ) | const [pure virtual] |
The index of the objective variable in the original gams space.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual int GamsHandler::getObjRow | ( | ) | const [pure virtual] |
The index of the objective row in the original gams space.
Returns -1 if the problem has not been reformulated and thus the objective has not been lifted.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual const char* GamsHandler::getSystemDir | ( | ) | const [pure virtual] |
virtual bool GamsHandler::isDictionaryWritten | ( | ) | const [pure virtual] |
Indicates whether GAMS has written a dictionary file.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual const char* GamsHandler::dictionaryFile | ( | ) | const [pure virtual] |
Gives the name of a dictionary file, if any.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.
virtual int GamsHandler::dictionaryVersion | ( | ) | const [pure virtual] |
Gives the dictionary version.
Implemented in GamsHandlerIOLib, and GamsHandlerSmag.