GamsHandler Class Reference

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]
List of all members.

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.

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

enum GamsHandler::PrintMask

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 (  )  [inline, virtual]

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

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.

Parameters:
indices_ Array of column indices of length nr (input).
indices Array of length nr to store column indices (output).
nr Length 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 GamsHandlerIOLib, and GamsHandlerSmag.

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

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

virtual double GamsHandler::getMInfinity (  )  const [pure virtual]

GAMS value for minus infinity.

Implemented in GamsHandlerIOLib, and GamsHandlerSmag.

virtual double GamsHandler::getPInfinity (  )  const [pure virtual]

GAMS value for plus infinity.

Implemented in GamsHandlerIOLib, and GamsHandlerSmag.

virtual int GamsHandler::getObjSense (  )  const [pure virtual]

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

Implemented in GamsHandlerIOLib, and GamsHandlerSmag.

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]

Path to GAMS system.

Implemented in GamsHandlerIOLib, and GamsHandlerSmag.

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

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

virtual int GamsHandler::dictionaryVersion (  )  const [pure virtual]

Gives the dictionary version.

Returns:
Version of dictionary.

Implemented in GamsHandlerIOLib, and GamsHandlerSmag.


The documentation for this class was generated from the following file:
Generated on Tue Dec 30 03:01:29 2008 for GAMSlinks by  doxygen 1.4.7