| 1 |
// (C) Copyright CNRS 2008 |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// P. Bonami, CNRS |
| 7 |
// |
| 8 |
// Date : 02/13/2009 |
| 9 |
|
| 10 |
#ifndef BonFpForMinlp_H |
| 11 |
#define BonFpForMinlp_H |
| 12 |
#include "BonOaDecBase.hpp" |
| 13 |
|
| 14 |
namespace Bonmin{ |
| 15 |
class MinlpFeasPump : public OaDecompositionBase{ |
| 16 |
public: |
| 17 |
/// Constructor with basic setup |
| 18 |
MinlpFeasPump(BabSetupBase & b); |
| 19 |
|
| 20 |
/// Copy constructor |
| 21 |
MinlpFeasPump(const MinlpFeasPump ©) |
| 22 |
: |
| 23 |
OaDecompositionBase(copy), |
| 24 |
subMip_(new SubMipSolver(*copy.subMip_)), |
| 25 |
passBound_(copy.passBound_) |
| 26 |
{} |
| 27 |
/// Destructor |
| 28 |
~MinlpFeasPump(); |
| 29 |
|
| 30 |
void setStrategy(const CbcStrategy & strategy) |
| 31 |
{ |
| 32 |
parameters_.setStrategy(strategy); |
| 33 |
} |
| 34 |
|
| 35 |
virtual CglCutGenerator * clone() const |
| 36 |
{ |
| 37 |
return new MinlpFeasPump(*this); |
| 38 |
} |
| 39 |
/** Register OA options.*/ |
| 40 |
static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); |
| 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 |
/** Put objective of MIP according to FP scheme. */ |
| 49 |
void set_fp_objective(OsiSolverInterface &si, const double * colsol) const; |
| 50 |
|
| 51 |
private: |
| 52 |
SubMipSolver * subMip_; |
| 53 |
/** Wether or not to pass bound to master algorithm.*/ |
| 54 |
int passBound_; |
| 55 |
}; |
| 56 |
|
| 57 |
}/* End Namespace.*/ |
| 58 |
|
| 59 |
#endif |
| 60 |
|
| 61 |
|