GAMSlinks  0.4
Public Types | Public Member Functions | List of all members
GamsHandler Class Referenceabstract

Forwards requests for output, point transformations, dictionary files, and other things to a GAMS I/O library. More...

#include <GamsHandler.hpp>

Inheritance diagram for GamsHandler:
Inheritance graph
[legend]

Public Types

enum  PrintMask { LogMask = 0x1, StatusMask = 0x2, AllMask = LogMask|StatusMask, LastPrintMask }
 Distinguishing between message types. More...
 

Public Member Functions

 GamsHandler ()
 Constructor. More...
 
virtual ~GamsHandler ()
 Destructor. More...
 
virtual void print (PrintMask mask, const char *msg) const =0
 Prints the given message into the GAMS output channels (log and/or status file). More...
 
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). More...
 
virtual void flush (PrintMask mask=AllMask) const =0
 Flushes the buffer of a GAMS output channel. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual int translateToGamsSpaceCol (int colindex) const =0
 Translates given column index into the original gams space. More...
 
virtual int translateToGamsSpaceRow (int rowindex) const =0
 Translates given row index into the original gams space. More...
 
virtual double getMInfinity () const =0
 GAMS value for minus infinity. More...
 
virtual double getPInfinity () const =0
 GAMS value for plus infinity. More...
 
virtual int getObjSense () const =0
 Objective sense: +1 for min, -1 for max. More...
 
virtual int getColCount () const =0
 The number of columns in the possibly transformed problem space. More...
 
virtual int getColCountGams () const =0
 The number of columns in the original gams space. More...
 
virtual int getObjVariable () const =0
 The index of the objective variable in the original gams space. More...
 
virtual int getObjRow () const =0
 The index of the objective row in the original gams space. More...
 
virtual const char * getSystemDir () const =0
 Path to GAMS system. More...
 
virtual bool isDictionaryWritten () const =0
 Indicates whether GAMS has written a dictionary file. More...
 
virtual const char * dictionaryFile () const =0
 Gives the name of a dictionary file, if any. More...
 
virtual int dictionaryVersion () const =0
 Gives the dictionary version. More...
 

Detailed Description

Forwards requests for output, point transformations, dictionary files, and other things to a GAMS I/O library.

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.

Member Enumeration Documentation

Distinguishing between message types.

Enumerator
LogMask 
StatusMask 
AllMask 
LastPrintMask 

Definition at line 23 of file GamsHandler.hpp.

Constructor & Destructor Documentation

GamsHandler::GamsHandler ( )
inline

Constructor.

Definition at line 34 of file GamsHandler.hpp.

virtual GamsHandler::~GamsHandler ( )
inlinevirtual

Destructor.

Definition at line 38 of file GamsHandler.hpp.

Member Function Documentation

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).

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

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).

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual void GamsHandler::flush ( PrintMask  mask = AllMask) const
pure virtual

Flushes the buffer of a GAMS output channel.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

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 GamsHandlerSmag, and GamsHandlerIOLib.

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 GamsHandlerSmag, and GamsHandlerIOLib.

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 GamsHandlerSmag, and GamsHandlerIOLib.

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 GamsHandlerSmag, and GamsHandlerIOLib.

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.

Parameters
indices_Array of column indices of length nr (input).
indicesArray of length nr to store column indices (output).
nrLength of arrays.
Returns
False if there was an error, e.g., a column index is given that was reformulated out by GamsModel or smag (e.g., objective variable). True otherwise.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual int GamsHandler::translateToGamsSpaceCol ( int  colindex) const
pure virtual

Translates given column index into the original gams space.

Returns
-1 if failure, the column index in gams space otherwise.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual int GamsHandler::translateToGamsSpaceRow ( int  rowindex) const
pure virtual

Translates given row index into the original gams space.

Returns
-1 if failure, the row index in gams space otherwise.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual double GamsHandler::getMInfinity ( ) const
pure virtual

GAMS value for minus infinity.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual double GamsHandler::getPInfinity ( ) const
pure virtual

GAMS value for plus infinity.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual int GamsHandler::getObjSense ( ) const
pure virtual

Objective sense: +1 for min, -1 for max.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual int GamsHandler::getColCount ( ) const
pure virtual

The number of columns in the possibly transformed problem space.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

Referenced by GamsBCH::getNumCols().

virtual int GamsHandler::getColCountGams ( ) const
pure virtual

The number of columns in the original gams space.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual int GamsHandler::getObjVariable ( ) const
pure virtual

The index of the objective variable in the original gams space.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

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 GamsHandlerSmag, and GamsHandlerIOLib.

virtual const char* GamsHandler::getSystemDir ( ) const
pure virtual

Path to GAMS system.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual bool GamsHandler::isDictionaryWritten ( ) const
pure virtual

Indicates whether GAMS has written a dictionary file.

Returns
True if dictionary file had been written, False else.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual const char* GamsHandler::dictionaryFile ( ) const
pure virtual

Gives the name of a dictionary file, if any.

Returns
Name of dictionary file, or NULL if none.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.

virtual int GamsHandler::dictionaryVersion ( ) const
pure virtual

Gives the dictionary version.

Returns
Version of dictionary.

Implemented in GamsHandlerSmag, and GamsHandlerIOLib.


The documentation for this class was generated from the following file: