00001 // Copyright (C) 2008 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // $Id: GamsHandlerSmag.hpp 510 2008-08-16 19:31:27Z stefan $ 00006 // 00007 // Author: Stefan Vigerske 00008 00009 #ifndef GAMSHANDLERSMAG_HPP_ 00010 #define GAMSHANDLERSMAG_HPP_ 00011 00012 #include "GamsHandler.hpp" 00013 00014 #ifdef HAVE_CSTDLIB 00015 #include <cstdlib> 00016 #else 00017 #ifdef HAVE_STDLIB_H 00018 #include <stdlib.h> 00019 #else 00020 #error "don't have header file for stdlib" 00021 #endif 00022 #endif 00023 00024 struct smagRec; 00025 00028 class GamsHandlerSmag : public GamsHandler { 00029 private: 00030 smagRec* smag; 00031 00032 static inline int translateMask(const PrintMask& mask); 00033 00034 public: 00038 GamsHandlerSmag(smagRec* smag_ = NULL) : smag(smag_) { } 00039 00043 void setSmag(smagRec* smag_) { smag=smag_; } 00044 00045 void print(PrintMask mask, const char* msg) const; 00046 00047 void println(PrintMask mask, const char* msg) const; 00048 00049 void flush(PrintMask mask=AllMask) const; 00050 00051 void translateToGamsSpaceX(const double* x_, double objval_, double* x) const; 00052 void translateToGamsSpaceLB(const double* lb_, double* lb) const; 00053 void translateToGamsSpaceUB(const double* ub_, double* ub) const; 00054 void translateFromGamsSpaceX(const double* x_, double* x) const; 00055 bool translateFromGamsSpaceCol(const int* indices_, int* indices, int nr) const; 00056 int translateToGamsSpaceCol(int colindex) const; 00057 int translateToGamsSpaceRow(int rowindex) const; 00058 00059 double getMInfinity() const; 00060 double getPInfinity() const; 00061 00062 int getObjSense() const; 00063 00064 int getColCount() const; 00065 int getColCountGams() const; 00066 int getObjVariable() const; 00067 int getObjRow() const; 00068 00069 const char* getSystemDir() const; 00070 00071 bool isDictionaryWritten() const; 00072 const char* dictionaryFile() const; 00073 int dictionaryVersion() const; 00074 }; // class GamsHandlerSmag 00075 00076 00077 #endif /*GAMSHANDLERSMAG_HPP_*/