Changeset 2366:bfbdded3763a in lemon-0.x for lemon/lp_soplex.cc
- Timestamp:
- 02/16/07 20:11:31 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3181
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lp_soplex.cc
r2364 r2366 91 91 } 92 92 93 void LpSoplex::_getColName(int col, std::string &name) {93 void LpSoplex::_getColName(int col, std::string &name) const { 94 94 name = colNames[col]; 95 95 } 96 96 97 97 void LpSoplex::_setColName(int col, const std::string &name) { 98 invColNames.erase(colNames[col]); 98 99 colNames[col] = name; 100 if (!name.empty()) { 101 invColNames.insert(std::make_pair(name, col)); 102 } 103 } 104 105 int LpSoplex::_colByName(const std::string& name) const { 106 std::map<std::string, int>::const_iterator it = 107 invColNames.find(name); 108 if (it != invColNames.end()) { 109 return it->second; 110 } else { 111 return -1; 112 } 99 113 } 100 114 … … 110 124 } 111 125 112 void LpSoplex::_getRowCoeffs(int i, RowIterator b) {126 void LpSoplex::_getRowCoeffs(int i, RowIterator b) const { 113 127 const soplex::SVector& vec = soplex->rowVector(i); 114 128 for (int k = 0; k < vec.size(); ++k) { … … 128 142 } 129 143 130 void LpSoplex::_getColCoeffs(int i, ColIterator b) {144 void LpSoplex::_getColCoeffs(int i, ColIterator b) const { 131 145 const soplex::SVector& vec = soplex->colVector(i); 132 146 for (int k = 0; k < vec.size(); ++k) { … … 141 155 } 142 156 143 LpSoplex::Value LpSoplex::_getCoeff(int i, int j) {157 LpSoplex::Value LpSoplex::_getCoeff(int i, int j) const { 144 158 return soplex->rowVector(i)[j]; 145 159 } … … 150 164 } 151 165 152 LpSoplex::Value LpSoplex::_getColLowerBound(int i) {166 LpSoplex::Value LpSoplex::_getColLowerBound(int i) const { 153 167 double value = soplex->lower(i); 154 168 return value != -soplex::infinity ? value : -INF; … … 160 174 } 161 175 162 LpSoplex::Value LpSoplex::_getColUpperBound(int i) {176 LpSoplex::Value LpSoplex::_getColUpperBound(int i) const { 163 177 double value = soplex->upper(i); 164 178 return value != soplex::infinity ? value : INF; … … 170 184 solved = false; 171 185 } 172 void LpSoplex::_getRowBounds(int i, Value &lower, Value &upper) {186 void LpSoplex::_getRowBounds(int i, Value &lower, Value &upper) const { 173 187 lower = soplex->lhs(i); 174 188 if (lower == -soplex::infinity) lower = -INF; … … 182 196 } 183 197 184 LpSoplex::Value LpSoplex::_getObjCoeff(int i) {198 LpSoplex::Value LpSoplex::_getObjCoeff(int i) const { 185 199 return soplex->obj(i); 186 200 } … … 213 227 } 214 228 215 LpSoplex::Value LpSoplex::_getPrimal(int i) {229 LpSoplex::Value LpSoplex::_getPrimal(int i) const { 216 230 return primal_value[i]; 217 231 } 218 232 219 LpSoplex::Value LpSoplex::_getDual(int i) {233 LpSoplex::Value LpSoplex::_getDual(int i) const { 220 234 return dual_value[i]; 221 235 } 222 236 223 LpSoplex::Value LpSoplex::_getPrimalValue() {237 LpSoplex::Value LpSoplex::_getPrimalValue() const { 224 238 return soplex->objValue(); 225 239 } 226 240 227 bool LpSoplex::_isBasicCol(int i) {241 bool LpSoplex::_isBasicCol(int i) const { 228 242 return soplex->getBasisColStatus(i) == soplex::SPxSolver::BASIC; 229 243 } 230 244 231 LpSoplex::SolutionStatus LpSoplex::_getPrimalStatus() {245 LpSoplex::SolutionStatus LpSoplex::_getPrimalStatus() const { 232 246 if (!solved) return UNDEFINED; 233 247 switch (soplex->status()) { … … 243 257 } 244 258 245 LpSoplex::SolutionStatus LpSoplex::_getDualStatus() {259 LpSoplex::SolutionStatus LpSoplex::_getDualStatus() const { 246 260 if (!solved) return UNDEFINED; 247 261 switch (soplex->status()) { … … 255 269 } 256 270 257 LpSoplex::ProblemTypes LpSoplex::_getProblemType() {271 LpSoplex::ProblemTypes LpSoplex::_getProblemType() const { 258 272 if (!solved) return UNKNOWN; 259 273 switch (soplex->status()) { … … 275 289 solved = false; 276 290 } 277 bool LpSoplex::_isMax() {291 bool LpSoplex::_isMax() const { 278 292 return soplex->spxSense() == soplex::SPxSolver::MAXIMIZE; 279 293 }
Note: See TracChangeset
for help on using the changeset viewer.