DuplicateRow Cut Generator Class. More...
#include <CglDuplicateRow.hpp>
Public Member Functions | |
Get information on size of problem | |
const int * | duplicate () const |
Get duplicate row list, -1 means still in, -2 means out (all fixed), k>= means same as row k. More... | |
int | sizeDynamic () const |
Size of dynamic program. More... | |
int | numberOriginalRows () const |
Number of rows in original problem. More... | |
int | logLevel () const |
logLevel More... | |
void | setLogLevel (int value) |
Get duplicate row list, -1 means still in, -2 means out (all fixed), k>= means same as row k. More... | |
We only check for duplicates amongst rows with effective rhs <= this | |
int | maximumRhs () const |
Get. More... | |
void | setMaximumRhs (int value) |
Set. More... | |
We only check for dominated amongst groups of columns whose size <= this | |
int | maximumDominated () const |
Get. More... | |
void | setMaximumDominated (int value) |
Set. More... | |
gets and sets | |
int | mode () const |
Get mode. More... | |
void | setMode (int value) |
Set mode. More... | |
Constructors and destructors | |
CglDuplicateRow () | |
Default constructor. More... | |
CglDuplicateRow (OsiSolverInterface *solver) | |
Useful constructor. More... | |
CglDuplicateRow (const CglDuplicateRow &rhs) | |
Copy constructor. More... | |
virtual CglCutGenerator * | clone () const |
Clone. More... | |
CglDuplicateRow & | operator= (const CglDuplicateRow &rhs) |
Assignment operator. More... | |
virtual | ~CglDuplicateRow () |
Destructor. More... | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. More... | |
virtual void | refreshSolver (OsiSolverInterface *solver) |
This can be used to refresh any information. More... | |
![]() | |
CglCutGenerator () | |
Default constructor. More... | |
CglCutGenerator (const CglCutGenerator &) | |
Copy constructor. More... | |
CglCutGenerator & | operator= (const CglCutGenerator &rhs) |
Assignment operator. More... | |
virtual | ~CglCutGenerator () |
Destructor. More... | |
int | getAggressiveness () const |
Get Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setAggressiveness (int value) |
Set Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setGlobalCuts (bool trueOrFalse) |
Set whether can do global cuts. More... | |
bool | canDoGlobalCuts () const |
Say whether can do global cuts. More... | |
virtual bool | mayGenerateRowCutsInTree () const |
Returns true if may generate Row cuts in tree (rather than root node). More... | |
virtual bool | needsOptimalBasis () const |
Return true if needs optimal basis to do cuts. More... | |
virtual int | maximumLengthOfCutInTree () const |
Return maximum length of cut in tree. More... | |
Protected Attributes | |
Protected member data | |
CoinPackedMatrix | matrix_ |
Matrix. More... | |
CoinPackedMatrix | matrixByRow_ |
Matrix by row. More... | |
int * | rhs_ |
Possible rhs (if 0 then not possible) More... | |
int * | duplicate_ |
Marks duplicate rows. More... | |
int * | lower_ |
To allow for <= rows. More... | |
CglStored * | storedCuts_ |
Stored cuts if we found dominance cuts. More... | |
int | maximumDominated_ |
Check dominated columns if less than this number of candidates. More... | |
int | maximumRhs_ |
Check duplicates if effective rhs <= this. More... | |
int | sizeDynamic_ |
Size of dynamic program. More... | |
int | mode_ |
1 do rows, 2 do columns, 3 do both More... | |
int | logLevel_ |
Controls print out. More... | |
Generate Cuts | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Fix variables and find duplicate/dominated rows for the model of the solver interface, si. More... | |
CglStored * | outDuplicates (OsiSolverInterface *solver) |
Fix variables and find duplicate/dominated rows for the model of the solver interface, si. More... | |
void | generateCuts12 (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Does work for modes 1,2. More... | |
void | generateCuts4 (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Does work for mode 4. More... | |
void | generateCuts8 (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Does work for mode 8. More... | |
Additional Inherited Members | |
![]() | |
int | aggressive_ |
Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
bool | canDoGlobalCuts_ |
True if can do global cuts i.e. no general integers. More... | |
DuplicateRow Cut Generator Class.
Definition at line 15 of file CglDuplicateRow.hpp.
CglDuplicateRow::CglDuplicateRow | ( | ) |
Default constructor.
CglDuplicateRow::CglDuplicateRow | ( | OsiSolverInterface * | solver | ) |
Useful constructor.
CglDuplicateRow::CglDuplicateRow | ( | const CglDuplicateRow & | rhs | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
Fix variables and find duplicate/dominated rows for the model of the solver interface, si.
This is a very simple minded idea but I (JJF) am using it in a project so thought I might as well add it. It should really be called before first solve and I may modify CBC to allow for that.
This is designed for problems with few rows and many integer variables where the rhs are <= or == and all coefficients and rhs are small integers.
If effective rhs is K then we can fix all variables with coefficients > K to their lower bounds (effective rhs just means original with variables with nonzero lower bounds subtracted out).
If one row is a subset of another and the effective rhs are same we can fix some variables and then the two rows are identical.
The generator marks identical rows so can be taken out in solve
Implements CglCutGenerator.
|
private |
Does work for modes 1,2.
|
private |
Does work for mode 4.
|
private |
Does work for mode 8.
CglStored* CglDuplicateRow::outDuplicates | ( | OsiSolverInterface * | solver | ) |
Fix variables and find duplicate/dominated rows for the model of the solver interface, si.
This is a very simple minded idea but I (JJF) am using it in a project so thought I might as well add it. It should really be called before first solve and I may modify CBC to allow for that.
This is designed for problems with few rows and many integer variables where the rhs are <= or == and all coefficients and rhs are small integers.
If effective rhs is K then we can fix all variables with coefficients > K to their lower bounds (effective rhs just means original with variables with nonzero lower bounds subtracted out).
If one row is a subset of another and the effective rhs are same we can fix some variables and then the two rows are identical.
This version does deletions and fixings and may return stored cuts for dominated columns
|
inline |
Get duplicate row list, -1 means still in, -2 means out (all fixed), k>= means same as row k.
Definition at line 79 of file CglDuplicateRow.hpp.
|
inline |
Size of dynamic program.
Definition at line 82 of file CglDuplicateRow.hpp.
|
inline |
Number of rows in original problem.
Definition at line 85 of file CglDuplicateRow.hpp.
|
inline |
logLevel
Definition at line 92 of file CglDuplicateRow.hpp.
|
inline |
Get duplicate row list, -1 means still in, -2 means out (all fixed), k>= means same as row k.
Definition at line 94 of file CglDuplicateRow.hpp.
|
inline |
Get.
Definition at line 102 of file CglDuplicateRow.hpp.
|
inline |
Set.
Definition at line 105 of file CglDuplicateRow.hpp.
|
inline |
Get.
Definition at line 112 of file CglDuplicateRow.hpp.
|
inline |
Set.
Definition at line 115 of file CglDuplicateRow.hpp.
|
inline |
Get mode.
Definition at line 121 of file CglDuplicateRow.hpp.
|
inline |
Set mode.
Definition at line 124 of file CglDuplicateRow.hpp.
|
virtual |
Clone.
Implements CglCutGenerator.
CglDuplicateRow& CglDuplicateRow::operator= | ( | const CglDuplicateRow & | rhs | ) |
Assignment operator.
|
virtual |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
|
virtual |
This can be used to refresh any information.
Reimplemented from CglCutGenerator.
|
protected |
Matrix.
Definition at line 166 of file CglDuplicateRow.hpp.
|
protected |
Matrix by row.
Definition at line 168 of file CglDuplicateRow.hpp.
|
protected |
Possible rhs (if 0 then not possible)
Definition at line 170 of file CglDuplicateRow.hpp.
|
protected |
Marks duplicate rows.
Definition at line 172 of file CglDuplicateRow.hpp.
|
protected |
To allow for <= rows.
Definition at line 174 of file CglDuplicateRow.hpp.
|
protected |
Stored cuts if we found dominance cuts.
Definition at line 176 of file CglDuplicateRow.hpp.
|
protected |
Check dominated columns if less than this number of candidates.
Definition at line 178 of file CglDuplicateRow.hpp.
|
protected |
Check duplicates if effective rhs <= this.
Definition at line 180 of file CglDuplicateRow.hpp.
|
protected |
Size of dynamic program.
Definition at line 182 of file CglDuplicateRow.hpp.
|
protected |
1 do rows, 2 do columns, 3 do both
Definition at line 184 of file CglDuplicateRow.hpp.
|
protected |
Controls print out.
Definition at line 186 of file CglDuplicateRow.hpp.