summaryrefslogtreecommitdiff
path: root/thirdparty/linux/include/coin/CbcBranchToFixLots.hpp
diff options
context:
space:
mode:
authorHarpreet2016-09-03 00:36:51 +0530
committerHarpreet2016-09-03 00:36:51 +0530
commita0d9443af147e949c1e6a01ac24749d12593ec5b (patch)
tree1a1955c5482ae608fd7f618b06f4ecc6a0d39a23 /thirdparty/linux/include/coin/CbcBranchToFixLots.hpp
parent4b64cf486f5c999fd8167758cae27839f3b50848 (diff)
downloadFOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.tar.gz
FOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.tar.bz2
FOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.zip
cbcintlinprog added
Diffstat (limited to 'thirdparty/linux/include/coin/CbcBranchToFixLots.hpp')
-rw-r--r--thirdparty/linux/include/coin/CbcBranchToFixLots.hpp94
1 files changed, 94 insertions, 0 deletions
diff --git a/thirdparty/linux/include/coin/CbcBranchToFixLots.hpp b/thirdparty/linux/include/coin/CbcBranchToFixLots.hpp
new file mode 100644
index 0000000..3b0a9ea
--- /dev/null
+++ b/thirdparty/linux/include/coin/CbcBranchToFixLots.hpp
@@ -0,0 +1,94 @@
+// $Id: CbcBranchToFixLots.hpp 1899 2013-04-09 18:12:08Z stefan $
+// Copyright (C) 2004, International Business Machines
+// Corporation and others. All Rights Reserved.
+// This code is licensed under the terms of the Eclipse Public License (EPL).
+
+// Edwin 11/13/2009-- carved out of CbcBranchCut
+
+#ifndef CbcBranchToFixLots_H
+#define CbcBranchToFixLots_H
+
+#include "CbcBranchCut.hpp"
+#include "CbcBranchBase.hpp"
+#include "OsiRowCut.hpp"
+#include "CoinPackedMatrix.hpp"
+
+/** Define a branch class that branches so that one way variables are fixed
+ while the other way cuts off that solution.
+ a) On reduced cost
+ b) When enough ==1 or <=1 rows have been satisfied (not fixed - satisfied)
+*/
+
+
+class CbcBranchToFixLots : public CbcBranchCut {
+
+public:
+
+ // Default Constructor
+ CbcBranchToFixLots ();
+
+ /** Useful constructor - passed reduced cost tolerance and fraction we would like fixed.
+ Also depth level to do at.
+ Also passed number of 1 rows which when clean triggers fix
+ Always does if all 1 rows cleaned up and number>0 or if fraction columns reached
+ Also whether to create branch if can't reach fraction.
+ */
+ CbcBranchToFixLots (CbcModel * model, double djTolerance,
+ double fractionFixed, int depth,
+ int numberClean = 0,
+ const char * mark = NULL,
+ bool alwaysCreate = false);
+
+ // Copy constructor
+ CbcBranchToFixLots ( const CbcBranchToFixLots &);
+
+ /// Clone
+ virtual CbcObject * clone() const;
+
+ // Assignment operator
+ CbcBranchToFixLots & operator=( const CbcBranchToFixLots& rhs);
+
+ // Destructor
+ ~CbcBranchToFixLots ();
+
+ /** Does a lot of the work,
+ Returns 0 if no good, 1 if dj, 2 if clean, 3 if both
+ FIXME: should use enum or equivalent to make these numbers clearer.
+ */
+ int shallWe() const;
+
+ /// Infeasibility for an integer variable - large is 0.5, but also can be infinity when known infeasible.
+ virtual double infeasibility(const OsiBranchingInformation * info,
+ int &preferredWay) const;
+ /** \brief Return true if object can take part in normal heuristics
+ */
+ virtual bool canDoHeuristics() const {
+ return true;
+ }
+
+ /// Creates a branching object
+ virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
+ /// Redoes data when sequence numbers change
+ virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
+
+
+protected:
+ /// data
+
+ /// Reduced cost tolerance i.e. dj has to be >= this before fixed
+ double djTolerance_;
+ /// We only need to make sure this fraction fixed
+ double fractionFixed_;
+ /// Never fix ones marked here
+ char * mark_;
+ /// Matrix by row
+ CoinPackedMatrix matrixByRow_;
+ /// Do if depth multiple of this
+ int depth_;
+ /// number of ==1 rows which need to be clean
+ int numberClean_;
+ /// If true then always create branch
+ bool alwaysCreate_;
+};
+#endif
+