OBOE
0.1
|
00001 // Copyright (c) 2004-2007 University of Geneva, HEC, Logilab 00002 // 00003 // OBOE is published under the Common Public License. 00004 // 00005 // Authors : 00006 // Nidhi Sawhney <nsawhney@yahoo.com> 00007 // The OBOE team 00008 // 00009 00010 #ifndef LOCSET_H 00011 #define LOCSET_H 00012 00017 #include "AccpmGenMatrix.h" 00018 #include "Manager.h" 00019 00020 #include "config.h" 00021 00022 #ifdef OBOE_HAS_GLPK 00023 extern "C" { 00024 #include "glpk.h" 00025 } 00026 #endif 00027 00028 #ifdef COIN_HAS_GLPK 00029 extern "C" { 00030 #include "glpk.h" 00031 } 00032 #endif 00033 00034 #ifdef COIN_HAS_OSI 00035 #include "OsiClpSolverInterface.hpp" 00036 #include "OsiGlpkSolverInterface.hpp" 00037 #endif 00038 00039 namespace Accpm 00040 { 00041 00047 class LocSet { 00048 00049 public: 00050 LocSet(const Manager &manager, const Parameters ¶m); 00051 virtual ~LocSet(); 00052 const AccpmGenMatrix &getA() const { return *_A; } 00053 const AccpmGenMatrix &getE() const { return _E; } 00054 const AccpmVector &getC() const { return _c; } 00055 const AccpmVector &getProximalCenter() const { return _proximalCenter; } 00056 const double &getRhs() const { return _rhs; } 00057 const AccpmGenMatrix *getAFull() const { return _AFull; } 00058 const AccpmGenMatrix *getEFull() const { return _EFull; } 00059 const AccpmGenMatrix *getATQAFull() const { return _ATQAFull; } 00060 const AccpmGenMatrix *getAT() const { return _AT; } 00061 const AccpmGenMatrix *getEFullT() const { return _EFullT; } 00062 int computeFullAE(const Parameters ¶m, const AccpmVector *df2); 00063 int computeFullATQA(const AccpmGenMatrix &ATQA, const AccpmVector &diagQ, const AccpmVector *df2); 00074 int checkFeasibility(const Parameters ¶m, double &objVal, AccpmVector &y, 00075 AccpmVector &x) const; 00076 00077 private: 00078 const AccpmGenMatrix *_A; 00079 AccpmGenMatrix _E; 00080 AccpmGenMatrix *_AFull; 00081 AccpmGenMatrix *_EFull; 00082 AccpmGenMatrix *_ATQAFull; 00083 AccpmVector _proximalCenter; 00084 AccpmVector _c; 00085 AccpmGenMatrix *_AT; 00086 AccpmGenMatrix *_EFullT; 00087 00088 double _rhs; 00089 00090 void clear(); 00095 int solveLP(const Parameters ¶m, double &objVal, 00096 AccpmVector &y, AccpmVector &x) const; 00097 #ifdef COIN_HAS_OSI 00098 00102 int solveWithOsi(OsiSolverInterface *si, const Parameters ¶m, 00103 double &objVal, 00104 AccpmVector &y, AccpmVector &x) const; 00105 #endif 00106 00110 int solveWithGLPK(const Parameters ¶m, double &objVal, 00111 AccpmVector &y, AccpmVector &x) const; 00112 }; 00113 } 00114 00115 #endif