Cgl 0.60.2

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CglTreeInfo.hpp
Go to the documentation of this file.
1 // $Id: CglTreeInfo.hpp 1442 2019-01-06 16:39:41Z unxusr $
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;
45 int hasParent;
47 OsiSolverInterface *parentSolver;
49 int *originalColumns;
59 OsiRowCut **strengthenRow;
61 CoinThreadRandom *randomNumberGenerator;
63 CglTreeInfo();
64
66 CglTreeInfo(
67 const CglTreeInfo &);
69 virtual CglTreeInfo *clone() const;
70
72 CglTreeInfo &
73 operator=(
74 const CglTreeInfo &rhs);
75
77 virtual ~CglTreeInfo();
79 virtual bool fixes(int, int, int, bool) { return false; }
82 virtual int initializeFixing(const OsiSolverInterface *) { return 0; }
83 };
84
86 typedef struct {
87 //unsigned int oneFixed:1; // nonzero if variable to 1 fixes all
88 //unsigned int sequence:31; // variable (in matrix) (but also see cliqueRow_)
89 unsigned int fixes;
90 } CliqueEntry;
91
92 class CglTreeProbingInfo : public CglTreeInfo {
93 public:
95 CglTreeProbingInfo();
97 CglTreeProbingInfo(const OsiSolverInterface *model);
98
100 CglTreeProbingInfo(
101 const CglTreeProbingInfo &);
103 virtual CglTreeInfo *clone() const;
104
106 CglTreeProbingInfo &
107 operator=(
108 const CglTreeProbingInfo &rhs);
109
111 virtual ~CglTreeProbingInfo();
112 OsiSolverInterface *analyze(const OsiSolverInterface &si, int createSolver = 0,
113 int numberExtraCliques = 0, const CoinBigIndex *starts = NULL,
114 const CliqueEntry *entries = NULL, const char *type = NULL);
118 virtual bool fixes(int variable, int toValue, int fixedVariable, bool fixedToLower);
121 virtual int initializeFixing(const OsiSolverInterface *model);
123 int fixColumns(OsiSolverInterface &si) const;
125 int fixColumns(int iColumn, int value, OsiSolverInterface &si) const;
127 int packDown();
129 void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
130 const CglTreeInfo info) const;
132 inline CliqueEntry *fixEntries()
133 {
134 convert();
135 return fixEntry_;
136 }
138 inline int *toZero()
139 {
140 convert();
141 return toZero_;
142 }
144 inline int *toOne()
145 {
146 convert();
147 return toOne_;
148 }
150 inline int *integerVariable() const
151 {
152 return integerVariable_;
153 }
155 inline int *backward() const
156 {
157 return backward_;
158 }
160 inline int numberVariables() const
161 {
162 return numberVariables_;
163 }
165 inline int numberIntegers() const
166 {
167 return numberIntegers_;
168 }
169
170 private:
172 void convert();
173
174 protected:
176 CliqueEntry *fixEntry_;
178 int *toZero_;
180 int *toOne_;
182 int *integerVariable_;
184 int *backward_;
186 int *fixingEntry_;
188 int numberVariables_;
190 int numberIntegers_;
192 int maximumEntries_;
194 int numberEntries_;
195 };
196 inline int sequenceInCliqueEntry(const CliqueEntry &cEntry)
197 {
198 return cEntry.fixes & 0x7fffffff;
199 }
200 inline void setSequenceInCliqueEntry(CliqueEntry &cEntry, int sequence)
201 {
202 cEntry.fixes = sequence | (cEntry.fixes & 0x80000000);
203 }
204 inline bool oneFixesInCliqueEntry(const CliqueEntry &cEntry)
205 {
206 return (cEntry.fixes & 0x80000000) != 0;
207 }
208 inline void setOneFixesInCliqueEntry(CliqueEntry &cEntry, bool oneFixes)
209 {
210 cEntry.fixes = (oneFixes ? 0x80000000 : 0) | (cEntry.fixes & 0x7fffffff);
211 }
212
213 #endif
214
215 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
216 */
CoinHelperFunctions.hpp
CglTreeProbingInfo::toZero
int * toZero()
Starts of integer variable going to zero.
Definition: CglTreeInfo.hpp:138
CglTreeInfo::strengthenRow
OsiRowCut ** strengthenRow
Replacement array.
Definition: CglTreeInfo.hpp:59
CglTreeInfo::~CglTreeInfo
virtual ~CglTreeInfo()
Destructor.
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::toOne
int * toOne()
Starts of integer variable going to one.
Definition: CglTreeInfo.hpp:144
CglTreeProbingInfo::fixEntries
CliqueEntry * fixEntries()
Entries for fixing variables.
Definition: CglTreeInfo.hpp:132
CglTreeInfo::level
int level
The level of the search tree node.
Definition: CglTreeInfo.hpp:18
CglTreeProbingInfo::clone
virtual CglTreeInfo * clone() const
Clone.
CglTreeProbingInfo::numberVariables
int numberVariables() const
Number of variables.
Definition: CglTreeInfo.hpp:160
CglTreeInfo::clone
virtual CglTreeInfo * clone() const
Clone.
setSequenceInCliqueEntry
void setSequenceInCliqueEntry(CliqueEntry &cEntry, int sequence)
Definition: CglTreeInfo.hpp:200
CglStored
Stored Cut Generator Class.
Definition: CglStored.hpp:16
CglTreeProbingInfo::generateCuts
void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info) const
Generate cuts from implications.
CglTreeInfo
Information about where the cut generator is invoked from.
Definition: CglTreeInfo.hpp:15
CglTreeProbingInfo::convert
void convert()
Converts to ordered.
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
CglTreeInfo::hasParent
int hasParent
nonzero if called from child of main model 1 if heuristic run 2 if doing full search ...
Definition: CglTreeInfo.hpp:45
CglTreeProbingInfo::toZero_
int * toZero_
Starts of integer variable going to zero.
Definition: CglTreeInfo.hpp:178
CglTreeProbingInfo::numberIntegers_
int numberIntegers_
Number of 0-1 variables.
Definition: CglTreeInfo.hpp:190
CglTreeProbingInfo::numberIntegers
int numberIntegers() const
Number of 0-1 variables.
Definition: CglTreeInfo.hpp:165
CglTreeProbingInfo::maximumEntries_
int maximumEntries_
Maximum number in fixEntry_.
Definition: CglTreeInfo.hpp:192
CglTreeProbingInfo::analyze
OsiSolverInterface * analyze(const OsiSolverInterface &si, int createSolver=0, int numberExtraCliques=0, const CoinBigIndex *starts=NULL, const CliqueEntry *entries=NULL, const char *type=NULL)
CglTreeProbingInfo::backward_
int * backward_
Backward look up.
Definition: CglTreeInfo.hpp:184
CglTreeInfo::formulation_rows
int formulation_rows
The number of rows in the original formulation.
Definition: CglTreeInfo.hpp:24
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:61
oneFixesInCliqueEntry
bool oneFixesInCliqueEntry(const CliqueEntry &cEntry)
Definition: CglTreeInfo.hpp:204
CglTreeProbingInfo::backward
int * backward() const
Backward look up.
Definition: CglTreeInfo.hpp:155
CliqueEntry
Derived class to pick up probing info.
Definition: CglTreeInfo.hpp:86
CglTreeProbingInfo::integerVariable
int * integerVariable() const
List of 0-1 integer variables.
Definition: CglTreeInfo.hpp:150
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...
CglTreeProbingInfo::fixEntry_
CliqueEntry * fixEntry_
Entries for fixing variables.
Definition: CglTreeInfo.hpp:176
CglTreeProbingInfo::numberEntries_
int numberEntries_
Number entries in fixingEntry_ (and fixEntry_) or -2 if correct style.
Definition: CglTreeInfo.hpp:194
CglTreeInfo::operator=
CglTreeInfo & operator=(const CglTreeInfo &rhs)
Assignment operator.
CglTreeInfo::parentSolver
OsiSolverInterface * parentSolver
parent solver
Definition: CglTreeInfo.hpp:47
CglTreeInfo::CglTreeInfo
CglTreeInfo()
Default constructor.
CliqueEntry::fixes
unsigned int fixes
Definition: CglTreeInfo.hpp:89
CglTreeProbingInfo::integerVariable_
int * integerVariable_
List of 0-1 integer variables.
Definition: CglTreeInfo.hpp:182
OsiRowCut
Row Cut Class.
Definition: OsiRowCut.hpp:29
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::numberVariables_
int numberVariables_
Number of variables.
Definition: CglTreeInfo.hpp:188
CglTreeProbingInfo::CglTreeProbingInfo
CglTreeProbingInfo()
Default constructor.
CglTreeProbingInfo
Definition: CglTreeInfo.hpp:92
OsiSolverInterface.hpp
CglTreeInfo::pass
int pass
How many times the cut generator was already invoked in this search tree node.
Definition: CglTreeInfo.hpp:21
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
CglTreeProbingInfo::~CglTreeProbingInfo
virtual ~CglTreeProbingInfo()
Destructor.
sequenceInCliqueEntry
int sequenceInCliqueEntry(const CliqueEntry &cEntry)
Definition: CglTreeInfo.hpp:196
CglTreeInfo::inTree
bool inTree
Set true if in tree (to avoid ambiguity at first branch)
Definition: CglTreeInfo.hpp:40
CglTreeProbingInfo::toOne_
int * toOne_
Starts of integer variable going to one.
Definition: CglTreeInfo.hpp:180
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:82
OsiCuts.hpp
setOneFixesInCliqueEntry
void setOneFixesInCliqueEntry(CliqueEntry &cEntry, bool oneFixes)
Definition: CglTreeInfo.hpp:208
CglTreeProbingInfo::operator=
CglTreeProbingInfo & operator=(const CglTreeProbingInfo &rhs)
Assignment operator.
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:79
CglTreeProbingInfo::fixingEntry_
int * fixingEntry_
Entries for fixing variable when collecting.
Definition: CglTreeInfo.hpp:186
CglTreeProbingInfo::fixColumns
int fixColumns(OsiSolverInterface &si) const
Fix entries in a solver using implications.
CglTreeProbingInfo::packDown
int packDown()
Packs down entries.
CglTreeInfo::originalColumns
int * originalColumns
Original columns (if preprocessed)
Definition: CglTreeInfo.hpp:49
CoinThreadRandom
Class for thread specific random numbers.
Definition: CoinHelperFunctions.hpp:1082
CglTreeInfo::randomNumberGenerator
CoinThreadRandom * randomNumberGenerator
Optional pointer to thread specific random number generator.
Definition: CglTreeInfo.hpp:61