| 1 |
// Copyright (C) 2007, International Business Machines |
| 2 |
// Corporation and others. All Rights Reserved. |
| 3 |
#ifndef BonQpBranchingSolver_H |
| 4 |
#define BonQpBranchingSolver_H |
| 5 |
|
| 6 |
#include "BonminConfig.h" |
| 7 |
#include "BonStrongBranchingSolver.hpp" |
| 8 |
#include "BonBranchingTQP.hpp" |
| 9 |
|
| 10 |
#ifdef COIN_HAS_FILTERSQP |
| 11 |
#include "BonFilterSolver.hpp" |
| 12 |
#include "BonBqpdSolver.hpp" |
| 13 |
#endif |
| 14 |
|
| 15 |
namespace Bonmin |
| 16 |
{ |
| 17 |
|
| 18 |
/** This class chooses a variable to branch on |
| 19 |
|
| 20 |
This implementation solves the Qp model for different branches |
| 21 |
(strong branching). |
| 22 |
*/ |
| 23 |
|
| 24 |
class QpBranchingSolver : public StrongBranchingSolver |
| 25 |
{ |
| 26 |
|
| 27 |
public: |
| 28 |
|
| 29 |
/// Constructor from solver (so we can set up arrays etc) |
| 30 |
QpBranchingSolver (OsiTMINLPInterface * solver); |
| 31 |
|
| 32 |
/// Copy constructor |
| 33 |
QpBranchingSolver (const QpBranchingSolver &); |
| 34 |
|
| 35 |
/// Assignment operator |
| 36 |
QpBranchingSolver & operator= (const QpBranchingSolver& rhs); |
| 37 |
|
| 38 |
/// Destructor |
| 39 |
virtual ~QpBranchingSolver (); |
| 40 |
|
| 41 |
/// Called to initialize solver before a bunch of strong branching |
| 42 |
/// solves |
| 43 |
virtual void markHotStart(OsiTMINLPInterface* tminlp_interface); |
| 44 |
|
| 45 |
/// Called to solve the current TMINLP (with changed bound information) |
| 46 |
virtual TNLPSolver::ReturnStatus solveFromHotStart(OsiTMINLPInterface* tminlp_interface); |
| 47 |
|
| 48 |
/// Called after all strong branching solves in a node |
| 49 |
virtual void unmarkHotStart(OsiTMINLPInterface* tminlp_interface); |
| 50 |
|
| 51 |
private: |
| 52 |
/// Default Constructor |
| 53 |
QpBranchingSolver (); |
| 54 |
|
| 55 |
Ipopt::SmartPtr<BranchingTQP> branching_tqp_; |
| 56 |
|
| 57 |
Ipopt::SmartPtr<TNLPSolver> tqp_solver_; |
| 58 |
|
| 59 |
#ifdef TIME_BQPD |
| 60 |
BqpdSolver::Times times_; |
| 61 |
#endif |
| 62 |
|
| 63 |
bool first_solve_; |
| 64 |
}; |
| 65 |
|
| 66 |
} |
| 67 |
|
| 68 |
#endif |