blob: 4c807195d394f1e413d847469bdc0af9a6f8504d (
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
75
|
// (C) Copyright International Business Machines Corporation 2007
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors :
// Pierre Bonami, International Business Machines Corporation
//
// Date : 10/06/2007
#ifndef BonLinearCutsGenerator_H
#define BonLinearCutsGenerator_H
#include "CglCutGenerator.hpp"
#include "CoinSmartPtr.hpp"
#include "BonOuterApprox.hpp"
#include "BonBonminSetup.hpp"
#include <list>
namespace Bonmin {
class LinearCutsGenerator : public CglCutGenerator {
public:
/** Type for cut generation method with its frequency and string identification. */
struct CuttingMethod : public Coin::ReferencedObject
{
int frequency;
std::string id;
CglCutGenerator * cgl;
bool atSolution;
bool normal;
CuttingMethod():
atSolution(false),
normal(true)
{}
CuttingMethod(const CuttingMethod & other):
frequency(other.frequency),
id(other.id),
cgl(other.cgl),
atSolution(other.atSolution),
normal(other.normal)
{}
};
LinearCutsGenerator():
CglCutGenerator(),
methods_(){
}
LinearCutsGenerator(const LinearCutsGenerator & other):
CglCutGenerator(other),
methods_(other.methods_){
}
CglCutGenerator * clone() const {
return new LinearCutsGenerator(*this);
}
virtual ~LinearCutsGenerator(){
}
bool needsOptimalBasis() { return false;}
void initialize(BabSetupBase& s);
void generateCuts(const OsiSolverInterface &solver, OsiCuts &cs,
const CglTreeInfo info = CglTreeInfo());
private:
std::list<Coin::SmartPtr<CuttingMethod> > methods_;
};
}/* Ends Bonmin namespace.*/
#endif
|