Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BonNlpHeuristic.hpp
Go to the documentation of this file.
1 /* $Id: BonNlpHeuristic.hpp 988 2013-08-04 20:59:18Z pbelotti $ */
2 // (C) Copyright International Business Machines Corporation 2007
3 // All Rights Reserved.
4 // This code is published under the Eclipse Public License (EPL).
5 //
6 // Authors :
7 // Pierre Bonami, International Business Machines Corporation
8 //
9 // Date : 04/09/2007
10 
11 #ifndef BonIpoptHeuristic_HPP
12 #define BonIpoptHeuristic_HPP
13 
14 #include "BonOsiTMINLPInterface.hpp"
15 #include "CbcHeuristic.hpp"
16 #include "BonOsiTMINLPInterface.hpp"
17 #include "CouenneProblem.hpp"
18 
19 namespace Couenne {
20 
26  const double maxNlpInf_0 = 1e-5;
27 
28  class NlpSolveHeuristic : public CbcHeuristic{
29 
30  public:
34  NlpSolveHeuristic(CbcModel & mip, Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp = false, CouenneProblem * couenne = NULL);
37 
39  virtual ~NlpSolveHeuristic();
40 
42  virtual CbcHeuristic * clone() const;
43 
46 
48  void setNlp (Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp = true);
49 
53  virtual void resetModel(CbcModel * model){}
59  virtual int solution( double & objectiveValue, double * newSolution);
61  void setMaxNlpInf(double value){
62  maxNlpInf_ = value;}
64  void setNumberSolvePerLevel(int value){
65  numberSolvePerLevel_ = value;}
66 
69 
70  private:
72  Bonmin::OsiTMINLPInterface * nlp_;
74  bool hasCloned_;
76  double maxNlpInf_;
81  };
82 
83 }
84 
85 #endif
NlpSolveHeuristic & operator=(const NlpSolveHeuristic &rhs)
Assignment operator.
virtual CbcHeuristic * clone() const
Clone.
const double maxNlpInf_0
A heuristic to call an NlpSolver if all CouenneObjects are close to be satisfied (for other integer o...
void setCouenneProblem(CouenneProblem *)
set the couenne problem to use.
Bonmin::OsiTMINLPInterface * nlp_
Pointer to an nlp solver interface.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions >)
initialize options
void setNumberSolvePerLevel(int value)
set number of nlp&#39;s solved for each given level of the tree
virtual int solution(double &objectiveValue, double *newSolution)
Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.
int numberSolvePerLevel_
Number of nlp&#39;s solved for each given level of the tree.
bool hasCloned_
is nlp_ cloned or just a pointer?
double maxNlpInf_
maximum nlp infeasibility under which try to solve problem with Ipopt.
Class for MINLP problems with symbolic information.
void setNlp(Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp=true)
Set the nlp solver.
NlpSolveHeuristic()
Default constructor.
CouenneProblem * couenne_
Pointer to a couenne representation of the problem.
virtual ~NlpSolveHeuristic()
Destructor.
virtual void resetModel(CbcModel *model)
Does nothing.
void setMaxNlpInf(double value)
set maxNlpInf.