- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

CglTreeInfo.hpp
Go to the documentation of this file.
1 // $Id: CglTreeInfo.hpp 1201 2014-03-07 17:24:04Z forrest $
2 // Copyright (C) 2000, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5
6 #ifndef CglTreeInfo_H
7 #define CglTreeInfo_H
8
9 #include "OsiCuts.hpp"
10 #include "OsiSolverInterface.hpp"
11 #include "CoinHelperFunctions.hpp"
12 class CglStored;
15 class CglTreeInfo {
16 public:
18 int level;
21 int pass;
24 int formulation_rows;
38 int options;
40 bool inTree;
50 OsiRowCut ** strengthenRow;
52 CoinThreadRandom * randomNumberGenerator;
54 CglTreeInfo ();
55
57 CglTreeInfo (
58 const CglTreeInfo &);
60 virtual CglTreeInfo * clone() const;
61
63 CglTreeInfo &
64 operator=(
65 const CglTreeInfo& rhs);
66
68 virtual
69 ~CglTreeInfo ();
71 virtual bool fixes(int , int , int ,bool) {return false;}
74 virtual int initializeFixing(const OsiSolverInterface * ) {return 0;}
75
76 };
77
79 typedef struct {
80 //unsigned int oneFixed:1; // nonzero if variable to 1 fixes all
81 //unsigned int sequence:31; // variable (in matrix) (but also see cliqueRow_)
82 unsigned int fixes;
83 } CliqueEntry;
84
85 class CglTreeProbingInfo : public CglTreeInfo {
86 public:
88 CglTreeProbingInfo ();
90 CglTreeProbingInfo (const OsiSolverInterface * model);
91
93 CglTreeProbingInfo (
94 const CglTreeProbingInfo &);
96 virtual CglTreeInfo * clone() const;
97
99 CglTreeProbingInfo &
100 operator=(
101 const CglTreeProbingInfo& rhs);
102
104 virtual
105 ~CglTreeProbingInfo ();
106 OsiSolverInterface * analyze(const OsiSolverInterface & si, int createSolver=0,
107 int numberExtraCliques=0,const int * starts=NULL,
108 const CliqueEntry * entries=NULL,const char * type=NULL);
112 virtual bool fixes(int variable, int toValue, int fixedVariable,bool fixedToLower);
115 virtual int initializeFixing(const OsiSolverInterface * model) ;
117 int fixColumns(OsiSolverInterface & si) const;
119 int fixColumns(int iColumn, int value, OsiSolverInterface & si) const;
121 int packDown();
123 void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
124 const CglTreeInfo info) const;
126 inline CliqueEntry * fixEntries()
127 { convert(); return fixEntry_;}
129 inline int * toZero()
130 { convert(); return toZero_;}
132 inline int * toOne()
133 { convert(); return toOne_;}
135 inline int * integerVariable() const
136 { return integerVariable_;}
138 inline int * backward() const
139 { return backward_;}
141 inline int numberVariables() const
142 { return numberVariables_;}
144 inline int numberIntegers() const
145 { return numberIntegers_;}
146 private:
148 void convert();
149 protected:
151 CliqueEntry * fixEntry_;
153 int * toZero_;
155 int * toOne_;
157 int * integerVariable_;
159 int * backward_;
161 int * fixingEntry_;
163 int numberVariables_;
165 int numberIntegers_;
167 int maximumEntries_;
169 int numberEntries_;
170 };
171 inline int sequenceInCliqueEntry(const CliqueEntry & cEntry)
172 { return cEntry.fixes&0x7fffffff;}
173 inline void setSequenceInCliqueEntry(CliqueEntry & cEntry,int sequence)
174 { cEntry.fixes = sequence|(cEntry.fixes&0x80000000);}
175 inline bool oneFixesInCliqueEntry(const CliqueEntry & cEntry)
176 { return (cEntry.fixes&0x80000000)!=0;}
177 inline void setOneFixesInCliqueEntry(CliqueEntry & cEntry,bool oneFixes)
178 { cEntry.fixes = (oneFixes ? 0x80000000 : 0)|(cEntry.fixes&0x7fffffff);}
179
180 #endif
CglTreeProbingInfo::fixes
virtual bool fixes(int variable, int toValue, int fixedVariable, bool fixedToLower)
Take action if cut generator can fix a variable (toValue -1 for down, +1 for up) Returns true if stil...
CglTreeProbingInfo::integerVariable_
int * integerVariable_
List of 0-1 integer variables.
Definition: CglTreeInfo.hpp:157
setSequenceInCliqueEntry
void setSequenceInCliqueEntry(CliqueEntry &cEntry, int sequence)
Definition: CglTreeInfo.hpp:173
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
CglTreeInfo::clone
virtual CglTreeInfo * clone() const
Clone.
CglTreeInfo::inTree
bool inTree
Set true if in tree (to avoid ambiguity at first branch)
Definition: CglTreeInfo.hpp:40
CliqueEntry::fixes
unsigned int fixes
Definition: CglTreeInfo.hpp:82
CglTreeProbingInfo::toZero
int * toZero()
Starts of integer variable going to zero.
Definition: CglTreeInfo.hpp:129
CglTreeProbingInfo::analyze
OsiSolverInterface * analyze(const OsiSolverInterface &si, int createSolver=0, int numberExtraCliques=0, const int *starts=NULL, const CliqueEntry *entries=NULL, const char *type=NULL)
CglTreeProbingInfo::fixEntries
CliqueEntry * fixEntries()
Entries for fixing variables.
Definition: CglTreeInfo.hpp:126
CoinHelperFunctions.hpp
CglTreeProbingInfo::numberVariables
int numberVariables() const
Number of variables.
Definition: CglTreeInfo.hpp:141
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
CglTreeInfo::strengthenRow
OsiRowCut ** strengthenRow
Replacement array.
Definition: CglTreeInfo.hpp:50
oneFixesInCliqueEntry
bool oneFixesInCliqueEntry(const CliqueEntry &cEntry)
Definition: CglTreeInfo.hpp:175
CglTreeInfo::initializeFixing
virtual int initializeFixing(const OsiSolverInterface *)
Initalizes fixing arrays etc - returns &gt;0 if we want to save info 0 if we don&#39;t and -1 if is to be use...
Definition: CglTreeInfo.hpp:74
CglTreeProbingInfo::convert
void convert()
Converts to ordered.
setOneFixesInCliqueEntry
void setOneFixesInCliqueEntry(CliqueEntry &cEntry, bool oneFixes)
Definition: CglTreeInfo.hpp:177
CglTreeProbingInfo
Definition: CglTreeInfo.hpp:85
CglTreeProbingInfo::packDown
int packDown()
Packs down entries.
CglTreeInfo::operator=
CglTreeInfo & operator=(const CglTreeInfo &rhs)
Assignment operator.
CglTreeInfo::level
int level
The level of the search tree node.
Definition: CglTreeInfo.hpp:18
sequenceInCliqueEntry
int sequenceInCliqueEntry(const CliqueEntry &cEntry)
Definition: CglTreeInfo.hpp:171
CglTreeProbingInfo::numberIntegers
int numberIntegers() const
Number of 0-1 variables.
Definition: CglTreeInfo.hpp:144
CglTreeProbingInfo::backward
int * backward() const
Backward look up.
Definition: CglTreeInfo.hpp:138
CglTreeProbingInfo::toOne_
int * toOne_
Starts of integer variable going to one.
Definition: CglTreeInfo.hpp:155
CglTreeProbingInfo::CglTreeProbingInfo
CglTreeProbingInfo()
Default constructor.
OsiSolverInterface.hpp
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
CglTreeProbingInfo::generateCuts
void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info) const
Generate cuts from implications.
CglTreeProbingInfo::numberIntegers_
int numberIntegers_
Number of 0-1 variables.
Definition: CglTreeInfo.hpp:165
CglTreeInfo::formulation_rows
int formulation_rows
The number of rows in the original formulation.
Definition: CglTreeInfo.hpp:24
CglTreeInfo::~CglTreeInfo
virtual ~CglTreeInfo()
Destructor.
CglTreeInfo::CglTreeInfo
CglTreeInfo()
Default constructor.
CglTreeInfo::options
int options
Options 1 - treat costed integers as important 2 - switch off some stuff as variables semi-integer 4 ...
Definition: CglTreeInfo.hpp:38
CglTreeProbingInfo::fixEntry_
CliqueEntry * fixEntry_
Entries for fixing variables.
Definition: CglTreeInfo.hpp:151
CglTreeInfo::randomNumberGenerator
CoinThreadRandom * randomNumberGenerator
Optional pointer to thread specific random number generator.
Definition: CglTreeInfo.hpp:52
CglTreeProbingInfo::fixColumns
int fixColumns(OsiSolverInterface &si) const
Fix entries in a solver using implications.
CglTreeProbingInfo::~CglTreeProbingInfo
virtual ~CglTreeProbingInfo()
Destructor.
CglTreeProbingInfo::clone
virtual CglTreeInfo * clone() const
Clone.
CoinThreadRandom
Class for thread specific random numbers.
Definition: CoinHelperFunctions.hpp:953
CglTreeProbingInfo::toZero_
int * toZero_
Starts of integer variable going to zero.
Definition: CglTreeInfo.hpp:153
CglTreeProbingInfo::maximumEntries_
int maximumEntries_
Maximum number in fixEntry_.
Definition: CglTreeInfo.hpp:167
CliqueEntry
Derived class to pick up probing info.
Definition: CglTreeInfo.hpp:79
CglStored
Stored Cut Generator Class.
Definition: CglStored.hpp:16
CglTreeProbingInfo::fixingEntry_
int * fixingEntry_
Entries for fixing variable when collecting.
Definition: CglTreeInfo.hpp:161
CglTreeInfo
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
CglTreeProbingInfo::toOne
int * toOne()
Starts of integer variable going to one.
Definition: CglTreeInfo.hpp:132
CglTreeProbingInfo::initializeFixing
virtual int initializeFixing(const OsiSolverInterface *model)
Initalizes fixing arrays etc - returns &gt;0 if we want to save info 0 if we don&#39;t and -1 if is to be use...
OsiCuts.hpp
CglTreeProbingInfo::backward_
int * backward_
Backward look up.
Definition: CglTreeInfo.hpp:159
CglTreeProbingInfo::numberVariables_
int numberVariables_
Number of variables.
Definition: CglTreeInfo.hpp:163
CglTreeInfo::pass
int pass
How many times the cut generator was already invoked in this search tree node.
Definition: CglTreeInfo.hpp:21
CglTreeInfo::fixes
virtual bool fixes(int, int, int, bool)
Take action if cut generator can fix a variable (toValue -1 for down, +1 for up)
Definition: CglTreeInfo.hpp:71
CglTreeProbingInfo::integerVariable
int * integerVariable() const
List of 0-1 integer variables.
Definition: CglTreeInfo.hpp:135
CglTreeProbingInfo::numberEntries_
int numberEntries_
Number entries in fixingEntry_ (and fixEntry_) or -2 if correct style.
Definition: CglTreeInfo.hpp:169
CglTreeProbingInfo::operator=
CglTreeProbingInfo & operator=(const CglTreeProbingInfo &rhs)
Assignment operator.