forked from coin-or/Cbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CbcSolver2.hpp
122 lines (103 loc) · 2.66 KB
/
CbcSolver2.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
// Copyright (C) 2005, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef CbcSolver2_H
#define CbcSolver2_H
#include "OsiClpSolverInterface.hpp"
class CbcModel;
//#############################################################################
/**
This is to allow the user to replace initialSolve and resolve.
This version is to try and speed up long thin problems.
This particular version assumes unit elements and rhs
Can be E or G rhs
*/
class CbcSolver2 : 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
CbcSolver2();
/// Clone
virtual OsiSolverInterface *clone(bool CopyData = true) const;
/// Copy constructor
CbcSolver2(const CbcSolver2 &);
/// Assignment operator
CbcSolver2 &operator=(const CbcSolver2 &rhs);
/// Destructor
virtual ~CbcSolver2();
//@}
/**@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 just count usage
inline void setAlgorithm(int value)
{
algorithm_ = value;
}
/// Say whether to just count usage
inline int getAlgorithm() const
{
return algorithm_;
}
/// Strategy
inline void setStrategy(int value)
{
strategy_ = value;
}
/// Strategy
inline int getStrategy() const
{
return strategy_;
}
//@}
//---------------------------------------------------------------------------
private:
/**@name Private member data */
//@{
/// 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 0 nothing, 1 compress and fix, 2 long thin
int algorithm_;
/// If 0 get rid of rows, 1 keep rows (to stay dual feasible)
int strategy_;
//@}
};
#endif