Debian Codegraph @

Bonmin/src/Interfaces/BonStrongBranchingSolver.hpp

raw
1 // Copyright (C) 2007, International Business Machines
2 // Corporation and others. All Rights Reserved.
3 //
4 // Author: Andreas Waechter 2007-08-20 IBM
5 //
6 #ifndef BonStrongBranchingSolver_H
7 #define BonStrongBranchingSolver_H
8
9 #include "BonOsiTMINLPInterface.hpp"
10 #include "BonRegisteredOptions.hpp"
11 namespace Bonmin {
12
13 /** This class is the base class for a solver that can be used in
14 * BonOsiSolverInterface to perform the strong branching solves.
15 */
16
17 class StrongBranchingSolver : public Ipopt::ReferencedObject {
18
19 public:
20
21 /// Constructor from solver
22 StrongBranchingSolver (OsiTMINLPInterface * solver);
23
24 /// Assignment operator
25 StrongBranchingSolver & operator= (const StrongBranchingSolver& rhs);
26 /// Copy constructor
27 StrongBranchingSolver(const StrongBranchingSolver& rhs);
28
29 /// Destructor
30 virtual ~StrongBranchingSolver ();
31
32 /// Called to initialize solver before a bunch of strong branching
33 /// solves
34 virtual void markHotStart(OsiTMINLPInterface* tminlp_interface) = 0;
35
36 /// Called to solve the current TMINLP (with changed bound information)
37 virtual TNLPSolver::ReturnStatus solveFromHotStart(OsiTMINLPInterface* tminlp_interface) = 0;
38
39 /// Called after all strong branching solves in a node
40 virtual void unmarkHotStart(OsiTMINLPInterface* tminlp_interface) = 0;
41
42 protected:
43
44 inline Ipopt::SmartPtr<Ipopt::Journalist>& Jnlst()
45 {
46 return jnlst_;
47 }
48 inline Ipopt::SmartPtr<Ipopt::OptionsList>& Options()
49 {
50 return options_;
51 }
52 inline Ipopt::SmartPtr<RegisteredOptions>& RegOptions()
53 {
54 return reg_options_;
55 }
56 private:
57 /** Default Constructor, forbiden for some reason.*/
58 StrongBranchingSolver ();
59
60 Ipopt::SmartPtr<Ipopt::Journalist> jnlst_;
61 Ipopt::SmartPtr<Ipopt::OptionsList> options_;
62 Ipopt::SmartPtr<Bonmin::RegisteredOptions> reg_options_;
63
64 int bb_log_level_;
65
66 };
67
68 }
69 #endif