#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! | |
virtual bool | invalidCut (const OsiRowCut &rowcut) const |
check one cut. Return true if cut is invalid | |
const double * | optimalSolution () const |
Return optimal solution. | |
int | numberColumns () const |
Return number of columns in optimal solution. | |
double | optimalValue () const |
Return value of optimal solution. | |
Activate Debugger | |
bool | activate (const OsiSolverInterface &si, const char *model) |
Activate debugger using name of model. | |
bool | activate (const OsiSolverInterface &si, const double *solution) |
Activate debugger using full solution array. | |
void | redoSolution (int numberColumns, const int *originalColumns) |
Redo solution after preprocessing. | |
int | printOptimalSolution (const OsiSolverInterface &si) const |
Print optimal solution (returns -1 bad debug, 0 on optimal, 1 not). | |
Test if on Optimal Path | |
bool | onOptimalPath (const OsiSolverInterface &si) const |
Returns whether still on optimal path. | |
Test if debugger active | |
bool | active () const |
Returns true if debugger is active. | |
Constructors and destructors | |
OsiRowCutDebugger () | |
Default constructor - no checking. | |
OsiRowCutDebugger (const OsiSolverInterface &si, const char *model) | |
Constructor with name of model. | |
OsiRowCutDebugger (const OsiSolverInterface &si, const double *solution) | |
Default constructor - no checking. | |
OsiRowCutDebugger (const OsiRowCutDebugger &) | |
Copy constructor. | |
OsiRowCutDebugger & | operator= (const OsiRowCutDebugger &rhs) |
Assignment operator. | |
virtual | ~OsiRowCutDebugger () |
Destructor. | |
Private Attributes | |
Private member data | |
double | optimalValue_ |
Value of optimal solution. | |
int | numberColumns_ |
number of columns in problem | |
bool * | integerVariable_ |
Whether integer or not. | |
double * | optimalSolution_ |
Optimal column solution. | |
Friends | |
void | OsiRowCutDebuggerUnitTest (const OsiSolverInterface *siP, const std::string &mpsDir) |
A function that tests the methods in the OsiRowCut class. |
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 OsiRowCutDebugger::~OsiRowCutDebugger | ( | ) | [virtual] |
Destructor.
virtual int OsiRowCutDebugger::validateCuts | ( | const OsiCuts & | cs, | |
int | first, | |||
int | last | |||
) | const [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 bool OsiRowCutDebugger::invalidCut | ( | const OsiRowCut & | rowcut | ) | const [virtual] |
check one cut. Return true if cut is invalid
const double* OsiRowCutDebugger::optimalSolution | ( | ) | const [inline] |
int OsiRowCutDebugger::numberColumns | ( | ) | const [inline] |
double OsiRowCutDebugger::optimalValue | ( | ) | const [inline] |
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.
void OsiRowCutDebuggerUnitTest | ( | const OsiSolverInterface * | siP, | |
const std::string & | mpsDir | |||
) | [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.
double OsiRowCutDebugger::optimalValue_ [private] |
int OsiRowCutDebugger::numberColumns_ [private] |
bool* OsiRowCutDebugger::integerVariable_ [private] |
double* OsiRowCutDebugger::optimalSolution_ [private] |