GAP_DecompApp3.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the Decomp Solver Framework.                         //
00003 //                                                                           //
00004 // Decomp is distributed under the Common Public License as part of the      //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, Lehigh University                                 //
00008 //                                                                           //
00009 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
00011 //===========================================================================//
00012 
00013 #ifndef GAP_DECOMPAPP3_INCLUDED
00014 #define GAP_DECOMPAPP3_INCLUDED
00015 
00016 //===========================================================================//
00017 //---
00018 //--- Version 3:
00019 //---   for relaxation solver, use built-in MILP solver and dense format
00020 //--- Version 4:
00021 //---   for relaxation solver, use built-in MILP solver and sparse format
00022 //---
00023 //===========================================================================//
00024 
00025 
00026 //===========================================================================//
00027 #include "DecompApp.h"
00028 
00029 //===========================================================================//
00030 #include "GAP_Instance.h"
00031 #include "GAP_DecompParam.h"
00032 
00033 //===========================================================================//
00044 //===========================================================================//
00045 class GAP_DecompApp : public DecompApp {
00046 private:
00048    const string m_classTag;
00049 
00051    GAP_Instance m_instance;
00052 
00054    GAP_DecompParam m_appParam;
00055 
00057    double* m_objective;
00058 
00061    vector<DecompConstraintSet*> m_models;
00062 
00063 
00064 public:
00065    /* @name Inherited (from virtual) methods. */
00067    void printOriginalColumn(const int   index,
00068                             ostream*    os = &cout) const;
00069 
00070 public:
00074    void initializeApp(UtilParameters& utilParam);
00075 
00077    inline const int getOffsetI(const int i) const {
00078       return i * m_instance.getNTasks();
00079    }
00080    inline const int getIndexIJ(const int i,
00081                                const int j) const {
00082       return (i * m_instance.getNTasks()) + j;
00083    }
00084 
00085    inline pair<int, int> getIndexInv(const int index) const {
00086       return make_pair(index / m_instance.getNTasks(),
00087                        index % m_instance.getNTasks());
00088    }
00089 
00091    int createModels();
00092    int createModelPartAP(DecompConstraintSet* model);
00093    int createModelPartKP(DecompConstraintSet* model);
00094    int createModelPartKP(DecompConstraintSet* model,
00095                          int                   whichKnap);
00096    int createModelPartKP(DecompConstraintSet* model,
00097                          vector<int>&          whichKnaps);
00098 
00099 public:
00101    inline const GAP_Instance& getInstance() const {
00102       return m_instance;
00103    }
00104    inline const GAP_DecompParam& getParam() const {
00105       return m_appParam;
00106    }
00107    inline const double* getObjective() const {
00108       return m_objective;
00109    }
00110 
00111 public:
00115    GAP_DecompApp(UtilParameters& utilParam) :
00116       DecompApp   (utilParam),
00117       m_classTag  ("GAP-APP"),
00118       m_objective (NULL) {
00119       initializeApp(utilParam);
00120    }
00121 
00122    virtual ~GAP_DecompApp() {
00123       UTIL_DELARR(m_objective);
00124       UtilDeleteVectorPtr(m_models);
00125    };
00126 };
00127 
00128 #endif

Generated on 12 Mar 2015 for Dip-All by  doxygen 1.6.1