Changeset 2366:bfbdded3763a in lemon-0.x for lemon/lp_cplex.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_cplex.cc
r2364 r2366 85 85 } 86 86 87 void LpCplex::_getColName(int col, std::string &name) 87 void LpCplex::_getColName(int col, std::string &name) const 88 88 { 89 89 ///\bug Untested … … 108 108 CPXchgcolname(env, lp, 1, &col, names); 109 109 } 110 111 int LpCplex::_colByName(const std::string& name) const 112 { 113 int index; 114 if (CPXgetcolindex(env, lp, 115 const_cast<char*>(name.c_str()), &index) == 0) { 116 return index; 117 } 118 return -1; 119 } 110 120 111 121 ///\warning Data at index 0 is ignored in the arrays. … … 126 136 } 127 137 128 void LpSoplex::_getRowCoeffs(int i, RowIterator b) {138 void LpSoplex::_getRowCoeffs(int i, RowIterator b) const { 129 139 /// \todo implement 130 140 } … … 146 156 } 147 157 148 void LpSoplex::_getColCoeffs(int i, ColIterator b) {158 void LpSoplex::_getColCoeffs(int i, ColIterator b) const { 149 159 /// \todo implement 150 160 } … … 155 165 } 156 166 157 LpCplex::Value LpCplex::_getCoeff(int row, int col) 167 LpCplex::Value LpCplex::_getCoeff(int row, int col) const 158 168 { 159 169 LpCplex::Value value; … … 174 184 } 175 185 176 LpCplex::Value LpCplex::_getColLowerBound(int i) 186 LpCplex::Value LpCplex::_getColLowerBound(int i) const 177 187 { 178 188 LpCplex::Value x; … … 192 202 } 193 203 194 LpCplex::Value LpCplex::_getColUpperBound(int i) 204 LpCplex::Value LpCplex::_getColUpperBound(int i) const 195 205 { 196 206 LpCplex::Value x; … … 271 281 // } 272 282 273 void LpCplex::_getRowBounds(int i, Value &lb, Value &ub) 283 void LpCplex::_getRowBounds(int i, Value &lb, Value &ub) const 274 284 { 275 285 char sense; … … 303 313 } 304 314 305 LpCplex::Value LpCplex::_getObjCoeff(int i) 315 LpCplex::Value LpCplex::_getObjCoeff(int i) const 306 316 { 307 317 Value x; … … 368 378 } 369 379 370 LpCplex::Value LpCplex::_getPrimal(int i) 380 LpCplex::Value LpCplex::_getPrimal(int i) const 371 381 { 372 382 Value x; … … 375 385 } 376 386 377 LpCplex::Value LpCplex::_getDual(int i) 387 LpCplex::Value LpCplex::_getDual(int i) const 378 388 { 379 389 Value y; … … 382 392 } 383 393 384 LpCplex::Value LpCplex::_getPrimalValue() 394 LpCplex::Value LpCplex::_getPrimalValue() const 385 395 { 386 396 Value objval; … … 391 401 return objval; 392 402 } 393 bool LpCplex::_isBasicCol(int i) { 403 bool LpCplex::_isBasicCol(int i) const 404 { 394 405 int cstat[CPXgetnumcols(env, lp)]; 395 406 CPXgetbase(env, lp, cstat, NULL); … … 459 470 // Description: Method for linear optimization. 460 471 // Determines which algorithm is used when CPXlpopt() (or "optimize" in the Interactive Optimizer) is called. Currently the behavior of the "Automatic" setting is that CPLEX simply invokes the dual simplex method, but this capability may be expanded in the future so that CPLEX chooses the method based on problem characteristics 461 //Hulye cplex462 472 void statusSwitch(CPXENVptr env,int& stat){ 463 473 #if CPX_VERSION < 900 … … 476 486 } 477 487 478 LpCplex::SolutionStatus LpCplex::_getPrimalStatus() 488 LpCplex::SolutionStatus LpCplex::_getPrimalStatus() const 479 489 { 480 490 //Unboundedness not treated well: the following is from cplex 9.0 doc … … 559 569 // CPX_STAT_UNBOUNDED 560 570 561 LpCplex::SolutionStatus LpCplex::_getDualStatus() 571 LpCplex::SolutionStatus LpCplex::_getDualStatus() const 562 572 { 563 573 int stat = CPXgetstat(env, lp); … … 588 598 } 589 599 590 LpCplex::ProblemTypes LpCplex::_getProblemType() 600 LpCplex::ProblemTypes LpCplex::_getProblemType() const 591 601 { 592 602 int stat = CPXgetstat(env, lp); … … 628 638 } 629 639 630 bool LpCplex::_isMax() 640 bool LpCplex::_isMax() const 631 641 { 632 642 if (CPXgetobjsen(env, lp)==CPX_MAX)
Note: See TracChangeset
for help on using the changeset viewer.