Changeset 623:745e182d0139 in lemon for lemon/cplex.cc
- Timestamp:
- 04/08/09 22:49:28 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/cplex.cc
r598 r623 73 73 int status; 74 74 _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem"); 75 messageLevel(MESSAGE_NOTHING); 75 76 } 76 77 … … 79 80 int status; 80 81 _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem"); 82 messageLevel(MESSAGE_NOTHING); 81 83 } 82 84 … … 87 89 rows = cplex.rows; 88 90 cols = cplex.cols; 91 messageLevel(MESSAGE_NOTHING); 89 92 } 90 93 … … 437 440 rows.clear(); 438 441 cols.clear(); 442 } 443 444 void CplexBase::_messageLevel(MessageLevel level) { 445 switch (level) { 446 case MESSAGE_NOTHING: 447 _message_enabled = false; 448 break; 449 case MESSAGE_ERROR: 450 case MESSAGE_WARNING: 451 case MESSAGE_NORMAL: 452 case MESSAGE_VERBOSE: 453 _message_enabled = true; 454 break; 455 } 456 } 457 458 void CplexBase::_applyMessageLevel() { 459 CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, 460 _message_enabled ? CPX_ON : CPX_OFF); 439 461 } 440 462 … … 508 530 CplexLp::SolveExitStatus CplexLp::_solve() { 509 531 _clear_temporals(); 532 _applyMessageLevel(); 510 533 return convertStatus(CPXlpopt(cplexEnv(), _prob)); 511 534 } … … 513 536 CplexLp::SolveExitStatus CplexLp::solvePrimal() { 514 537 _clear_temporals(); 538 _applyMessageLevel(); 515 539 return convertStatus(CPXprimopt(cplexEnv(), _prob)); 516 540 } … … 518 542 CplexLp::SolveExitStatus CplexLp::solveDual() { 519 543 _clear_temporals(); 544 _applyMessageLevel(); 520 545 return convertStatus(CPXdualopt(cplexEnv(), _prob)); 521 546 } … … 523 548 CplexLp::SolveExitStatus CplexLp::solveBarrier() { 524 549 _clear_temporals(); 550 _applyMessageLevel(); 525 551 return convertStatus(CPXbaropt(cplexEnv(), _prob)); 526 552 } … … 601 627 } 602 628 603 // 7.5-os cplex statusai (Vigyazat: a 9.0-asei masok!)629 // Cplex 7.0 status values 604 630 // This table lists the statuses, returned by the CPXgetstat() 605 631 // routine, for solutions to LP problems or mixed integer problems. If … … 648 674 // User pivot used 649 675 // 650 // Ezeket hova tegyem:676 // Pending return values 651 677 // ??case CPX_ABORT_DUAL_INFEAS 652 678 // ??case CPX_ABORT_CROSSOVER … … 719 745 statusSwitch(cplexEnv(),stat); 720 746 //CPXgetstat(cplexEnv(), _prob); 721 //printf("A primal status: %d, CPX_OPTIMAL=%d \n",stat,CPX_OPTIMAL);722 747 switch (stat) { 723 748 case 0: … … 752 777 } 753 778 754 // 9.0-as cplex verzio statusai779 // Cplex 9.0 status values 755 780 // CPX_STAT_ABORT_DUAL_OBJ_LIM 756 781 // CPX_STAT_ABORT_IT_LIM … … 865 890 CplexMip::SolveExitStatus CplexMip::_solve() { 866 891 int status; 892 _applyMessageLevel(); 867 893 status = CPXmipopt (cplexEnv(), _prob); 868 894 if (status==0)
Note: See TracChangeset
for help on using the changeset viewer.