MMKP_DecompApp.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 MMKP_DECOMPAPP_INCLUDED
00014 #define MMKP_DECOMPAPP_INCLUDED
00015 
00016 //===========================================================================//
00017 #include "DecompApp.h"
00018 
00019 //===========================================================================//
00020 #include "MMKP_Instance.h"
00021 #include "MMKP_MCKnap.h"
00022 #include "MMKP_Param.h"
00023 #include "MMKP_MemPool.h"
00024 //===========================================================================//
00025 
00026 //===========================================================================//
00037 //===========================================================================//
00038 class MMKP_DecompApp : public DecompApp {
00039 private:
00041    const string m_classTag;
00042 
00044    MMKP_Param m_appParam;  
00045 
00047    MMKP_Instance m_instance;
00048 
00050    vector<MMKP_MCKnap*> m_mcknap;
00051 
00053    double * m_objective;
00054 
00056    vector<DecompConstraintSet*> m_models;
00057    
00059    MMKP_MemPool m_auxMemPool;
00060  
00061 public:
00062    /* @name Inherited (from virtual) methods. */
00063 
00065    virtual DecompSolverStatus solveRelaxed(const int          whichBlock,
00066                                            const double     * redCostX,
00067                                            const double       convexDual,
00068                                            DecompVarList    & varList);
00069 
00071    virtual void printOriginalColumn(const int   index, 
00072                                     ostream   * os = &cout) const;
00073 
00074 public:
00078    void initializeApp(UtilParameters & utilParam);
00079 
00080    /* Create models. */
00081    void createModels();
00082 
00083    /* Create MCKP model. */
00084    void createModelPartMCP(DecompConstraintSet * model);
00085    void createModelPartMCKP(DecompConstraintSet * model,
00086                             int                   whichKnap = 0);
00087    void createModelPartMC2KP(DecompConstraintSet * model,
00088                              int                   whichKnap1,
00089                              int                   whichKnap2);
00090    void createModelPartMCKP(DecompConstraintSet * model,
00091                             vector<int>         & whichKnaps);
00092    void createModelPartMMKPHalf(DecompConstraintSet * model);
00093    void createModelPartMMKP(DecompConstraintSet * model);
00094    
00095    /* Create MDKP model. */
00096    void createModelPartMDKPCompl(DecompConstraintSet * model,
00097                                  int                   whichKnap = 0);
00098    void createModelPartMDKP(DecompConstraintSet * model);
00099    void createModelPartMDKPHalf(DecompConstraintSet * model);
00100    void createModelPartMDKP(DecompConstraintSet * model,
00101                             vector<int>         & whichKnaps);
00102 
00103 public:
00107    MMKP_DecompApp(UtilParameters & utilParam) :
00108       DecompApp   (utilParam),
00109       m_classTag  ("MMKP-APP"),
00110       m_mcknap    (),
00111       m_objective (NULL),
00112       m_auxMemPool() 
00113    {
00114       initializeApp(utilParam);                    
00115    }
00116    
00117    virtual ~MMKP_DecompApp() {
00118       UtilDeleteVectorPtr(m_mcknap);
00119       UtilDeleteVectorPtr(m_models);
00120       UTIL_DELARR(m_objective);
00121    };
00122 };
00123 
00124 #endif

Generated on 3 Jun 2015 for Dip-All by  doxygen 1.6.1