| 1 |
// Copyright (C) 2006, 2007 International Business Machines |
| 2 |
// Corporation and others. All Rights Reserved. |
| 3 |
#ifndef BonLpBranchingSolver_H |
| 4 |
#define BonLpBranchingSolver_H |
| 5 |
|
| 6 |
#include "BonStrongBranchingSolver.hpp" |
| 7 |
#include "BonEcpCuts.hpp" |
| 8 |
|
| 9 |
namespace Bonmin |
| 10 |
{ |
| 11 |
|
| 12 |
/** Implementation of BonChooseVariable for curvature-based braching. |
| 13 |
*/ |
| 14 |
|
| 15 |
class LpBranchingSolver : public StrongBranchingSolver |
| 16 |
{ |
| 17 |
|
| 18 |
public: |
| 19 |
|
| 20 |
/// Constructor from setup |
| 21 |
LpBranchingSolver (BabSetupBase *b); |
| 22 |
/// Copy constructor |
| 23 |
LpBranchingSolver (const LpBranchingSolver &); |
| 24 |
|
| 25 |
/// Assignment operator |
| 26 |
LpBranchingSolver & operator= (const LpBranchingSolver& rhs); |
| 27 |
|
| 28 |
/// Destructor |
| 29 |
virtual ~LpBranchingSolver (); |
| 30 |
|
| 31 |
/// Called to initialize solver before a bunch of strong branching |
| 32 |
/// solves |
| 33 |
virtual void markHotStart(OsiTMINLPInterface* tminlp_interface); |
| 34 |
|
| 35 |
/// Called to solve the current TMINLP (with changed bound information) |
| 36 |
virtual TNLPSolver::ReturnStatus solveFromHotStart(OsiTMINLPInterface* tminlp_interface); |
| 37 |
|
| 38 |
/// Called after all strong branching solves in a node |
| 39 |
virtual void unmarkHotStart(OsiTMINLPInterface* tminlp_interface); |
| 40 |
|
| 41 |
void setMaxCuttingPlaneIter(int num) |
| 42 |
{ |
| 43 |
maxCuttingPlaneIterations_ = num; |
| 44 |
} |
| 45 |
|
| 46 |
static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); |
| 47 |
|
| 48 |
private: |
| 49 |
/// Default Constructor |
| 50 |
LpBranchingSolver (); |
| 51 |
|
| 52 |
/// Linear solver |
| 53 |
OsiSolverInterface* lin_; |
| 54 |
|
| 55 |
/// Warm start object for linear solver |
| 56 |
CoinWarmStart* warm_; |
| 57 |
|
| 58 |
/// Ecp cut generate |
| 59 |
EcpCuts* ecp_; |
| 60 |
|
| 61 |
/// Number of maximal ECP cuts |
| 62 |
int maxCuttingPlaneIterations_; |
| 63 |
|
| 64 |
/// absolute tolerance for ECP cuts |
| 65 |
double abs_ecp_tol_; |
| 66 |
|
| 67 |
/// relative tolerance for ECP cuts |
| 68 |
double rel_ecp_tol_; |
| 69 |
|
| 70 |
|
| 71 |
enum WarmStartMethod { |
| 72 |
Basis=0 /** Use basis*/, |
| 73 |
Clone /** clone problem*/ |
| 74 |
}; |
| 75 |
/// Way problems are warm started |
| 76 |
WarmStartMethod warm_start_mode_; |
| 77 |
}; |
| 78 |
|
| 79 |
} |
| 80 |
#endif |