/usr/src/RPM/BUILD/CoinBlis-0.93.5/Blis/src/BlisBranchObjectBilevel.h
Go to the documentation of this file.
00001 /*===========================================================================*
00002  * This file is part of the BiCePS Linear Integer Solver (BLIS).             *
00003  *                                                                           *
00004  * BLIS is distributed under the Eclipse Public License as part of the       *
00005  * COIN-OR repository (http://www.coin-or.org).                              *
00006  *                                                                           *
00007  * Authors:                                                                  *
00008  *                                                                           *
00009  *          Yan Xu, Lehigh University                                        *
00010  *          Ted Ralphs, Lehigh University                                    *
00011  *                                                                           *
00012  * Conceptual Design:                                                        *
00013  *                                                                           *
00014  *          Yan Xu, Lehigh University                                        *
00015  *          Ted Ralphs, Lehigh University                                    *
00016  *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
00017  *          Matthew Saltzman, Clemson University                             *
00018  *                                                                           * 
00019  *                                                                           *
00020  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs.       *
00021  * All Rights Reserved.                                                      *
00022  *===========================================================================*/
00023 
00024 
00025 //#############################################################################
00026 // Borrow ideas from COIN/Cbc
00027 //#############################################################################
00028 
00029 
00030 #include "BcpsBranchObject.h"
00031 
00032 #include "BlisModel.h"
00033 
00034 
00035 //#############################################################################
00036 
00037 
00038 class BlisBranchObjectBilevel : public BcpsBranchObject {
00039 
00040  protected:
00041 
00043     std::deque<int> *branchingSet_;
00044     
00045  public:
00046     
00048     BlisBranchObjectBilevel() : BcpsBranchObject()
00049     {
00050         type_ = BlisBranchingObjectTypeBilevel;
00051         branchingSet_ = new std::deque<int>();
00052     }
00053 
00055     BlisBranchObjectBilevel(BcpsModel * model)
00056         : BcpsBranchObject(model) {
00057         type_ = BlisBranchingObjectTypeBilevel;
00058         branchingSet_ = new std::deque<int>();
00059     }
00060     
00062     BlisBranchObjectBilevel(const BlisBranchObjectBilevel &rhs)
00063     :
00064     BcpsBranchObject(rhs), branchingSet_(rhs.branchingSet_) {}
00065     
00067     BlisBranchObjectBilevel & operator = (const BlisBranchObjectBilevel& rhs);
00068     
00070     virtual BcpsBranchObject * clone() const {
00071         return (new BlisBranchObjectBilevel(*this));
00072     }
00073 
00075     virtual ~BlisBranchObjectBilevel() { delete branchingSet_; }
00076 
00078     std::deque<int> *getBranchingSet() const {return branchingSet_;}
00079     
00081     void addToBranchingSet(int item) {branchingSet_->push_back(item);}
00082     
00086     virtual double branch(bool normalBranch = false);
00087 
00089     virtual void print(bool normalBranch);
00090 
00091  protected:
00092 
00094     AlpsReturnStatus encodeBlis(AlpsEncoded *encoded) const {
00095         assert(encoded);
00096         AlpsReturnStatus status = AlpsReturnStatusOk;
00097         return status;
00098     }
00099 
00101     AlpsReturnStatus decodeBlis(AlpsEncoded &encoded) {
00102         AlpsReturnStatus status = AlpsReturnStatusOk;
00103         return status;
00104     }
00105 
00106  public:
00107 
00109     virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const {
00110         AlpsReturnStatus status = AlpsReturnStatusOk;
00111 
00112         status = encodeBcps(encoded);
00113         status = encodeBlis(encoded);
00114         
00115         return status;
00116     }
00117 
00119     virtual AlpsReturnStatus decode(AlpsEncoded &encoded) {
00120         
00121         AlpsReturnStatus status = AlpsReturnStatusOk;
00122 
00123         status = decodeBcps(encoded);
00124         status = decodeBlis(encoded);
00125         
00126         return status;
00127     }
00128     
00129 };
00130