Validate Row Cut Generator. More...
#include <OsiRowCutDebugger.hpp>
Public Member Functions | |
Validate Row Cuts | |
virtual int | validateCuts (const OsiCuts &cs, int first, int last) const |
If we are on the path to the optimal integer solution then check if any generated cuts cut off the optimal solution! More... | |
virtual bool | invalidCut (const OsiRowCut &rowcut) const |
check one cut. Return true if cut is invalid More... | |
const double * | optimalSolution () const |
Return optimal solution. More... | |
int | numberColumns () const |
Return number of columns in optimal solution. More... | |
double | optimalValue () const |
Return value of optimal solution. More... | |
Activate Debugger | |
bool | activate (const OsiSolverInterface &si, const char *model) |
Activate debugger using name of model. More... | |
bool | activate (const OsiSolverInterface &si, const double *solution) |
Activate debugger using full solution array. More... | |
void | redoSolution (int numberColumns, const int *originalColumns) |
Redo solution after preprocessing. More... | |
int | printOptimalSolution (const OsiSolverInterface &si) const |
Print optimal solution (returns -1 bad debug, 0 on optimal, 1 not) More... | |
Test if on Optimal Path | |
bool | onOptimalPath (const OsiSolverInterface &si) const |
Returns whether still on optimal path. More... | |
Test if debugger active | |
bool | active () const |
Returns true if debugger is active. More... | |
Constructors and destructors | |
OsiRowCutDebugger () | |
Default constructor - no checking. More... | |
OsiRowCutDebugger (const OsiSolverInterface &si, const char *model) | |
Constructor with name of model. More... | |
OsiRowCutDebugger (const OsiSolverInterface &si, const double *solution) | |
Default constructor - no checking. More... | |
OsiRowCutDebugger (const OsiRowCutDebugger &) | |
Copy constructor. More... | |
OsiRowCutDebugger & | operator= (const OsiRowCutDebugger &rhs) |
Assignment operator. More... | |
virtual | ~OsiRowCutDebugger () |
Destructor. More... | |
Private Attributes | |
Private member data | |
double | optimalValue_ |
Value of optimal solution. More... | |
int | numberColumns_ |
number of columns in problem More... | |
bool * | integerVariable_ |
Whether integer or not. More... | |
double * | optimalSolution_ |
Optimal column solution. More... | |
Friends | |
void | OsiRowCutDebuggerUnitTest (const OsiSolverInterface *siP, const std::string &mpsDir) |
A function that tests the methods in the OsiRowCut class. More... | |
Validate Row Cut Generator.
Definition at line 12 of file OsiRowCutDebugger.hpp.
OsiRowCutDebugger::OsiRowCutDebugger | ( | ) |
Default constructor - no checking.
OsiRowCutDebugger::OsiRowCutDebugger | ( | const OsiSolverInterface & | si, |
const char * | model | ||
) |
Constructor with name of model.
It may or may not work if problem presolved
OsiRowCutDebugger::OsiRowCutDebugger | ( | const OsiSolverInterface & | si, |
const double * | solution | ||
) |
Default constructor - no checking.
OsiRowCutDebugger::OsiRowCutDebugger | ( | const OsiRowCutDebugger & | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
If we are on the path to the optimal integer solution then check if any generated cuts cut off the optimal solution!
If so then print offending cuts and return non-zero code
Up to user to check if on optimalPath (using function of same name). This is normally handled by rowCutDebugger() in OsiSolverInterface.
Return number of invalid cuts.
|
virtual |
check one cut. Return true if cut is invalid
|
inline |
Return optimal solution.
Definition at line 36 of file OsiRowCutDebugger.hpp.
|
inline |
Return number of columns in optimal solution.
Definition at line 40 of file OsiRowCutDebugger.hpp.
|
inline |
Return value of optimal solution.
Definition at line 42 of file OsiRowCutDebugger.hpp.
bool OsiRowCutDebugger::activate | ( | const OsiSolverInterface & | si, |
const char * | model | ||
) |
Activate debugger using name of model.
It may or may not work if problem presolved. Returns true if debugger activated.
bool OsiRowCutDebugger::activate | ( | const OsiSolverInterface & | si, |
const double * | solution | ||
) |
Activate debugger using full solution array.
Only integer values need to be correct. Up to user to get it correct. Returns true if debugger activated (i.e. solution was valid).
void OsiRowCutDebugger::redoSolution | ( | int | numberColumns, |
const int * | originalColumns | ||
) |
Redo solution after preprocessing.
int OsiRowCutDebugger::printOptimalSolution | ( | const OsiSolverInterface & | si) | const |
Print optimal solution (returns -1 bad debug, 0 on optimal, 1 not)
bool OsiRowCutDebugger::onOptimalPath | ( | const OsiSolverInterface & | si) | const |
Returns whether still on optimal path.
This should normally be invoked from OsiSolverInterface::rowCutDebugger()
bool OsiRowCutDebugger::active | ( | ) | const |
Returns true if debugger is active.
OsiRowCutDebugger& OsiRowCutDebugger::operator= | ( | const OsiRowCutDebugger & | rhs) |
Assignment operator.
|
friend |
A function that tests the methods in the OsiRowCut class.
The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.
|
private |
Value of optimal solution.
Definition at line 122 of file OsiRowCutDebugger.hpp.
|
private |
number of columns in problem
Definition at line 124 of file OsiRowCutDebugger.hpp.
|
private |
Whether integer or not.
Definition at line 126 of file OsiRowCutDebugger.hpp.
|
private |
Optimal column solution.
Definition at line 128 of file OsiRowCutDebugger.hpp.