#include <CglDuplicateRow.hpp>
Inheritance diagram for CglDuplicateRow:
Generate Cuts | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const |
Fix variables and find duplicate/dominated rows for the model of the solver interface, si. | |
CglStored * | outDuplicates (OsiSolverInterface *solver) |
Fix variables and find duplicate/dominated rows for the model of the solver interface, si. | |
void | generateCuts12 (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const |
Does work for modes 1,2. | |
void | generateCuts4 (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const |
Does work for mode 4. | |
void | generateCuts8 (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const |
Does work for mode 8. | |
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. | |
int | sizeDynamic () const |
Size of dynamic program. | |
int | numberOriginalRows () const |
Number of rows in original problem. | |
Get information on size of problem | |
int | logLevel () const |
logLevel | |
void | setLogLevel (int value) |
We only check for duplicates amongst rows with effective rhs <= this | |
int | maximumRhs () const |
Get. | |
void | setMaximumRhs (int value) |
Set. | |
We only check for dominated amongst groups of columns whose size <= this | |
int | maximumDominated () const |
Get. | |
void | setMaximumDominated (int value) |
Set. | |
gets and sets | |
int | mode () const |
Get mode. | |
void | setMode (int value) |
Set mode. | |
Constructors and destructors | |
CglDuplicateRow () | |
Default constructor. | |
CglDuplicateRow (OsiSolverInterface *solver) | |
Useful constructor. | |
CglDuplicateRow (const CglDuplicateRow &rhs) | |
Copy constructor. | |
virtual CglCutGenerator * | clone () const |
Clone. | |
CglDuplicateRow & | operator= (const CglDuplicateRow &rhs) |
Assignment operator. | |
virtual | ~CglDuplicateRow () |
Destructor. | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. | |
virtual void | refreshSolver (OsiSolverInterface *solver) |
This can be used to refresh any inforamtion. | |
Protected Attributes | |
Protected member data | |
CoinPackedMatrix | matrix_ |
Matrix. | |
CoinPackedMatrix | matrixByRow_ |
Matrix by row. | |
int * | rhs_ |
Possible rhs (if 0 then not possible). | |
int * | duplicate_ |
Marks duplicate rows. | |
int * | lower_ |
To allow for <= rows. | |
CglStored * | storedCuts_ |
Stored cuts if we found dominance cuts. | |
int | maximumDominated_ |
Check dominated columns if less than this number of candidates. | |
int | maximumRhs_ |
Check duplicates if effective rhs <= this. | |
int | sizeDynamic_ |
Size of dynamic program. | |
int | mode_ |
1 do rows, 2 do columns, 3 do both | |
int | logLevel_ |
Controls print out. |
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 CglDuplicateRow::~CglDuplicateRow | ( | ) | [virtual] |
Destructor.
virtual void CglDuplicateRow::generateCuts | ( | const OsiSolverInterface & | si, | |
OsiCuts & | cs, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const [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.
void CglDuplicateRow::generateCuts12 | ( | const OsiSolverInterface & | si, | |
OsiCuts & | cs, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const [private] |
Does work for modes 1,2.
void CglDuplicateRow::generateCuts4 | ( | const OsiSolverInterface & | si, | |
OsiCuts & | cs, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const [private] |
Does work for mode 4.
void CglDuplicateRow::generateCuts8 | ( | const OsiSolverInterface & | si, | |
OsiCuts & | cs, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const [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
const int* CglDuplicateRow::duplicate | ( | ) | const [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.
int CglDuplicateRow::sizeDynamic | ( | ) | const [inline] |
int CglDuplicateRow::numberOriginalRows | ( | ) | const [inline] |
int CglDuplicateRow::logLevel | ( | ) | const [inline] |
void CglDuplicateRow::setLogLevel | ( | int | value | ) | [inline] |
Definition at line 94 of file CglDuplicateRow.hpp.
int CglDuplicateRow::maximumRhs | ( | ) | const [inline] |
void CglDuplicateRow::setMaximumRhs | ( | int | value | ) | [inline] |
int CglDuplicateRow::maximumDominated | ( | ) | const [inline] |
void CglDuplicateRow::setMaximumDominated | ( | int | value | ) | [inline] |
int CglDuplicateRow::mode | ( | ) | const [inline] |
void CglDuplicateRow::setMode | ( | int | value | ) | [inline] |
virtual CglCutGenerator* CglDuplicateRow::clone | ( | ) | const [virtual] |
CglDuplicateRow& CglDuplicateRow::operator= | ( | const CglDuplicateRow & | rhs | ) |
Assignment operator.
virtual std::string CglDuplicateRow::generateCpp | ( | FILE * | fp | ) | [virtual] |
virtual void CglDuplicateRow::refreshSolver | ( | OsiSolverInterface * | solver | ) | [virtual] |
CoinPackedMatrix CglDuplicateRow::matrix_ [protected] |
CoinPackedMatrix CglDuplicateRow::matrixByRow_ [protected] |
int* CglDuplicateRow::rhs_ [protected] |
int* CglDuplicateRow::duplicate_ [mutable, protected] |
int* CglDuplicateRow::lower_ [protected] |
CglStored* CglDuplicateRow::storedCuts_ [mutable, protected] |
int CglDuplicateRow::maximumDominated_ [protected] |
Check dominated columns if less than this number of candidates.
Definition at line 178 of file CglDuplicateRow.hpp.
int CglDuplicateRow::maximumRhs_ [protected] |
int CglDuplicateRow::sizeDynamic_ [mutable, protected] |
int CglDuplicateRow::mode_ [protected] |
int CglDuplicateRow::logLevel_ [protected] |