blob: 94f8723766d492c113ecd30fb3b5437877a784f9 (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
// Copyright (C) 2010, International Business Machines Corporation and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors :
// Pierre Bonami CNRS
//
// Date : May, 26 2010
#ifndef BonMilpRounding_HPP
#define BonMilpRounding_HPP
#include "BonOsiTMINLPInterface.hpp"
#include "BonBonminSetup.hpp"
#include "CbcHeuristic.hpp"
#include "CbcStrategy.hpp"
#include "OsiCuts.hpp"
namespace Bonmin
{
class SubMipSolver;
class MilpRounding : public CbcHeuristic
{
public:
/// Constructor with setup
MilpRounding(BonminSetup * setup);
/// Copy constructor
MilpRounding(const MilpRounding ©);
/// Destructor
~MilpRounding();
/// Assignment operator
MilpRounding & operator=(const MilpRounding & rhs);
/// Clone
virtual CbcHeuristic * clone() const{
return new MilpRounding(*this);
}
/// Initialize method
void Initialize(BonminSetup * setup);
/// Resets stuff if model changes
virtual void resetModel(CbcModel * model){
setModel(model);
}
/** Change setup used for heuristic.*/
virtual void setSetup(BonminSetup * setup){
setup_ = setup;
// Initialize(setup_->options());
}
/// Performs heuristic
virtual int solution(double &solutionValue, double *betterSolution);
static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
protected:
/** Setup to use for local searches (will make copies).*/
BonminSetup * setup_;
private:
/// How often to do (code can change)
int howOften_;
/// A subsolver for MIP
SubMipSolver * mip_;
OsiCuts noGoods;
};
}
#endif
|