blob: 5c3d7fab0aa0bd1dd1a4fb4c4e675af864de48d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
// (C) Copyright Carnegie Mellon University 2005
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors :
// P. Bonami, Carnegie Mellon University
//
// Date : 05/26/2005
#ifndef BonDummyHeuristic_HPP
#define BonDummyHeuristic_HPP
#include "BonOsiTMINLPInterface.hpp"
#include "CbcHeuristic.hpp"
namespace Bonmin
{
class DummyHeuristic : public CbcHeuristic
{
public:
/// Default constructor
DummyHeuristic(OsiTMINLPInterface * si = NULL);
/// Usefull constructor
DummyHeuristic(CbcModel &model, OsiTMINLPInterface * si = NULL);
///Copy constructor
DummyHeuristic( const DummyHeuristic ©):
CbcHeuristic(copy),
nlp_(copy.nlp_),
knowsSolution(copy.knowsSolution)
{}
/// Set nlp_
void setNlp(OsiTMINLPInterface * si);
/// heuristic method
virtual int solution(double &solutionValue, double *betterSolution);
virtual int solution(double &solutionValue, double *betterSolution, OsiCuts & cs)
{
return solution(solutionValue, betterSolution);
}
virtual CbcHeuristic * clone()const
{
return new DummyHeuristic(*this);
}
virtual void resetModel(CbcModel*)
{}
virtual bool shouldHeurRun(int whereFrom){
return true;}
private:
/// Pointer to the Ipopt interface
OsiTMINLPInterface * nlp_;
/// Do I have a solution?
bool knowsSolution;
};
}
#endif
|