COIN-OR::LEMON - Graph Library

Changeset 462:9b082b3fb33f in lemon-1.2 for lemon/cplex.cc


Ignore:
Timestamp:
01/12/09 13:26:02 (15 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Rename Lp*/Mip* to *Lp/*Mip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/cplex.cc

    r461 r462  
    439439  }
    440440
    441   // LpCplex members
    442 
    443   LpCplex::LpCplex()
     441  // CplexLp members
     442
     443  CplexLp::CplexLp()
    444444    : LpBase(), CplexBase(), LpSolver() {}
    445445
    446   LpCplex::LpCplex(const CplexEnv& env)
     446  CplexLp::CplexLp(const CplexEnv& env)
    447447    : LpBase(), CplexBase(env), LpSolver() {}
    448448
    449   LpCplex::LpCplex(const LpCplex& other)
     449  CplexLp::CplexLp(const CplexLp& other)
    450450    : LpBase(), CplexBase(other), LpSolver() {}
    451451
    452   LpCplex::~LpCplex() {}
    453 
    454   LpCplex* LpCplex::_newSolver() const { return new LpCplex; }
    455   LpCplex* LpCplex::_cloneSolver() const {return new LpCplex(*this); }
    456 
    457   const char* LpCplex::_solverName() const { return "LpCplex"; }
    458 
    459   void LpCplex::_clear_temporals() {
     452  CplexLp::~CplexLp() {}
     453
     454  CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
     455  CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
     456
     457  const char* CplexLp::_solverName() const { return "CplexLp"; }
     458
     459  void CplexLp::_clear_temporals() {
    460460    _col_status.clear();
    461461    _row_status.clear();
     
    473473  // routines CPXsolninfo, CPXgetstat, and CPXsolution to obtain
    474474  // further information about the status of the optimization.
    475   LpCplex::SolveExitStatus LpCplex::convertStatus(int status) {
     475  CplexLp::SolveExitStatus CplexLp::convertStatus(int status) {
    476476#if CPX_VERSION >= 800
    477477    if (status == 0) {
     
    506506  }
    507507
    508   LpCplex::SolveExitStatus LpCplex::_solve() {
     508  CplexLp::SolveExitStatus CplexLp::_solve() {
    509509    _clear_temporals();
    510510    return convertStatus(CPXlpopt(cplexEnv(), _prob));
    511511  }
    512512
    513   LpCplex::SolveExitStatus LpCplex::solvePrimal() {
     513  CplexLp::SolveExitStatus CplexLp::solvePrimal() {
    514514    _clear_temporals();
    515515    return convertStatus(CPXprimopt(cplexEnv(), _prob));
    516516  }
    517517
    518   LpCplex::SolveExitStatus LpCplex::solveDual() {
     518  CplexLp::SolveExitStatus CplexLp::solveDual() {
    519519    _clear_temporals();
    520520    return convertStatus(CPXdualopt(cplexEnv(), _prob));
    521521  }
    522522
    523   LpCplex::SolveExitStatus LpCplex::solveBarrier() {
     523  CplexLp::SolveExitStatus CplexLp::solveBarrier() {
    524524    _clear_temporals();
    525525    return convertStatus(CPXbaropt(cplexEnv(), _prob));
    526526  }
    527527
    528   LpCplex::Value LpCplex::_getPrimal(int i) const {
     528  CplexLp::Value CplexLp::_getPrimal(int i) const {
    529529    Value x;
    530530    CPXgetx(cplexEnv(), _prob, &x, i, i);
     
    532532  }
    533533
    534   LpCplex::Value LpCplex::_getDual(int i) const {
     534  CplexLp::Value CplexLp::_getDual(int i) const {
    535535    Value y;
    536536    CPXgetpi(cplexEnv(), _prob, &y, i, i);
     
    538538  }
    539539
    540   LpCplex::Value LpCplex::_getPrimalValue() const {
     540  CplexLp::Value CplexLp::_getPrimalValue() const {
    541541    Value objval;
    542542    CPXgetobjval(cplexEnv(), _prob, &objval);
     
    544544  }
    545545
    546   LpCplex::VarStatus LpCplex::_getColStatus(int i) const {
     546  CplexLp::VarStatus CplexLp::_getColStatus(int i) const {
    547547    if (_col_status.empty()) {
    548548      _col_status.resize(CPXgetnumcols(cplexEnv(), _prob));
     
    560560    default:
    561561      LEMON_ASSERT(false, "Wrong column status");
    562       return LpCplex::VarStatus();
    563     }
    564   }
    565 
    566   LpCplex::VarStatus LpCplex::_getRowStatus(int i) const {
     562      return CplexLp::VarStatus();
     563    }
     564  }
     565
     566  CplexLp::VarStatus CplexLp::_getRowStatus(int i) const {
    567567    if (_row_status.empty()) {
    568568      _row_status.resize(CPXgetnumrows(cplexEnv(), _prob));
     
    582582    default:
    583583      LEMON_ASSERT(false, "Wrong row status");
    584       return LpCplex::VarStatus();
    585     }
    586   }
    587 
    588   LpCplex::Value LpCplex::_getPrimalRay(int i) const {
     584      return CplexLp::VarStatus();
     585    }
     586  }
     587
     588  CplexLp::Value CplexLp::_getPrimalRay(int i) const {
    589589    if (_primal_ray.empty()) {
    590590      _primal_ray.resize(CPXgetnumcols(cplexEnv(), _prob));
     
    594594  }
    595595
    596   LpCplex::Value LpCplex::_getDualRay(int i) const {
     596  CplexLp::Value CplexLp::_getDualRay(int i) const {
    597597    if (_dual_ray.empty()) {
    598598
     
    687687#endif
    688688
    689   LpCplex::ProblemType LpCplex::_getPrimalType() const {
     689  CplexLp::ProblemType CplexLp::_getPrimalType() const {
    690690    // Unboundedness not treated well: the following is from cplex 9.0 doc
    691691    // About Unboundedness
     
    769769  // CPX_STAT_UNBOUNDED
    770770
    771   LpCplex::ProblemType LpCplex::_getDualType() const {
     771  CplexLp::ProblemType CplexLp::_getDualType() const {
    772772    int stat = CPXgetstat(cplexEnv(), _prob);
    773773#if CPX_VERSION >= 800
     
    796796  }
    797797
    798   // MipCplex members
    799 
    800   MipCplex::MipCplex()
     798  // CplexMip members
     799
     800  CplexMip::CplexMip()
    801801    : LpBase(), CplexBase(), MipSolver() {
    802802
     
    808808  }
    809809
    810   MipCplex::MipCplex(const CplexEnv& env)
     810  CplexMip::CplexMip(const CplexEnv& env)
    811811    : LpBase(), CplexBase(env), MipSolver() {
    812812
     
    819819  }
    820820
    821   MipCplex::MipCplex(const MipCplex& other)
     821  CplexMip::CplexMip(const CplexMip& other)
    822822    : LpBase(), CplexBase(other), MipSolver() {}
    823823
    824   MipCplex::~MipCplex() {}
    825 
    826   MipCplex* MipCplex::_newSolver() const { return new MipCplex; }
    827   MipCplex* MipCplex::_cloneSolver() const {return new MipCplex(*this); }
    828 
    829   const char* MipCplex::_solverName() const { return "MipCplex"; }
    830 
    831   void MipCplex::_setColType(int i, MipCplex::ColTypes col_type) {
     824  CplexMip::~CplexMip() {}
     825
     826  CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
     827  CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
     828
     829  const char* CplexMip::_solverName() const { return "CplexMip"; }
     830
     831  void CplexMip::_setColType(int i, CplexMip::ColTypes col_type) {
    832832
    833833    // Note If a variable is to be changed to binary, a call to CPXchgbds
     
    848848  }
    849849
    850   MipCplex::ColTypes MipCplex::_getColType(int i) const {
     850  CplexMip::ColTypes CplexMip::_getColType(int i) const {
    851851    char t;
    852852    CPXgetctype (cplexEnv(), _prob, &t, i, i);
     
    863863  }
    864864
    865   MipCplex::SolveExitStatus MipCplex::_solve() {
     865  CplexMip::SolveExitStatus CplexMip::_solve() {
    866866    int status;
    867867    status = CPXmipopt (cplexEnv(), _prob);
     
    874874
    875875
    876   MipCplex::ProblemType MipCplex::_getType() const {
     876  CplexMip::ProblemType CplexMip::_getType() const {
    877877
    878878    int stat = CPXgetstat(cplexEnv(), _prob);
     
    910910  }
    911911
    912   MipCplex::Value MipCplex::_getSol(int i) const {
     912  CplexMip::Value CplexMip::_getSol(int i) const {
    913913    Value x;
    914914    CPXgetmipx(cplexEnv(), _prob, &x, i, i);
     
    916916  }
    917917
    918   MipCplex::Value MipCplex::_getSolValue() const {
     918  CplexMip::Value CplexMip::_getSolValue() const {
    919919    Value objval;
    920920    CPXgetmipobjval(cplexEnv(), _prob, &objval);
Note: See TracChangeset for help on using the changeset viewer.