/home/coin/SVN-release/CoinAll-1.1.0/Blis/src/BlisTreeNode.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 Common 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-2007, Lehigh University, Yan Xu, and Ted Ralphs.       *
00021  * All Rights Reserved.                                                      *
00022  *===========================================================================*/
00023 
00024 #ifndef BlisTreeNode_h_
00025 #define BlisTreeNode_h_
00026 
00027 //#############################################################################
00028 
00029 #include "AlpsNodeDesc.h"
00030 
00031 #include "BcpsObjectPool.h"
00032 #include "BcpsTreeNode.h"
00033 
00034 #include "BcpsNodeDesc.h"
00035 #include "BlisNodeDesc.h"
00036 
00037 class BcpsModel;
00038 class BlisModel;
00039 
00040 
00041 //#############################################################################
00045 //#############################################################################
00046 
00047 
00048 class BlisTreeNode : public BcpsTreeNode {
00049 private:
00050     
00052     BlisTreeNode(const BlisTreeNode&);
00053     
00054     BlisTreeNode& operator=(const BlisTreeNode&);
00055     
00057     //BcpsConstraintPool *constraintPool_;
00058     
00060     //BcpsVariablePool *variablePool_;
00061 
00063     //void saveExplicit();
00064     
00066     bool parallel(BlisModel *model,
00067                   BcpsConstraintPool &conPool,
00068                   int lastNew,
00069                   BlisConstraint *aCon);
00070 
00072     double estimateSolution(BlisModel *model,
00073                             const double *lpSolution,
00074                             double lpObjValue) const;
00075     
00076 public:
00077 
00079     BlisTreeNode() 
00080         : 
00081         BcpsTreeNode() 
00082         { init(); }
00083     
00085     BlisTreeNode(BlisModel* m) {
00086         init();
00087         desc_ = new BlisNodeDesc(m);
00088     }
00089 
00091     BlisTreeNode(AlpsNodeDesc *&desc) {
00092         init();
00093         desc_ = desc;
00094         desc = NULL;
00095     }
00096 
00098     virtual ~BlisTreeNode() {
00099         //std::cout << "------ Delete blis part of node" << std::endl;
00100     }
00101     
00103     void init() {
00104         //constraintPool_ = new BcpsConstraintPool;
00105         //variablePool_ = new BcpsVariablePool;
00106     }
00107     
00109     AlpsTreeNode* createNewTreeNode(AlpsNodeDesc *&desc) const;
00110 
00112 
00113     virtual void convertToExplicit();
00114     virtual void convertToRelative();
00116     
00118     virtual int installSubProblem(BcpsModel *mode);
00119     
00121     virtual int process(bool isRoot = false, bool rampUp = false);
00122     
00124     virtual int bound(BcpsModel *model);
00125 
00130     virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> > 
00131         branch();
00132     
00134     int selectBranchObject(BlisModel *model, 
00135                            bool& foundSol, 
00136                            int numPassesLeft);
00137 
00139     virtual int chooseBranchingObject(BcpsModel*) { return AlpsReturnStatusOk;}
00140     
00141     // Why need below?
00142     //using BcpsTreeNode::generateConstraints ;
00143 
00145     int generateConstraints(BlisModel *model, BcpsConstraintPool &conPool);
00146 
00151     int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false);
00152 
00154     void getViolatedConstraints(BlisModel *model, 
00155                                 const double *currLpSolution, 
00156                                 BcpsConstraintPool & conPool);
00157 
00159     BlisReturnStatus applyConstraints(BlisModel *model,
00160                                       const double *solution,
00161                                       BcpsConstraintPool & conPool); 
00162 
00164     BlisReturnStatus reducedCostFix(BlisModel *model);
00165 
00167     //BcpsConstraintPool * constraintPool() { return constraintPool_; }
00168 
00170     //BcpsVariablePool * variablePool() { return variablePool_; }
00171     
00172     using AlpsKnowledge::encode ;
00174     virtual AlpsEncoded* encode() const;
00175 
00177     virtual AlpsKnowledge* decode(AlpsEncoded&) const;
00178 };
00179 
00180 #endif

Generated on Sun Nov 14 14:06:30 2010 for Coin-All by  doxygen 1.4.7