-
Notifications
You must be signed in to change notification settings - Fork 117
/
CbcSolver3.hpp
125 lines (107 loc) · 2.78 KB
/
CbcSolver3.hpp
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Copyright (C) 2004, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef CbcSolver3_H
#define CbcSolver3_H
#include "OsiClpSolverInterface.hpp"
class CbcModel;
//#############################################################################
/**
This is to allow the user to replace initialSolve and resolve
*/
class CbcSolver3 : public OsiClpSolverInterface {
public:
//---------------------------------------------------------------------------
/**@name Solve methods */
//@{
/// Solve initial LP relaxation
virtual void initialSolve();
/// Resolve an LP relaxation after problem modification
virtual void resolve();
//@}
/**@name Constructors and destructors */
//@{
/// Default Constructor
CbcSolver3();
/// Clone
virtual OsiSolverInterface *clone(bool CopyData = true) const;
/// Copy constructor
CbcSolver3(const CbcSolver3 &);
/// Assignment operator
CbcSolver3 &operator=(const CbcSolver3 &rhs);
/// Destructor
virtual ~CbcSolver3();
//@}
/**@name Sets and Getss */
//@{
/// Setup arrays - ones in keep will always be in
void initialize(CbcModel *model, const char *keep);
/// get which ones have been used
inline const int *when() const
{
return node_;
}
/// Get memory (i.e. how recent use should be)
inline int getMemory() const
{
return memory_;
}
/// Get current count
inline int getCount() const
{
return count_;
}
/// Set memory (i.e. how recent use should be)
inline void setMemory(int value)
{
memory_ = value;
}
/// Say whether to believe infeasible
inline void setBelieveInfeasible(bool yesNo)
{
believeInfeasible_ = yesNo;
}
/// Say whether to just count usage
inline void setAlgorithm(int value)
{
algorithm_ = value;
}
/// Do nested search if this fraction fixed
inline void setNested(double value)
{
nestedSearch_ = value;
}
/// Say whether to just count usage
inline int getAlgorithm() const
{
return algorithm_;
}
/// Do nested search if this fraction fixed
inline double getNested() const
{
return nestedSearch_;
}
//@}
//---------------------------------------------------------------------------
private:
/**@name Private member data */
//@{
/// Do nested search if this fraction fixed
double nestedSearch_;
/// Node number when variable last in problem
int *node_;
/// How many times in problem
int *howMany_;
/// Pointer back to model
CbcModel *model_;
/// Counter
int count_;
/// How recently it must have been used
int memory_;
/// If infeasible on subset means infeasible
bool believeInfeasible_;
/// If 0 nothing, 1 compress and fix, 2 long thin
bool algorithm_;
//@}
};
#endif