- Main Page
- Namespaces
- Classes
- Files
- Directories

- Search for |

- File List
- File Members

# CglTreeInfo.hpp

Go to the documentation of this file.

    00001 // $Id: CglTreeInfo.hpp 1033 2011-06-19 16:49:13Z stefan $
    00002 // Copyright (C) 2000, 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 #ifndef CglTreeInfo_H
    00007 #define CglTreeInfo_H
    00008
    00009 #include "OsiCuts.hpp"
    00010 #include "OsiSolverInterface.hpp"
    00011 #include "CoinHelperFunctions.hpp"
    00012 class CglStored;
    00015 class CglTreeInfo {
    00016 public:
    00018   int level;
    00021   int pass;
    00024   int formulation_rows;
    00038   int options;
    00040   bool inTree;
    00050   OsiRowCut ** strengthenRow;
    00052   CoinThreadRandom * randomNumberGenerator;
    00054   CglTreeInfo ();
    00055
    00057   CglTreeInfo (
    00058     const CglTreeInfo &);
    00060   virtual CglTreeInfo * clone() const;
    00061
    00063   CglTreeInfo &
    00064     operator=(
    00065     const CglTreeInfo& rhs);
    00066
    00068   virtual
    00069     ~CglTreeInfo ();
    00071   virtual bool fixes(int , int , int ,bool) {return false;}
    00074   virtual int initializeFixing(const OsiSolverInterface * ) {return 0;}
    00075
    00076 };
    00077
    00079 typedef struct {
    00080   //unsigned int oneFixed:1; //  nonzero if variable to 1 fixes all
    00081   //unsigned int sequence:31; //  variable (in matrix) (but also see cliqueRow_)
    00082   unsigned int fixes;
    00083 } cliqueEntry;
    00084
    00085 class CglTreeProbingInfo : public CglTreeInfo {
    00086 public:
    00088   CglTreeProbingInfo ();
    00090   CglTreeProbingInfo (const OsiSolverInterface * model);
    00091
    00093   CglTreeProbingInfo (
    00094     const CglTreeProbingInfo &);
    00096   virtual CglTreeInfo * clone() const;
    00097
    00099   CglTreeProbingInfo &
    00100     operator=(
    00101     const CglTreeProbingInfo& rhs);
    00102
    00104   virtual
    00105     ~CglTreeProbingInfo ();
    00106   OsiSolverInterface * analyze(const OsiSolverInterface & si, int createSolver=0);
    00110   virtual bool fixes(int variable, int toValue, int fixedVariable,bool fixedToLower);
    00113   virtual int initializeFixing(const OsiSolverInterface * model) ;
    00115   int fixColumns(OsiSolverInterface & si) const;
    00117   int fixColumns(int iColumn, int value, OsiSolverInterface & si) const;
    00119   int packDown();
    00121   void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
    00122                     const CglTreeInfo info) const;
    00124   inline cliqueEntry * fixEntries() const
    00125   { convert(); return fixEntry_;}
    00127   inline int * toZero() const
    00128   { convert(); return toZero_;}
    00130   inline int * toOne() const
    00131   { convert(); return toOne_;}
    00133   inline int * integerVariable() const
    00134   { return integerVariable_;}
    00136   inline int * backward() const
    00137   { return backward_;}
    00139   inline int numberVariables() const
    00140   { return numberVariables_;}
    00142   inline int numberIntegers() const
    00143   { return numberIntegers_;}
    00144 private:
    00146   void convert() const;
    00147 protected:
    00149   mutable cliqueEntry * fixEntry_;
    00151   mutable int * toZero_;
    00153   mutable int * toOne_;
    00155   int * integerVariable_;
    00157   int * backward_;
    00159   mutable int * fixingEntry_;
    00161   int numberVariables_;
    00163   int numberIntegers_;
    00165   int maximumEntries_;
    00167   mutable int numberEntries_;
    00168 };
    00169 inline int sequenceInCliqueEntry(const cliqueEntry & cEntry)
    00170 { return cEntry.fixes&0x7fffffff;}
    00171 inline void setSequenceInCliqueEntry(cliqueEntry & cEntry,int sequence)
    00172 { cEntry.fixes = sequence|(cEntry.fixes&0x80000000);}
    00173 inline bool oneFixesInCliqueEntry(const cliqueEntry & cEntry)
    00174 { return (cEntry.fixes&0x80000000)!=0;}
    00175 inline void setOneFixesInCliqueEntry(cliqueEntry & cEntry,bool oneFixes)
    00176 { cEntry.fixes = (oneFixes ? 0x80000000 : 0)|(cEntry.fixes&0x7fffffff);}
    00177
    00178 #endif