BonHeuristicInnerApproximation.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 class HeuristicInnerApproximation: public CbcHeuristic {
21 public:
22 
25 
28 
31 
34  const HeuristicInnerApproximation & rhs);
35 
37  virtual CbcHeuristic * clone() const {
38  return new HeuristicInnerApproximation(*this);
39  }
40 
42  void Initialize(BonminSetup * setup);
43 
45  virtual void resetModel(CbcModel * model) {
46  setModel(model);
47  }
48 
50  virtual int solution(double &solutionValue, double *betterSolution);
51 
53  static void registerOptions(
55 
56 protected:
59 
60 private:
62  int howOften_;
63 
66 
68  int nbAp_;
69 
70  void extractInnerApproximation(OsiTMINLPInterface & nlp, OsiSolverInterface &si,
71  const double * x, bool getObj);
72 
73  bool getMyInnerApproximation(OsiTMINLPInterface &si, OsiCuts &cs, int ind,
74  const double * x, const double * x2);
75 
76 
77 };
78 }
79 
80 #endif
bool getMyInnerApproximation(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 ...
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options common to all local search based heuristics.
BonminSetup * setup_
Setup to use for local searches (will make copies).
ULong x2
Definition: OSdtoa.cpp:1776
int nbAp_
Number of Approximation points.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
void extractInnerApproximation(OsiTMINLPInterface &nlp, OsiSolverInterface &si, const double *x, bool getObj)
SubMipSolver * mip_
A subsolver for MIP.
A very simple class to provide a common interface for solving MIPs with Cplex and Cbc...
virtual CbcHeuristic * clone() const
Clone.
HeuristicInnerApproximation & operator=(const HeuristicInnerApproximation &rhs)
Assignment operator.
virtual int solution(double &solutionValue, double *betterSolution)
Performs heuristic.
void Initialize(BonminSetup *setup)
Initialize method.
HeuristicInnerApproximation(BonminSetup *setup)
Constructor with setup.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
int howOften_
How often to do (code can change)
void fint fint fint real fint real * x