SepaHeuristicInnerApproximation.hpp
Go to the documentation of this file.
1 // (C) Copyright CNRS and others 2010
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Pierre Bonami, Université de la Méditérannée
7 // Hassan Hijazi, Orange Labs
8 //
9 // Date : 05/22/2010
10 
11 #ifndef BonHeuristicInnerApproximation_HPP
12 #define BonHeuristicInnerApproximation_HPP
14 #include "BonBonminSetup.hpp"
15 #include "CbcHeuristic.hpp"
16 #include "CbcStrategy.hpp"
17 
18 namespace Bonmin {
19 class SubMipSolver;
20 }
21 
22 namespace Sepa{
23 class HeuristicInnerApproximation: public CbcHeuristic {
24 public:
25 
28 
31 
34 
37  const HeuristicInnerApproximation & rhs);
38 
40  virtual CbcHeuristic * clone() const {
41  return new HeuristicInnerApproximation(*this);
42  }
43 
45  void Initialize(Bonmin::BonminSetup * setup);
46 
48  virtual void resetModel(CbcModel * model) {
49  setModel(model);
50  }
51 
53  virtual int solution(double &solutionValue, double *betterSolution);
54 
56  static void registerOptions(
58 
59 protected:
62 
63 private:
65  int howOften_;
66 
69 
71  int nbAp_;
72 
74  double time_limit_;
75 
76  void extractInnerApproximation(Bonmin::OsiTMINLPInterface & nlp, OsiSolverInterface &si,
77  const double * x, bool getObj);
78 
79  bool getMyInnerApproximation(Bonmin::OsiTMINLPInterface &si, OsiCuts &cs, int ind,
80  const double * x, const double * x2);
81 
82 
83 };
84 }
85 
86 #endif
ULong x2
Definition: OSdtoa.cpp:1776
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
int howOften_
How often to do (code can change)
int nbAp_
Number of Approximation points.
void Initialize(Bonmin::BonminSetup *setup)
Initialize method.
virtual CbcHeuristic * clone() const
Clone.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options common to all local search based heuristics.
HeuristicInnerApproximation(Bonmin::BonminSetup *setup)
Constructor with setup.
A very simple class to provide a common interface for solving MIPs with Cplex and Cbc...
bool getMyInnerApproximation(Bonmin::OsiTMINLPInterface &si, OsiCuts &cs, int ind, const double *x, const double *x2)
Get an inner-approximation constraint obtained by drawing a chord linking the two given points x and ...
Bonmin::BonminSetup * setup_
Setup to use for local searches (will make copies).
virtual int solution(double &solutionValue, double *betterSolution)
Performs heuristic.
Bonmin::SubMipSolver * mip_
A subsolver for MIP.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
HeuristicInnerApproximation & operator=(const HeuristicInnerApproximation &rhs)
Assignment operator.
void extractInnerApproximation(Bonmin::OsiTMINLPInterface &nlp, OsiSolverInterface &si, const double *x, bool getObj)
void fint fint fint real fint real * x