DecompAlgoD.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the DIP Solver Framework.                            //
00003 //                                                                           //
00004 // DIP is distributed under the Eclipse Public License as part of the        //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com)       //
00008 //                                                                           //
00009 // Conceptual Design: Matthew Galati, SAS Institute Inc.                     //
00010 //                    Ted Ralphs, Lehigh University                          //
00011 //                                                                           //
00012 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs    //
00013 // All Rights Reserved.                                                      //
00014 //===========================================================================//
00015 
00016 
00017 //===========================================================================//
00018 #ifndef DecompAlgoD_h_
00019 #define DecompAlgoD_h_
00020 
00021 //===========================================================================//
00027 //===========================================================================//
00028 //THINK: derive from DecompAlgo or DecompAlgoPC?? THINK
00029 //THINK: how can we reuse this object since call many times?
00030 //   if init phase is feasible, we are done....
00031 
00032 
00033 //===========================================================================//
00034 #include "DecompAlgoPC.h"
00035 
00036 //===========================================================================//
00037 class DecompAlgoD : public DecompAlgoPC {
00038 private:
00039 
00040    //----------------------------------------------------------------------//
00045    //----------------------------------------------------------------------//
00049    std::string m_classTag;
00050 
00051    //TODO
00052    double*             m_xhatD;
00053    //TODO
00054    DecompCutList*      m_newCuts;
00055    //TODO
00056    int                 m_numOrigCols;
00057 
00058 
00059 
00060 
00065    //-----------------------------------------------------------------------//
00070    //-----------------------------------------------------------------------//
00074    virtual void createMasterProblem(DecompVarList& initVars);
00075    virtual void masterMatrixAddArtCols(CoinPackedMatrix* masterM,
00076                                        double*            colLB,
00077                                        double*            colUB,
00078                                        double*            objCoeff,
00079                                        std::vector<std::string>&    colNames,
00080                                        int                startRow,
00081                                        int                endRow,
00082                                        char               origOrBranch);
00083    virtual void phaseUpdate(DecompPhase&   phase,
00084                             DecompStatus& status);
00085    virtual void phaseDone();
00086 
00090    virtual inline void setObjBoundIP(const double thisBound) {
00091       UtilPrintFuncBegin(m_osLog, m_classTag,
00092                          "setObjBoundIP()", m_param.LogDebugLevel, 2);
00093 
00094       if (thisBound < m_nodeStats.objBest.second) {
00095          UTIL_MSG(m_app->m_param.LogDebugLevel, 3,
00096                   (*m_osLog) << "New Global UB = "
00097                   << UtilDblToStr(thisBound) << std::endl;);
00098          //For DECOMP, don't update this object's global UB
00099          //  otherwise, we might stop to early, since it will
00100          //  compare to this object's lower bound.
00101          //m_nodeStats.objBest.second = thisBound;
00102       }
00103 
00104       UtilPrintFuncEnd(m_osLog, m_classTag,
00105                        "setObjBoundIP()", m_param.LogDebugLevel, 2);
00106    }
00107 
00108 
00109 
00110 public:
00111    void solveD(DecompCutList* newCuts) {
00112       m_newCuts = newCuts;
00113       //need to change parameters to price, no cut
00114       m_param.LimitTotalCutIters   = 0;
00115       m_param.LimitRoundCutIters   = 0;
00116       m_param.LimitTotalPriceIters = 1000;
00117       m_param.LimitRoundPriceIters = 1000;
00118       m_param.SolveMasterAsIp      = 0;
00119       processNode(NULL);
00120    }
00121 
00122 
00123 public:
00124 
00125    //-----------------------------------------------------------------------//
00130    //-----------------------------------------------------------------------//
00131 private:
00135    DecompAlgoD(const DecompAlgoD&);
00136    DecompAlgoD& operator=(const DecompAlgoD&);
00137 
00138 public:
00139 
00143    DecompAlgoD(DecompApp*             app,
00144                UtilParameters*        utilParam,
00145                double*                xhat,
00146                int                    numOrigCols) //need to pass this? :
00147       :
00148       DecompAlgoPC(app, utilParam,
00149                    const_cast<std::string&>(DecompAlgoStr[DECOMP]), false),
00150       m_classTag   ("D-ALGOD"),
00151       m_xhatD      (xhat),
00152       m_newCuts    (0),
00153       m_numOrigCols(numOrigCols) { //need?
00154       std::string paramSection = DecompAlgoStr[DECOMP];
00155       m_algo              = DECOMP;
00156       initSetup(utilParam, paramSection);
00157    }
00158 
00159    //need this?
00160    DecompAlgoD(DecompApp*       app,
00161                UtilParameters* utilParam,
00162                std::string&          paramSection,
00163                double*          xhat,
00164                int              numOrigCols):
00165       DecompAlgoPC(app, utilParam, paramSection, false),
00166       m_classTag   ("D-ALGOD"),
00167       m_xhatD      (xhat),
00168       m_newCuts    (0),
00169       m_numOrigCols(numOrigCols) { //need?
00170       m_algo = DECOMP;
00171       initSetup(utilParam, paramSection);
00172    }
00173 
00177    ~DecompAlgoD() {}
00181 };
00182 
00183 #endif

Generated on 5 Apr 2015 for Dip-All by  doxygen 1.6.1