CbcFollowOn.hpp

Go to the documentation of this file.
00001 // $Id: CbcFollowOn.hpp 1899 2013-04-09 18:12:08Z stefan $
00002 // Copyright (C) 2002, International Business Machines
00003 // Corporation and others.  All Rights Reserved.
00004 // This code is licensed under the terms of the Eclipse Public License (EPL).
00005 
00006 // Edwin 11/10/2009-- carved out of CbcBranchActual
00007 
00008 #ifndef CbcFollowOn_H
00009 #define CbcFollowOn_H
00010 
00011 #include "CbcBranchBase.hpp"
00012 #include "OsiRowCut.hpp"
00013 #include "CoinHelperFunctions.hpp"
00014 #include "CoinPackedMatrix.hpp"
00015 
00025 class CbcFollowOn : public CbcObject {
00026 
00027 public:
00028 
00029     // Default Constructor
00030     CbcFollowOn ();
00031 
00034     CbcFollowOn (CbcModel * model);
00035 
00036     // Copy constructor
00037     CbcFollowOn ( const CbcFollowOn &);
00038 
00040     virtual CbcObject * clone() const;
00041 
00042     // Assignment operator
00043     CbcFollowOn & operator=( const CbcFollowOn& rhs);
00044 
00045     // Destructor
00046     ~CbcFollowOn ();
00047 
00049     virtual double infeasibility(const OsiBranchingInformation * info,
00050                                  int &preferredWay) const;
00051 
00052     using CbcObject::feasibleRegion ;
00054     virtual void feasibleRegion();
00055 
00057     virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
00059     virtual int gutsOfFollowOn(int & otherRow, int & preferredWay) const;
00060 
00061 protected:
00064     CoinPackedMatrix matrix_;
00066     CoinPackedMatrix matrixByRow_;
00068     int * rhs_;
00069 };
00070 
00074 class CbcFixingBranchingObject : public CbcBranchingObject {
00075 
00076 public:
00077 
00078     // Default Constructor
00079     CbcFixingBranchingObject ();
00080 
00081     // Useful constructor
00082     CbcFixingBranchingObject (CbcModel * model,
00083                               int way,
00084                               int numberOnDownSide, const int * down,
00085                               int numberOnUpSide, const int * up);
00086 
00087     // Copy constructor
00088     CbcFixingBranchingObject ( const CbcFixingBranchingObject &);
00089 
00090     // Assignment operator
00091     CbcFixingBranchingObject & operator=( const CbcFixingBranchingObject& rhs);
00092 
00094     virtual CbcBranchingObject * clone() const;
00095 
00096     // Destructor
00097     virtual ~CbcFixingBranchingObject ();
00098 
00099     using CbcBranchingObject::branch ;
00101     virtual double branch();
00102 
00103 #ifdef JJF_ZERO
00104     // No need to override. Default works fine.
00108     virtual void previousBranch();
00109 #endif
00110 
00111     using CbcBranchingObject::print ;
00114     virtual void print();
00115 
00117     virtual CbcBranchObjType type() const {
00118         return FollowOnBranchObj;
00119     }
00120 
00128     virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
00129 
00138     virtual CbcRangeCompare compareBranchingObject
00139     (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
00140 
00141 private:
00144     int numberDown_;
00146     int numberUp_;
00148     int * downList_;
00150     int * upList_;
00151 };
00152 
00161 class CbcIdiotBranch : public CbcObject {
00162 
00163 public:
00164 
00165     // Default Constructor
00166     CbcIdiotBranch ();
00167 
00170     CbcIdiotBranch (CbcModel * model);
00171 
00172     // Copy constructor
00173     CbcIdiotBranch ( const CbcIdiotBranch &);
00174 
00176     virtual CbcObject * clone() const;
00177 
00178     // Assignment operator
00179     CbcIdiotBranch & operator=( const CbcIdiotBranch& rhs);
00180 
00181     // Destructor
00182     ~CbcIdiotBranch ();
00183 
00185     virtual double infeasibility(const OsiBranchingInformation * info,
00186                                  int &preferredWay) const;
00187 
00188     using CbcObject::feasibleRegion ;
00190     virtual void feasibleRegion();
00191 
00193     virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
00195     virtual void initializeForBranching(CbcModel * );
00196 protected:
00198     OsiRowCut buildCut(const OsiBranchingInformation * info,int type,int & preferredWay) const; 
00201     mutable CoinThreadRandom randomNumberGenerator_;
00203     mutable CoinThreadRandom savedRandomNumberGenerator_;
00204 };
00205 
00206 #endif
00207 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 9 Feb 2015 for Cbc by  doxygen 1.6.1