Osi  0.108.6
OsiRowCutDebugger.hpp
Go to the documentation of this file.
1 // Copyright (C) 2000, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 // This code is licensed under the terms of the Eclipse Public License (EPL).
4 
5 #ifndef OsiRowCutDebugger_H
6 #define OsiRowCutDebugger_H
7 
14 #include <string>
15 
16 #include "OsiCuts.hpp"
17 #include "OsiSolverInterface.hpp"
18 
44  const std::string &mpsDir);
45 
46 public:
58  virtual int validateCuts(const OsiCuts &cs, int first, int last) const;
59 
65  virtual bool invalidCut(const OsiRowCut &rowcut) const;
66 
73  bool onOptimalPath(const OsiSolverInterface &si) const;
75 
87  bool activate(const OsiSolverInterface &si, const char *model);
88 
100  bool activate(const OsiSolverInterface &si, const double *solution,
101  bool keepContinuous = false);
102 
104  bool active() const;
106 
110  inline const double *optimalSolution() const
111  {
112  return knownSolution_;
113  }
114 
116  inline int numberColumns() const { return (numberColumns_); }
117 
119  inline double optimalValue() const { return knownValue_; }
120 
131  void redoSolution(int numberColumns, const int *originalColumns);
132 
136 
141 
146  OsiRowCutDebugger(const OsiSolverInterface &si, const char *model);
147 
152  OsiRowCutDebugger(const OsiSolverInterface &si, const double *solution,
153  bool enforceOptimality = false);
154 
157 
160 
164 
165 private:
166  // Private member data
167 
171  double knownValue_;
172 
178 
181 
183  double *knownSolution_;
185 };
186 
187 #endif
188 
189 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
190 */
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
Validate cuts against a known solution.
int printOptimalSolution(const OsiSolverInterface &si) const
Print optimal solution (returns -1 bad debug, 0 on optimal, 1 not)
int numberColumns_
Number of columns in known solution.
double knownValue_
Value of known solution.
OsiRowCutDebugger(const OsiSolverInterface &si, const char *model)
Constructor with name of model.
OsiRowCutDebugger(const OsiSolverInterface &si, const double *solution, bool enforceOptimality=false)
Constructor with full solution.
bool * integerVariable_
array specifying integer variables
virtual bool invalidCut(const OsiRowCut &rowcut) const
Check that the cut does not cut off the solution known to the debugger.
bool activate(const OsiSolverInterface &si, const char *model)
Activate a debugger using the name of a problem.
double optimalValue() const
Return the value of the objective for the known solution.
virtual int validateCuts(const OsiCuts &cs, int first, int last) const
Check that the set of cuts does not cut off the solution known to the debugger.
bool onOptimalPath(const OsiSolverInterface &si) const
Returns true if the solution held in the solver is compatible with the known solution.
int numberColumns() const
Return the number of columns in the known solution.
friend void OsiRowCutDebuggerUnitTest(const OsiSolverInterface *siP, const std::string &mpsDir)
A function that tests the methods in the OsiRowCutDebugger class.
OsiRowCutDebugger & operator=(const OsiRowCutDebugger &rhs)
Assignment operator.
const double * optimalSolution() const
Return the known solution.
void redoSolution(int numberColumns, const int *originalColumns)
Edit the known solution to reflect column changes.
virtual ~OsiRowCutDebugger()
Destructor.
bool active() const
Returns true if the debugger is active.
bool activate(const OsiSolverInterface &si, const double *solution, bool keepContinuous=false)
Activate a debugger using a full solution array.
double * knownSolution_
array specifying known solution
OsiRowCutDebugger()
Default constructor - no checking.
OsiRowCutDebugger(const OsiRowCutDebugger &)
Copy constructor.
Row Cut Class.
Definition: OsiRowCut.hpp:29
Abstract Base Class for describing an interface to a solver.