Couenne 0.5.8
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
15#include "CbcHeuristic.hpp"
17#include "CouenneProblem.hpp"
18
19namespace Couenne {
20
26 const double maxNlpInf_0 = 1e-5;
27
29
30 public:
34 NlpSolveHeuristic(CbcModel & mip, Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp = false, CouenneProblem * couenne = NULL);
37
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:
74 bool hasCloned_;
76 double maxNlpInf_;
78 int numberSolvePerLevel_;
80 CouenneProblem * couenne_;
81 };
82
83}
84
85#endif
Class for MINLP problems with symbolic information.
void setNumberSolvePerLevel(int value)
set number of nlp'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.
virtual CbcHeuristic * clone() const
Clone.
NlpSolveHeuristic(const NlpSolveHeuristic &other)
Copy constructor.
void setCouenneProblem(CouenneProblem *)
set the couenne problem to use.
void setMaxNlpInf(double value)
set maxNlpInf.
virtual void resetModel(CbcModel *model)
Does nothing.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions >)
initialize options
NlpSolveHeuristic()
Default constructor.
NlpSolveHeuristic(CbcModel &mip, Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp=false, CouenneProblem *couenne=NULL)
Constructor with model and Ipopt problems.
void setNlp(Bonmin::OsiTMINLPInterface &nlp, bool cloneNlp=true)
Set the nlp solver.
NlpSolveHeuristic & operator=(const NlpSolveHeuristic &rhs)
Assignment operator.
virtual ~NlpSolveHeuristic()
Destructor.
general include file for different compilers
const double maxNlpInf_0
A heuristic to call an NlpSolver if all CouenneObjects are close to be satisfied (for other integer o...