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, SAS Institute Inc. (matthew.galati@sas.com) // 00008 // // 00009 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs// 00010 // All Rights Reserved. // 00011 //===========================================================================// 00012 00013 #ifndef BcpsDecompTreeNode_h_ 00014 #define BcpsDecompTreeNode_h_ 00015 00016 //THINK: gardner discussion about interface class to hide the details 00017 //only show use the virtual methods 00018 00019 //===========================================================================// 00020 #include "Alps.h" 00021 #include "BcpsTreeNode.h" 00022 00023 //===========================================================================// 00024 class AlpsTreeNode; 00025 class AlpsNodeDesc; 00026 00027 //===========================================================================// 00028 //--- 00029 //--- BcpsDecompTreeNode is derived from BcpsTreeNode 00030 //--- BcpsTreeNode virtual methods that must be derived: 00031 //--- (1) chooseBranchingObject (pure virtual) 00032 //--- (2) installSubProblem (pure virtual) 00033 //--- (3) bound (pure virtual) 00034 //--- (4) branch (pure virtual) 00035 //--- BcpsTreeNode virtual methods that should be derived: 00036 //--- (1) generateConstraints (does nothing) 00037 //--- (2) generateVariables (does nothing) 00038 //--- (3) handleBoundingStatus (does nothing) 00039 //--- (4) process (the meat of the algo?) 00040 //--- BcpsTreeNode is derived from AlpsTreeNode 00041 //--- AlpsTreeNode virtual methods that must be derived: 00042 //--- (1) createNewTreeNode (pure virtual) 00043 //--- (2) process (pure virtual) 00044 //--- (3) branch (pure virtual) 00045 //--- AlpsTreeNode virtual methods that should be derived: 00046 //--- (1) convertToExplicit() (does nothing) 00047 //--- (2) convertToRelative() (does nothing) 00048 //--- 00049 00050 //===========================================================================// 00051 class BcpsDecompTreeNode : public BcpsTreeNode { 00052 private: 00054 static const char * m_classTag; 00055 00056 int branchedOn_; 00057 double branchedOnVal_; 00058 00059 private: 00060 //--- 00061 //--- disable default copy constructor 00062 //--- 00063 BcpsDecompTreeNode(const BcpsDecompTreeNode&); 00064 BcpsDecompTreeNode& operator=(const BcpsDecompTreeNode&); 00065 00066 public: 00068 BcpsDecompTreeNode() 00069 : BcpsTreeNode() 00070 { 00071 } 00072 00074 virtual ~BcpsDecompTreeNode(){ 00075 } 00076 00077 //--- 00078 //--- pure virtual functions from BcpsTreeNode or AlpsTreeNode 00079 //--- 00080 00082 AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *& desc) const; 00083 00085 int chooseBranchingObject(BcpsModel * model); 00086 00088 int installSubProblem(BcpsModel * model); 00089 00091 int bound(BcpsModel * model); 00092 00093 //point direct to DECOMP? 00095 int process(bool isRoot, bool rampUp); 00096 00101 std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> > branch(); 00102 }; 00103 00104 #endif