# CbcClique.hpp

Go to the documentation of this file.

    00001 // $Id: CbcClique.hpp 1902 2013-04-10 16:58:16Z 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/9/2009-- carved out of CbcBranchActual
    00007
    00008 #ifndef CbcClique_H
    00009 #define CbcClique_H
    00010
    00041 class CbcClique : public CbcObject {
    00042
    00043 public:
    00044
    00046     CbcClique ();
    00047
    00051     CbcClique (CbcModel * model, int cliqueType, int numberMembers,
    00052                const int * which, const char * type,
    00053                int identifier, int slack = -1);
    00054
    00056     CbcClique ( const CbcClique &);
    00057
    00059     virtual CbcObject * clone() const;
    00060
    00062     CbcClique & operator=( const CbcClique& rhs);
    00063
    00065     virtual ~CbcClique ();
    00066
    00068     virtual double infeasibility(const OsiBranchingInformation * info,
    00069                                  int &preferredWay) const;
    00070
    00071     using CbcObject::feasibleRegion ;
    00073     virtual void feasibleRegion();
    00074
    00076     virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface * solver, const OsiBranchingInformation * info, int way) ;
    00078     inline int numberMembers() const {
    00079         return numberMembers_;
    00080     }
    00086     inline int numberNonSOSMembers() const {
    00087         return numberNonSOSMembers_;
    00088     }
    00089
    00091     inline const int * members() const {
    00092         return members_;
    00093     }
    00094
    00104     inline char type(int index) const {
    00105         if (type_) return type_[index];
    00106         else return 1;
    00107     }
    00108
    00110     inline int cliqueType() const {
    00111         return cliqueType_;
    00112     }
    00114     virtual void redoSequenceEtc(CbcModel * model, int numberColumns, const int * originalColumns);
    00115
    00116 protected:
    00119     int numberMembers_;
    00120
    00122     int numberNonSOSMembers_;
    00123
    00125     int * members_;
    00126
    00136     char * type_;
    00137
    00143     int cliqueType_;
    00144
    00151     int slack_;
    00152 };
    00153
    00162 class CbcCliqueBranchingObject : public CbcBranchingObject {
    00163
    00164 public:
    00165
    00166     // Default Constructor
    00167     CbcCliqueBranchingObject ();
    00168
    00169     // Useful constructor
    00170     CbcCliqueBranchingObject (CbcModel * model,  const CbcClique * clique,
    00171                               int way,
    00172                               int numberOnDownSide, const int * down,
    00173                               int numberOnUpSide, const int * up);
    00174
    00175     // Copy constructor
    00176     CbcCliqueBranchingObject ( const CbcCliqueBranchingObject &);
    00177
    00178     // Assignment operator
    00179     CbcCliqueBranchingObject & operator=( const CbcCliqueBranchingObject& rhs);
    00180
    00182     virtual CbcBranchingObject * clone() const;
    00183
    00184     // Destructor
    00185     virtual ~CbcCliqueBranchingObject ();
    00186
    00187     using CbcBranchingObject::branch ;
    00189     virtual double branch();
    00190
    00191     using CbcBranchingObject::print ;
    00194     virtual void print();
    00195
    00197     virtual CbcBranchObjType type() const {
    00198         return CliqueBranchObj;
    00199     }
    00200
    00208     virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
    00209
    00218     virtual CbcRangeCompare compareBranchingObject
    00219     (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
    00220
    00221 private:
    00223     const CbcClique * clique_;
    00225     unsigned int downMask_[2];
    00227     unsigned int upMask_[2];
    00228 };
    00229
    00234 class CbcLongCliqueBranchingObject : public CbcBranchingObject {
    00235
    00236 public:
    00237
    00238     // Default Constructor
    00239     CbcLongCliqueBranchingObject ();
    00240
    00241     // Useful constructor
    00242     CbcLongCliqueBranchingObject (CbcModel * model,  const CbcClique * clique,
    00243                                   int way,
    00244                                   int numberOnDownSide, const int * down,
    00245                                   int numberOnUpSide, const int * up);
    00246
    00247     // Copy constructor
    00248     CbcLongCliqueBranchingObject ( const CbcLongCliqueBranchingObject &);
    00249
    00250     // Assignment operator
    00251     CbcLongCliqueBranchingObject & operator=( const CbcLongCliqueBranchingObject& rhs);
    00252
    00254     virtual CbcBranchingObject * clone() const;
    00255
    00256     // Destructor
    00257     virtual ~CbcLongCliqueBranchingObject ();
    00258
    00259     using CbcBranchingObject::branch ;
    00261     virtual double branch();
    00262
    00263     using CbcBranchingObject::print ;
    00266     virtual void print();
    00267
    00269     virtual CbcBranchObjType type() const {
    00270         return LongCliqueBranchObj;
    00271     }
    00272
    00280     virtual int compareOriginalObject(const CbcBranchingObject* brObj) const;
    00281
    00290     virtual CbcRangeCompare compareBranchingObject
    00291     (const CbcBranchingObject* brObj, const bool replaceIfOverlap = false);
    00292
    00293 private:
    00295     const CbcClique * clique_;
    00297     unsigned int * downMask_;
    00299     unsigned int * upMask_;
    00300 };
    00301
    00302 #endif
    00303

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines