diff options
author | Georgey | 2017-07-05 11:40:43 +0530 |
---|---|---|
committer | Georgey | 2017-07-05 11:40:43 +0530 |
commit | 938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427 (patch) | |
tree | b343c0ee5609433c80e0de1db8b6886c9126dc2d /thirdparty/linux/include/coin/CbcBranchDecision.hpp | |
parent | 5b72577efe080c5294b32d804e4d26351fef30bc (diff) | |
download | FOSSEE-Optimization-toolbox-938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427.tar.gz FOSSEE-Optimization-toolbox-938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427.tar.bz2 FOSSEE-Optimization-toolbox-938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427.zip |
Added linux shared libraries and header files for int and ecos functions
Diffstat (limited to 'thirdparty/linux/include/coin/CbcBranchDecision.hpp')
-rw-r--r-- | thirdparty/linux/include/coin/CbcBranchDecision.hpp | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/thirdparty/linux/include/coin/CbcBranchDecision.hpp b/thirdparty/linux/include/coin/CbcBranchDecision.hpp new file mode 100644 index 0000000..538fe8c --- /dev/null +++ b/thirdparty/linux/include/coin/CbcBranchDecision.hpp @@ -0,0 +1,129 @@ +// $Id: CbcBranchDecision.hpp 1899 2013-04-09 18:12:08Z stefan $ +// Copyright (C) 2002, International Business Machines +// Corporation and others. All Rights Reserved. +// This code is licensed under the terms of the Eclipse Public License (EPL). + +// Edwin 11/12/2009 carved from CbcBranchBase + +#ifndef CbcBranchDecision_H +#define CbcBranchDecision_H + +#include "CbcBranchBase.hpp" + +/** Abstract branching decision base class + + In the abstract, an CbcBranchDecision object is expected to be able to + compare two possible branching choices. + + The #betterBranch() method is the crucial routine. It is expected to be able + to compare two \link CbcBranchingObject CbcBranchingObjects \endlink. + + See CbcObject for an overview of the three classes (CbcObject, + CbcBranchingObject, and CbcBranchDecision) which make up cbc's branching + model. +*/ +class CbcModel; +class OsiChooseVariable; + +class CbcBranchDecision { +public: + /// Default Constructor + CbcBranchDecision (); + + // Copy constructor + CbcBranchDecision ( const CbcBranchDecision &); + + /// Destructor + virtual ~CbcBranchDecision(); + +/// Clone + virtual CbcBranchDecision * clone() const = 0; + + /// Initialize <i>e.g.</i> before starting to choose a branch at a node + virtual void initialize(CbcModel * model) = 0; + + /** \brief Compare two branching objects. Return nonzero if branching + using \p thisOne is better than branching using \p bestSoFar. + + If \p bestSoFar is NULL, the routine should return a nonzero value. + This routine is used only after strong branching. + Either this or bestBranch is used depending which user wants. + + */ + + virtual int + betterBranch (CbcBranchingObject * thisOne, + CbcBranchingObject * bestSoFar, + double changeUp, int numberInfeasibilitiesUp, + double changeDown, int numberInfeasibilitiesDown) = 0 ; + + /** \brief Compare N branching objects. Return index of best + and sets way of branching in chosen object. + + Either this or betterBranch is used depending which user wants. + */ + + virtual int + bestBranch (CbcBranchingObject ** objects, int numberObjects, int numberUnsatisfied, + double * changeUp, int * numberInfeasibilitiesUp, + double * changeDown, int * numberInfeasibilitiesDown, + double objectiveValue) ; + + /** Says whether this method can handle both methods - + 1 better, 2 best, 3 both */ + virtual int whichMethod() { + return 2; + } + + /** Saves a clone of current branching object. Can be used to update + information on object causing branch - after branch */ + virtual void saveBranchingObject(OsiBranchingObject * ) {} + /** Pass in information on branch just done. + assumes object can get information from solver */ + virtual void updateInformation(OsiSolverInterface * , + const CbcNode * ) {} + /** Sets or gets best criterion so far */ + virtual void setBestCriterion(double ) {} + virtual double getBestCriterion() const { + return 0.0; + } + /// Create C++ lines to get to current state + virtual void generateCpp( FILE * ) {} + /// Model + inline CbcModel * cbcModel() const { + return model_; + } + /* If chooseMethod_ id non-null then the rest is fairly pointless + as choosemethod_ will be doing all work + This comment makes more sense if you realise that there's a conversion in + process from the Cbc branching classes to Osi branching classes. The test + for use of the Osi branching classes is CbcModel::branchingMethod_ + non-null (i.e., it points to one of these CbcBranchDecision objects) and + that branch decision object has an OsiChooseVariable method set. In which + case, we'll use it, rather than the choose[*]Variable methods defined in + CbcNode. + */ + + OsiChooseVariable * chooseMethod() const { + return chooseMethod_; + } + /// Set (clone) chooseMethod + void setChooseMethod(const OsiChooseVariable & method); + +protected: + + // Clone of branching object + CbcBranchingObject * object_; + /// Pointer to model + CbcModel * model_; + /* If chooseMethod_ id non-null then the rest is fairly pointless + as choosemethod_ will be doing all work + */ + OsiChooseVariable * chooseMethod_; +private: + /// Assignment is illegal + CbcBranchDecision & operator=(const CbcBranchDecision& rhs); + +}; +#endif + |