GAMSlinks  0.4
GamsHandlerIOLib.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: GamsHandlerIOLib.hpp 510 2008-08-16 19:31:27Z stefan $
6 //
7 // Author: Stefan Vigerske
8 
9 #ifndef GAMSHANDLERIOLIB_HPP_
10 #define GAMSHANDLERIOLIB_HPP_
11 
12 #include "GamsHandler.hpp"
13 
16 class GamsHandlerIOLib : public GamsHandler {
17 private:
19 
20 public:
24  GamsHandlerIOLib(bool is_reformulated_) : is_reformulated(is_reformulated_) { }
25 
26  void print(PrintMask mask, const char* msg) const;
27 
28  void println(PrintMask mask, const char* msg) const;
29 
30  void flush(PrintMask mask=AllMask) const;
31 
32  void translateToGamsSpaceX(const double* x_, double objval_, double* x) const;
33  void translateToGamsSpaceLB(const double* lb_, double* lb) const;
34  void translateToGamsSpaceUB(const double* ub_, double* ub) const;
35  void translateFromGamsSpaceX(const double* x_, double* x) const;
36  bool translateFromGamsSpaceCol(const int* indices_, int* indices, int nr) const;
37  int translateToGamsSpaceCol(int colindex) const;
38  int translateToGamsSpaceRow(int rowindex) const;
39 
40  double getMInfinity() const;
41  double getPInfinity() const;
42 
43  int getObjSense() const;
44 
45  int getColCount() const;
46  int getColCountGams() const;
47  int getObjVariable() const;
48  int getObjRow() const;
49 
50  const char* getSystemDir() const;
51 
52  bool isDictionaryWritten() const;
53  const char* dictionaryFile() const;
54  int dictionaryVersion() const;
55 };
56 
57 
58 #endif /*GAMSHANDLERIOLIB_HPP_*/
void flush(PrintMask mask=AllMask) const
Flushes the buffer of a GAMS output channel.
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...
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 o...
int dictionaryVersion() const
Gives the dictionary version.
int getObjSense() const
Objective sense: +1 for min, -1 for max.
int getObjVariable() const
The index of the objective variable in the original gams space.
double getMInfinity() const
GAMS value for minus infinity.
GamsHandlerIOLib(bool is_reformulated_)
Constructor.
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)...
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...
Forwards requests for output, point transformations, dictionary files, and other things to a GAMS I/O...
Definition: GamsHandler.hpp:18
const char * dictionaryFile() const
Gives the name of a dictionary file, if any.
int getColCount() const
The number of columns in the possibly transformed problem space.
bool isDictionaryWritten() const
Indicates whether GAMS has written a dictionary file.
int getColCountGams() const
The number of columns in the original gams space.
int translateToGamsSpaceCol(int colindex) const
Translates given column index into the original gams space.
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...
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...
void print(PrintMask mask, const char *msg) const
Prints the given message into the GAMS output channels (log and/or status file).
PrintMask
Distinguishing between message types.
Definition: GamsHandler.hpp:23
const char * getSystemDir() const
Path to GAMS system.
int getObjRow() const
The index of the objective row in the original gams space.
double getPInfinity() const
GAMS value for plus infinity.
int translateToGamsSpaceRow(int rowindex) const
Translates given row index into the original gams space.
Forwards requests for output and point transformations to the GAMS I/O library iolib.