GAMSlinks  0.4
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
GamsHandlerSmag Class Reference

Forwards requests for output and point transformations to the GAMS I/O library smag. More...

#include <GamsHandlerSmag.hpp>

Inheritance diagram for GamsHandlerSmag:
Inheritance graph
[legend]
Collaboration diagram for GamsHandlerSmag:
Collaboration graph
[legend]

Public Member Functions

 GamsHandlerSmag (smagRec *smag_=NULL)
 Constructor. More...
 
void setSmag (smagRec *smag_)
 Sets SMAG Handler. More...
 
void print (PrintMask mask, const char *msg) const
 Prints the given message into the GAMS output channels (log and/or status file). More...
 
void println (PrintMask mask, const char *msg) const
 Prints the given message plus an extra newline into the GAMS output channels (log and/or status file). More...
 
void flush (PrintMask mask=AllMask) const
 Flushes the buffer of a GAMS output channel. More...
 
void translateToGamsSpaceX (const double *x_, double objval_, double *x) const
 Translates a given point as seem by the GamsModel or smag user into the original gams space. More...
 
void translateToGamsSpaceLB (const double *lb_, double *lb) const
 Translates a given lower bound as seem by the GamsModel or smag user into the original gams space. More...
 
void translateToGamsSpaceUB (const double *ub_, double *ub) const
 Translates a given upper bound as seem by the GamsModel or smag user into the original gams space. More...
 
void translateFromGamsSpaceX (const double *x_, double *x) const
 Translates a given point from the original gams space into what the user sees in a GamsModel or smag. More...
 
bool translateFromGamsSpaceCol (const int *indices_, int *indices, int nr) const
 Translates given column indices from the original gams space into what the user sees in a GamsModel or smag. More...
 
int translateToGamsSpaceCol (int colindex) const
 Translates given column index into the original gams space. More...
 
int translateToGamsSpaceRow (int rowindex) const
 Translates given row index into the original gams space. More...
 
double getMInfinity () const
 GAMS value for minus infinity. More...
 
double getPInfinity () const
 GAMS value for plus infinity. More...
 
int getObjSense () const
 Objective sense: +1 for min, -1 for max. More...
 
int getColCount () const
 The number of columns in the possibly transformed problem space. More...
 
int getColCountGams () const
 The number of columns in the original gams space. More...
 
int getObjVariable () const
 The index of the objective variable in the original gams space. More...
 
int getObjRow () const
 The index of the objective row in the original gams space. More...
 
const char * getSystemDir () const
 Path to GAMS system. More...
 
bool isDictionaryWritten () const
 Indicates whether GAMS has written a dictionary file. More...
 
const char * dictionaryFile () const
 Gives the name of a dictionary file, if any. More...
 
int dictionaryVersion () const
 Gives the dictionary version. More...
 
- Public Member Functions inherited from GamsHandler
 GamsHandler ()
 Constructor. More...
 
virtual ~GamsHandler ()
 Destructor. More...
 

Static Private Member Functions

static int translateMask (const PrintMask &mask)
 

Private Attributes

smagRec * smag
 

Additional Inherited Members

- Public Types inherited from GamsHandler
enum  PrintMask { LogMask = 0x1, StatusMask = 0x2, AllMask = LogMask|StatusMask, LastPrintMask }
 Distinguishing between message types. More...
 

Detailed Description

Forwards requests for output and point transformations to the GAMS I/O library smag.

Definition at line 28 of file GamsHandlerSmag.hpp.

Constructor & Destructor Documentation

GamsHandlerSmag::GamsHandlerSmag ( smagRec *  smag_ = NULL)
inline

Constructor.

Parameters
smag_The SMAG handler. If NULL, then you need to set one later via setSmag().

Definition at line 38 of file GamsHandlerSmag.hpp.

Member Function Documentation

static int GamsHandlerSmag::translateMask ( const PrintMask mask)
inlinestaticprivate
void GamsHandlerSmag::setSmag ( smagRec *  smag_)
inline

Sets SMAG Handler.

Parameters
smag_Sets the SMAG handler.

Definition at line 43 of file GamsHandlerSmag.hpp.

References smag.

void GamsHandlerSmag::print ( PrintMask  mask,
const char *  msg 
) const
virtual

Prints the given message into the GAMS output channels (log and/or status file).

Implements GamsHandler.

void GamsHandlerSmag::println ( PrintMask  mask,
const char *  msg 
) const
virtual

Prints the given message plus an extra newline into the GAMS output channels (log and/or status file).

Implements GamsHandler.

void GamsHandlerSmag::flush ( PrintMask  mask = AllMask) const
virtual

Flushes the buffer of a GAMS output channel.

Implements GamsHandler.

void GamsHandlerSmag::translateToGamsSpaceX ( const double *  x_,
double  objval_,
double *  x 
) const
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.

Implements GamsHandler.

void GamsHandlerSmag::translateToGamsSpaceLB ( const double *  lb_,
double *  lb 
) const
virtual

Translates a given lower bound as seem by the GamsModel or smag user into the original gams space.

Implements GamsHandler.

void GamsHandlerSmag::translateToGamsSpaceUB ( const double *  ub_,
double *  ub 
) const
virtual

Translates a given upper bound as seem by the GamsModel or smag user into the original gams space.

Implements GamsHandler.

void GamsHandlerSmag::translateFromGamsSpaceX ( const double *  x_,
double *  x 
) const
virtual

Translates a given point from the original gams space into what the user sees in a GamsModel or smag.

Implements GamsHandler.

bool GamsHandlerSmag::translateFromGamsSpaceCol ( const int *  indices_,
int *  indices,
int  nr 
) const
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.

Implements GamsHandler.

int GamsHandlerSmag::translateToGamsSpaceCol ( int  colindex) const
virtual

Translates given column index into the original gams space.

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

Implements GamsHandler.

int GamsHandlerSmag::translateToGamsSpaceRow ( int  rowindex) const
virtual

Translates given row index into the original gams space.

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

Implements GamsHandler.

double GamsHandlerSmag::getMInfinity ( ) const
virtual

GAMS value for minus infinity.

Implements GamsHandler.

double GamsHandlerSmag::getPInfinity ( ) const
virtual

GAMS value for plus infinity.

Implements GamsHandler.

int GamsHandlerSmag::getObjSense ( ) const
virtual

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

Implements GamsHandler.

int GamsHandlerSmag::getColCount ( ) const
virtual

The number of columns in the possibly transformed problem space.

Implements GamsHandler.

int GamsHandlerSmag::getColCountGams ( ) const
virtual

The number of columns in the original gams space.

Implements GamsHandler.

int GamsHandlerSmag::getObjVariable ( ) const
virtual

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

Implements GamsHandler.

int GamsHandlerSmag::getObjRow ( ) const
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.

Implements GamsHandler.

const char* GamsHandlerSmag::getSystemDir ( ) const
virtual

Path to GAMS system.

Implements GamsHandler.

bool GamsHandlerSmag::isDictionaryWritten ( ) const
virtual

Indicates whether GAMS has written a dictionary file.

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

Implements GamsHandler.

const char* GamsHandlerSmag::dictionaryFile ( ) const
virtual

Gives the name of a dictionary file, if any.

Returns
Name of dictionary file, or NULL if none.

Implements GamsHandler.

int GamsHandlerSmag::dictionaryVersion ( ) const
virtual

Gives the dictionary version.

Returns
Version of dictionary.

Implements GamsHandler.

Member Data Documentation

smagRec* GamsHandlerSmag::smag
private

Definition at line 30 of file GamsHandlerSmag.hpp.

Referenced by setSmag().


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