summaryrefslogtreecommitdiff
path: root/build/Bonmin/include/coin/CbcBranchDecision.hpp
diff options
context:
space:
mode:
authorHarpreet2016-08-04 15:25:44 +0530
committerHarpreet2016-08-04 15:25:44 +0530
commit9fd2976931c088dc523974afb901e96bad20f73c (patch)
tree22502de6e6988d5cd595290d11266f8432ad825b /build/Bonmin/include/coin/CbcBranchDecision.hpp
downloadFOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.tar.gz
FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.tar.bz2
FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.zip
initial add
Diffstat (limited to 'build/Bonmin/include/coin/CbcBranchDecision.hpp')
-rw-r--r--build/Bonmin/include/coin/CbcBranchDecision.hpp129
1 files changed, 129 insertions, 0 deletions
diff --git a/build/Bonmin/include/coin/CbcBranchDecision.hpp b/build/Bonmin/include/coin/CbcBranchDecision.hpp
new file mode 100644
index 0000000..538fe8c
--- /dev/null
+++ b/build/Bonmin/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
+