1 | /* |
---|
2 | Copyright (C) 2007, Lou Hafer, International Business Machines Corporation |
---|
3 | and others. All Rights Reserved. |
---|
4 | |
---|
5 | This code is licensed under the terms of the Eclipse Public License (EPL). |
---|
6 | |
---|
7 | $Id: CbcGenOsiParam.cpp 1899 2013-04-09 18:12:08Z stefan $ |
---|
8 | */ |
---|
9 | /* |
---|
10 | This file is part of cbc-generic. |
---|
11 | */ |
---|
12 | |
---|
13 | #if defined(_MSC_VER) |
---|
14 | // Turn off compiler warning about long names |
---|
15 | # pragma warning(disable:4786) |
---|
16 | #endif |
---|
17 | |
---|
18 | #include <string> |
---|
19 | #include <cassert> |
---|
20 | |
---|
21 | #include "CoinParam.hpp" |
---|
22 | |
---|
23 | #include "CbcModel.hpp" |
---|
24 | #include "CbcGenCtlBlk.hpp" |
---|
25 | |
---|
26 | #include "CbcGenParam.hpp" |
---|
27 | #include "CbcGenCbcParam.hpp" |
---|
28 | #include "CbcGenOsiParam.hpp" |
---|
29 | |
---|
30 | namespace { |
---|
31 | |
---|
32 | char svnid[] = "$Id: CbcGenOsiParam.cpp 1899 2013-04-09 18:12:08Z stefan $" ; |
---|
33 | |
---|
34 | } |
---|
35 | |
---|
36 | /* |
---|
37 | Constructors and destructors |
---|
38 | |
---|
39 | There's a generic constructor and one for integer, double, keyword, string, |
---|
40 | and action parameters. |
---|
41 | */ |
---|
42 | |
---|
43 | /* |
---|
44 | Default constructor. |
---|
45 | */ |
---|
46 | CbcOsiParam::CbcOsiParam () |
---|
47 | : CoinParam(), |
---|
48 | paramCode_(CbcOsiParamCode(0)), |
---|
49 | obj_(0) |
---|
50 | { |
---|
51 | /* Nothing to be done here */ |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | /* |
---|
56 | Constructor for double parameter |
---|
57 | */ |
---|
58 | CbcOsiParam::CbcOsiParam (CbcOsiParamCode code, |
---|
59 | std::string name, std::string help, |
---|
60 | double lower, double upper, double dflt, |
---|
61 | bool display) |
---|
62 | : CoinParam(name, help, lower, upper, dflt, display), |
---|
63 | paramCode_(code), |
---|
64 | obj_(0) |
---|
65 | { |
---|
66 | /* Nothing to be done here */ |
---|
67 | } |
---|
68 | |
---|
69 | /* |
---|
70 | Constructor for integer parameter |
---|
71 | */ |
---|
72 | CbcOsiParam::CbcOsiParam (CbcOsiParamCode code, |
---|
73 | std::string name, std::string help, |
---|
74 | int lower, int upper, int dflt, |
---|
75 | bool display) |
---|
76 | : CoinParam(name, help, lower, upper, dflt, display), |
---|
77 | paramCode_(code), |
---|
78 | obj_(0) |
---|
79 | { |
---|
80 | /* Nothing to be done here */ |
---|
81 | } |
---|
82 | |
---|
83 | /* |
---|
84 | Constructor for keyword parameter. |
---|
85 | */ |
---|
86 | CbcOsiParam::CbcOsiParam (CbcOsiParamCode code, |
---|
87 | std::string name, std::string help, |
---|
88 | std::string firstValue, int dflt, |
---|
89 | bool display) |
---|
90 | : CoinParam(name, help, firstValue, dflt, display), |
---|
91 | paramCode_(code), |
---|
92 | obj_(0) |
---|
93 | { |
---|
94 | /* Nothing to be done here */ |
---|
95 | } |
---|
96 | |
---|
97 | /* |
---|
98 | Constructor for string parameter. |
---|
99 | */ |
---|
100 | CbcOsiParam::CbcOsiParam (CbcOsiParamCode code, |
---|
101 | std::string name, std::string help, |
---|
102 | std::string dflt, |
---|
103 | bool display) |
---|
104 | : CoinParam(name, help, dflt, display), |
---|
105 | paramCode_(code), |
---|
106 | obj_(0) |
---|
107 | { |
---|
108 | /* Nothing to be done here */ |
---|
109 | } |
---|
110 | |
---|
111 | /* |
---|
112 | Constructor for action parameter. |
---|
113 | */ |
---|
114 | CbcOsiParam::CbcOsiParam (CbcOsiParamCode code, |
---|
115 | std::string name, std::string help, |
---|
116 | bool display) |
---|
117 | : CoinParam(name, help, display), |
---|
118 | paramCode_(code), |
---|
119 | obj_(0) |
---|
120 | { |
---|
121 | /* Nothing to be done here */ |
---|
122 | } |
---|
123 | |
---|
124 | |
---|
125 | /* |
---|
126 | Copy constructor. |
---|
127 | */ |
---|
128 | CbcOsiParam::CbcOsiParam (const CbcOsiParam &orig) |
---|
129 | : CoinParam(orig), |
---|
130 | paramCode_(orig.paramCode_), |
---|
131 | obj_(orig.obj_) |
---|
132 | { |
---|
133 | /* Nothing to be done here */ |
---|
134 | } |
---|
135 | |
---|
136 | /* |
---|
137 | Clone |
---|
138 | */ |
---|
139 | |
---|
140 | CbcOsiParam *CbcOsiParam::clone () |
---|
141 | { |
---|
142 | return (new CbcOsiParam(*this)) ; |
---|
143 | } |
---|
144 | |
---|
145 | CbcOsiParam &CbcOsiParam::operator= (const CbcOsiParam & rhs) |
---|
146 | { |
---|
147 | if (this != &rhs) { |
---|
148 | CoinParam::operator=(rhs) ; |
---|
149 | |
---|
150 | paramCode_ = rhs.paramCode_ ; |
---|
151 | obj_ = rhs.obj_ ; |
---|
152 | } |
---|
153 | |
---|
154 | return *this ; |
---|
155 | } |
---|
156 | |
---|
157 | /* |
---|
158 | Destructor |
---|
159 | */ |
---|
160 | CbcOsiParam::~CbcOsiParam () |
---|
161 | { /* Nothing more to do */ } |
---|
162 | |
---|
163 | |
---|