GAMSlinks  0.4
GamsHandler.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008
2 // All Rights Reserved.
3 // This code is published under the Common Public License.
4 //
5 // $Id: GamsHandler.hpp 510 2008-08-16 19:31:27Z stefan $
6 //
7 // Author: Stefan Vigerske
8 
9 #ifndef GAMSHANDLER_HPP_
10 #define GAMSHANDLER_HPP_
11 
12 #include "GAMSlinksConfig.h"
13 
18 class GamsHandler {
19 
20 public:
23  enum PrintMask {
24  LogMask = 0x1,
25  StatusMask = 0x2,
28  };
29 
30 
31 public:
35 
38  virtual ~GamsHandler() { }
39 
42  virtual void print(PrintMask mask, const char* msg) const=0;
43 
46  virtual void println(PrintMask mask, const char* msg) const=0;
47 
50  virtual void flush(PrintMask mask=AllMask) const=0;
51 
55  virtual void translateToGamsSpaceX(const double* x_, double objval_, double* x) const=0;
58  virtual void translateToGamsSpaceLB(const double* lb_, double* lb) const=0;
61  virtual void translateToGamsSpaceUB(const double* ub_, double* ub) const=0;
64  virtual void translateFromGamsSpaceX(const double* x_, double* x) const=0;
65 
73  virtual bool translateFromGamsSpaceCol(const int* indices_, int* indices, int nr) const=0;
77  virtual int translateToGamsSpaceCol(int colindex) const=0;
81  virtual int translateToGamsSpaceRow(int rowindex) const=0;
82 
83 
86  virtual double getMInfinity() const=0;
89  virtual double getPInfinity() const=0;
90 
93  virtual int getObjSense() const=0;
94 
97  virtual int getColCount() const=0;
100  virtual int getColCountGams() const=0;
103  virtual int getObjVariable() const=0;
107  virtual int getObjRow() const=0;
108 
111  virtual const char* getSystemDir() const=0;
112 
116  virtual bool isDictionaryWritten() const=0;
120  virtual const char* dictionaryFile() const=0;
124  virtual int dictionaryVersion() const=0;
125 }; // class GamsHandler
126 
127 
128 #endif /*GAMSHANDLER_HPP_*/
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 const char * getSystemDir() const =0
Path to GAMS system.
virtual const char * dictionaryFile() const =0
Gives the name of a dictionary file, if any.
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 int getColCount() const =0
The number of columns in the possibly transformed problem space.
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 int translateToGamsSpaceCol(int colindex) const =0
Translates given column index into the original gams space.
virtual double getMInfinity() const =0
GAMS value for minus infinity.
virtual int getObjSense() const =0
Objective sense: +1 for min, -1 for max.
GamsHandler()
Constructor.
Definition: GamsHandler.hpp:34
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 o...
Forwards requests for output, point transformations, dictionary files, and other things to a GAMS I/O...
Definition: GamsHandler.hpp:18
virtual ~GamsHandler()
Destructor.
Definition: GamsHandler.hpp:38
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 int getObjVariable() const =0
The index of the objective variable in the original gams space.
virtual void flush(PrintMask mask=AllMask) const =0
Flushes the buffer of a GAMS output channel.
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 int getColCountGams() const =0
The number of columns in the original gams space.
PrintMask
Distinguishing between message types.
Definition: GamsHandler.hpp:23
virtual double getPInfinity() const =0
GAMS value for plus infinity.
virtual int translateToGamsSpaceRow(int rowindex) const =0
Translates given row index into the original gams space.
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 int dictionaryVersion() const =0
Gives the dictionary version.
virtual bool isDictionaryWritten() const =0
Indicates whether GAMS has written a dictionary file.
virtual int getObjRow() const =0
The index of the objective row in the original gams space.