DecompAlgoRC.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 #ifndef DecompAlgoRC_h_
00018 #define DecompAlgoRC_h_
00019 
00021 //===========================================================================//
00022 #include "DecompAlgo.h"
00023 
00024 //===========================================================================//
00025 class DecompAlgoRC : public DecompAlgo {
00026 
00027    //----------------------------------------------------------------------//
00032    //----------------------------------------------------------------------//
00033 private:
00037    const std::string m_classTag;
00038 
00039 private:
00040    std::vector<double>   m_u;   //dual vector
00041    double*          m_rc;  //reduced cost
00042 
00043    double           m_UB;
00044    double           m_LB;
00045 
00046    int              m_cntSameLB;
00047    int              m_iter;
00048    double           m_step;
00049    bool             m_zeroSub;
00050 
00051    DecompVar        m_shatVar;
00056    //-----------------------------------------------------------------------//
00061    //-----------------------------------------------------------------------//
00065    void createMasterProblem(DecompVarList& initVars);
00066 
00072    //not pure
00073    void recomposeSolution(const double* solution,
00074                           double*        rsolution);
00075 
00076 
00083    //-----------------------------------------------------------------------//
00088    //-----------------------------------------------------------------------//
00089    DecompStatus solutionUpdate(const DecompPhase phase,
00090                                const int         maxInnerIter,
00091                                const int         maxOuterIter);
00092    int addCutsFromPool();
00093    int generateVars(const DecompStatus   stat,
00094                     DecompVarList&     newVars,
00095                     double&            mostNegReducedCost);
00096    bool updateObjBound(const double mostNegRC = -DecompBigNum);
00097 
00101    DecompPhase phaseInit();
00105    void phaseDone();
00106 
00107 
00112    //-----------------------------------------------------------------------//
00117    //-----------------------------------------------------------------------//
00118 private:
00122    DecompAlgoRC(const DecompAlgoRC&);
00123    DecompAlgoRC& operator=(const DecompAlgoRC&);
00124 
00125 public:
00129    DecompAlgoRC(DecompApp*             app,
00130                 UtilParameters*        utilParam):
00131       DecompAlgo(RELAX_AND_CUT, app, utilParam),
00132       m_classTag("D-ALGORC"),
00133       m_u        (),
00134       m_rc       (NULL),
00135       m_UB       (DecompInf),
00136       m_LB       (-DecompInf),
00137       m_cntSameLB(0),
00138       m_iter     (0),
00139       m_step     (2.0), //(0, 2] param?
00140       m_zeroSub  (false),
00141       m_shatVar  () {
00142       std::string paramSection = DecompAlgoStr[RELAX_AND_CUT];
00143       initSetup(utilParam, paramSection);
00144    }
00145 
00146    DecompAlgoRC(DecompApp*       app,
00147                 UtilParameters* utilParam,
00148                 std::string&          paramSection) :
00149       DecompAlgo(RELAX_AND_CUT, app, utilParam),
00150       m_classTag ("D-ALGORC"),
00151       m_u        (),
00152       m_rc       (NULL),
00153       m_UB       (DecompInf),
00154       m_LB       (-DecompInf),
00155       m_cntSameLB(0),
00156       m_iter     (0),
00157       m_step     (2.0), //(0, 2] param?
00158       m_zeroSub  (false),
00159       m_shatVar  () {
00160       initSetup(utilParam, paramSection);
00161    }
00162 
00166    ~DecompAlgoRC() {
00167       UTIL_DELARR(m_rc);
00168    }
00177 public:
00178    bool isDone();
00179    //name - change to getDual?
00180    const double* getRowPrice() {
00181       return &m_u[0];
00182    }
00183    //user needs to do?
00184    //STOP
00185    void setInitObjUB(const double objUB) {
00186       m_UB = objUB;
00187    }
00188 
00189 
00190 };
00191 #endif

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