| 1 |
// (C) Copyright International Business Machines (IBM) 2006 |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// P. Bonami, International Business Machines |
| 7 |
// |
| 8 |
// Date : 12/07/2006 |
| 9 |
|
| 10 |
|
| 11 |
// Code separated from BonOaDecBase to try to clarify OAs |
| 12 |
// A number of utility to manipulate models used in OA and FP |
| 13 |
#ifndef BonSolverHelp_H |
| 14 |
#define BonSolverHelp_H |
| 15 |
|
| 16 |
class OsiSolverInterface; |
| 17 |
class OsiBranchingInformation; |
| 18 |
class OsiObject; |
| 19 |
class OsiCuts; |
| 20 |
|
| 21 |
namespace Bonmin { |
| 22 |
/** Check for integer feasibility of a solution return true if it is feasible.*/ |
| 23 |
bool integerFeasible(OsiSolverInterface & si, const OsiBranchingInformation & info, |
| 24 |
double integer_tolerance, |
| 25 |
OsiObject ** objects = 0, int nObjects = -1); |
| 26 |
|
| 27 |
/** Fix integer variables in si to their values in colsol. |
| 28 |
\remark colsol is assumed to be integer on the integer constrained variables. |
| 29 |
*/ |
| 30 |
void fixIntegers(OsiSolverInterface & si, const OsiBranchingInformation & info, |
| 31 |
double integer_tolerance, |
| 32 |
OsiObject ** objects = 0, int nObjects = -1); |
| 33 |
/** Relax integer variables in si. |
| 34 |
*/ |
| 35 |
void relaxIntegers(OsiSolverInterface & si, const OsiBranchingInformation & info, |
| 36 |
double integer_tolerance, |
| 37 |
OsiObject ** objects = 0, int nObjects = -1); |
| 38 |
/** Check if two solutions are the same on integer variables. */ |
| 39 |
bool isDifferentOnIntegers(OsiSolverInterface &si, |
| 40 |
OsiObject ** objects, int nObjects, |
| 41 |
double integer_tolerance, |
| 42 |
const double * colsol, const double * other); |
| 43 |
|
| 44 |
/** Install cuts in solver. */ |
| 45 |
void installCuts(OsiSolverInterface &si, |
| 46 |
const OsiCuts& cs, int numberCuts); |
| 47 |
|
| 48 |
} |
| 49 |
#endif |
| 50 |
|