/usr/include/coin/OsiRowCutDebugger.hpp is in coinor-libosi-dev 0.103.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | // Copyright (C) 2000, International Business Machines
// Corporation and others. All Rights Reserved.
#ifndef OsiRowCutDebugger_H
#define OsiRowCutDebugger_H
#include <string>
#include "OsiCuts.hpp"
#include "OsiSolverInterface.hpp"
/** Validate Row Cut Generator */
class OsiRowCutDebugger {
friend void OsiRowCutDebuggerUnitTest(const OsiSolverInterface * siP,
const std::string & mpsDir);
public:
/**@name Validate Row Cuts */
//@{
/** 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 int validateCuts(const OsiCuts & cs, int first, int last) const;
/// check one cut. Return true if cut is invalid
virtual bool invalidCut(const OsiRowCut & rowcut) const;
/// Return optimal solution
inline const double * optimalSolution() const
{ return optimalSolution_;}
/// Return number of columns in optimal solution
inline int numberColumns() const { return (numberColumns_) ; }
/// Return value of optimal solution
inline double optimalValue() const
{ return optimalValue_;}
//@}
/**@name Activate Debugger */
//@{
/** Activate debugger using name of model.
It may or may not work if problem presolved.
Returns true if debugger activated.
*/
bool activate(const OsiSolverInterface & si, const char * model);
/** 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).
*/
bool activate(const OsiSolverInterface & si, const double * solution);
/// Redo solution after preprocessing
void redoSolution(int numberColumns,const int * originalColumns);
/// Print optimal solution (returns -1 bad debug, 0 on optimal, 1 not)
int printOptimalSolution(const OsiSolverInterface & si) const;
//@}
/**@name Test if on Optimal Path */
//@{
/** Returns whether still on optimal path.
This should normally be invoked from
OsiSolverInterface::rowCutDebugger()
*/
bool onOptimalPath(const OsiSolverInterface & si) const;
//@}
/**@name Test if debugger active */
//@{
/// Returns true if debugger is active
bool active() const;
//@}
/**@name Constructors and destructors */
//@{
/// Default constructor - no checking
OsiRowCutDebugger ();
/** Constructor with name of model.
It may or may not work if problem presolved
*/
OsiRowCutDebugger (const OsiSolverInterface & si, const char * model);
// Constructor with full solution (only integers need be correct)
OsiRowCutDebugger (const OsiSolverInterface & si, const double * solution);
/// Copy constructor
OsiRowCutDebugger (
const OsiRowCutDebugger &);
/// Assignment operator
OsiRowCutDebugger &
operator=(
const OsiRowCutDebugger& rhs);
/// Destructor
virtual
~OsiRowCutDebugger ();
//@}
private:
// Private member methods
/**@name Private methods */
//@{
//@}
// Private member data
/**@name Private member data */
//@{
/// Value of optimal solution
double optimalValue_;
/// number of columns in problem
int numberColumns_;
/// Whether integer or not
bool * integerVariable_;
/// Optimal column solution
double * optimalSolution_;
//@}
};
//#############################################################################
/** 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. */
void
OsiRowCutDebuggerUnitTest(const OsiSolverInterface * siP,
const std::string & mpsDir);
#endif
|