| 1 |
// (C) Copyright International Business Machines 2006 |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// P. Bonami, Carnegie Mellon University |
| 7 |
// |
| 8 |
// Date : 12/26/2006 |
| 9 |
|
| 10 |
|
| 11 |
#ifndef BonOaFeasibilityChecker_HPP |
| 12 |
#define BonOaFeasibilityChecker_HPP |
| 13 |
#include "BonOaDecBase.hpp" |
| 14 |
|
| 15 |
namespace Bonmin |
| 16 |
{ |
| 17 |
/** Class to perform OA in its classical form.*/ |
| 18 |
class OaFeasibilityChecker : public OaDecompositionBase |
| 19 |
{ |
| 20 |
public: |
| 21 |
/// New usefull constructor |
| 22 |
OaFeasibilityChecker(BabSetupBase &b); |
| 23 |
/// Copy constructor |
| 24 |
OaFeasibilityChecker(const OaFeasibilityChecker ©) |
| 25 |
: |
| 26 |
OaDecompositionBase(copy), |
| 27 |
pol_(copy.pol_), |
| 28 |
type_(copy.type_), |
| 29 |
cut_count_(copy.cut_count_), |
| 30 |
maximum_oa_cuts_(copy.maximum_oa_cuts_) |
| 31 |
{} |
| 32 |
/// Destructor |
| 33 |
~OaFeasibilityChecker(); |
| 34 |
|
| 35 |
/** Register OA options.*/ |
| 36 |
static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); |
| 37 |
|
| 38 |
virtual CglCutGenerator * clone() const |
| 39 |
{ |
| 40 |
return new OaFeasibilityChecker(*this); |
| 41 |
} |
| 42 |
protected: |
| 43 |
/// virtual method which performs the OA algorithm by modifying lp and nlp. |
| 44 |
virtual double performOa(OsiCuts & cs, solverManip &lpManip, |
| 45 |
BabInfo * babInfo, double &cutoff, const CglTreeInfo & info) const; |
| 46 |
/// virutal method to decide if local search is performed |
| 47 |
virtual bool doLocalSearch(BabInfo * babInfo) const |
| 48 |
{ |
| 49 |
return 0; |
| 50 |
} |
| 51 |
|
| 52 |
/** See documentation for feas_check_discard_policy option.*/ |
| 53 |
enum CutsPolicies { |
| 54 |
DetectCycles = 0, |
| 55 |
KeepAll, |
| 56 |
TreatAsNormal}; |
| 57 |
/** Policy for keeping cuts.*/ |
| 58 |
CutsPolicies pol_; |
| 59 |
|
| 60 |
/** See documentation for feas_check_cut_types option.*/ |
| 61 |
enum CutsTypes { |
| 62 |
OA = 0, |
| 63 |
Benders}; |
| 64 |
/** Type of cuts.*/ |
| 65 |
CutsTypes type_; |
| 66 |
|
| 67 |
/** Count the total number of cuts generated.*/ |
| 68 |
mutable unsigned int cut_count_; |
| 69 |
/** maximum number of OA cuts.*/ |
| 70 |
unsigned int maximum_oa_cuts_; |
| 71 |
}; |
| 72 |
} |
| 73 |
#endif |