lemon/cplex.cc
changeset 462 9b082b3fb33f
parent 461 08d495d48089
child 540 9db62975c32b
     1.1 --- a/lemon/cplex.cc	Mon Jan 12 12:26:01 2009 +0000
     1.2 +++ b/lemon/cplex.cc	Mon Jan 12 12:26:02 2009 +0000
     1.3 @@ -438,25 +438,25 @@
     1.4      cols.clear();
     1.5    }
     1.6  
     1.7 -  // LpCplex members
     1.8 +  // CplexLp members
     1.9  
    1.10 -  LpCplex::LpCplex()
    1.11 +  CplexLp::CplexLp()
    1.12      : LpBase(), CplexBase(), LpSolver() {}
    1.13  
    1.14 -  LpCplex::LpCplex(const CplexEnv& env)
    1.15 +  CplexLp::CplexLp(const CplexEnv& env)
    1.16      : LpBase(), CplexBase(env), LpSolver() {}
    1.17  
    1.18 -  LpCplex::LpCplex(const LpCplex& other)
    1.19 +  CplexLp::CplexLp(const CplexLp& other)
    1.20      : LpBase(), CplexBase(other), LpSolver() {}
    1.21  
    1.22 -  LpCplex::~LpCplex() {}
    1.23 +  CplexLp::~CplexLp() {}
    1.24  
    1.25 -  LpCplex* LpCplex::_newSolver() const { return new LpCplex; }
    1.26 -  LpCplex* LpCplex::_cloneSolver() const {return new LpCplex(*this); }
    1.27 +  CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
    1.28 +  CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
    1.29  
    1.30 -  const char* LpCplex::_solverName() const { return "LpCplex"; }
    1.31 +  const char* CplexLp::_solverName() const { return "CplexLp"; }
    1.32  
    1.33 -  void LpCplex::_clear_temporals() {
    1.34 +  void CplexLp::_clear_temporals() {
    1.35      _col_status.clear();
    1.36      _row_status.clear();
    1.37      _primal_ray.clear();
    1.38 @@ -472,7 +472,7 @@
    1.39    // value does not necessarily mean that a solution exists. Use query
    1.40    // routines CPXsolninfo, CPXgetstat, and CPXsolution to obtain
    1.41    // further information about the status of the optimization.
    1.42 -  LpCplex::SolveExitStatus LpCplex::convertStatus(int status) {
    1.43 +  CplexLp::SolveExitStatus CplexLp::convertStatus(int status) {
    1.44  #if CPX_VERSION >= 800
    1.45      if (status == 0) {
    1.46        switch (CPXgetstat(cplexEnv(), _prob)) {
    1.47 @@ -505,45 +505,45 @@
    1.48  #endif
    1.49    }
    1.50  
    1.51 -  LpCplex::SolveExitStatus LpCplex::_solve() {
    1.52 +  CplexLp::SolveExitStatus CplexLp::_solve() {
    1.53      _clear_temporals();
    1.54      return convertStatus(CPXlpopt(cplexEnv(), _prob));
    1.55    }
    1.56  
    1.57 -  LpCplex::SolveExitStatus LpCplex::solvePrimal() {
    1.58 +  CplexLp::SolveExitStatus CplexLp::solvePrimal() {
    1.59      _clear_temporals();
    1.60      return convertStatus(CPXprimopt(cplexEnv(), _prob));
    1.61    }
    1.62  
    1.63 -  LpCplex::SolveExitStatus LpCplex::solveDual() {
    1.64 +  CplexLp::SolveExitStatus CplexLp::solveDual() {
    1.65      _clear_temporals();
    1.66      return convertStatus(CPXdualopt(cplexEnv(), _prob));
    1.67    }
    1.68  
    1.69 -  LpCplex::SolveExitStatus LpCplex::solveBarrier() {
    1.70 +  CplexLp::SolveExitStatus CplexLp::solveBarrier() {
    1.71      _clear_temporals();
    1.72      return convertStatus(CPXbaropt(cplexEnv(), _prob));
    1.73    }
    1.74  
    1.75 -  LpCplex::Value LpCplex::_getPrimal(int i) const {
    1.76 +  CplexLp::Value CplexLp::_getPrimal(int i) const {
    1.77      Value x;
    1.78      CPXgetx(cplexEnv(), _prob, &x, i, i);
    1.79      return x;
    1.80    }
    1.81  
    1.82 -  LpCplex::Value LpCplex::_getDual(int i) const {
    1.83 +  CplexLp::Value CplexLp::_getDual(int i) const {
    1.84      Value y;
    1.85      CPXgetpi(cplexEnv(), _prob, &y, i, i);
    1.86      return y;
    1.87    }
    1.88  
    1.89 -  LpCplex::Value LpCplex::_getPrimalValue() const {
    1.90 +  CplexLp::Value CplexLp::_getPrimalValue() const {
    1.91      Value objval;
    1.92      CPXgetobjval(cplexEnv(), _prob, &objval);
    1.93      return objval;
    1.94    }
    1.95  
    1.96 -  LpCplex::VarStatus LpCplex::_getColStatus(int i) const {
    1.97 +  CplexLp::VarStatus CplexLp::_getColStatus(int i) const {
    1.98      if (_col_status.empty()) {
    1.99        _col_status.resize(CPXgetnumcols(cplexEnv(), _prob));
   1.100        CPXgetbase(cplexEnv(), _prob, &_col_status.front(), 0);
   1.101 @@ -559,11 +559,11 @@
   1.102        return UPPER;
   1.103      default:
   1.104        LEMON_ASSERT(false, "Wrong column status");
   1.105 -      return LpCplex::VarStatus();
   1.106 +      return CplexLp::VarStatus();
   1.107      }
   1.108    }
   1.109  
   1.110 -  LpCplex::VarStatus LpCplex::_getRowStatus(int i) const {
   1.111 +  CplexLp::VarStatus CplexLp::_getRowStatus(int i) const {
   1.112      if (_row_status.empty()) {
   1.113        _row_status.resize(CPXgetnumrows(cplexEnv(), _prob));
   1.114        CPXgetbase(cplexEnv(), _prob, 0, &_row_status.front());
   1.115 @@ -581,11 +581,11 @@
   1.116        return UPPER;
   1.117      default:
   1.118        LEMON_ASSERT(false, "Wrong row status");
   1.119 -      return LpCplex::VarStatus();
   1.120 +      return CplexLp::VarStatus();
   1.121      }
   1.122    }
   1.123  
   1.124 -  LpCplex::Value LpCplex::_getPrimalRay(int i) const {
   1.125 +  CplexLp::Value CplexLp::_getPrimalRay(int i) const {
   1.126      if (_primal_ray.empty()) {
   1.127        _primal_ray.resize(CPXgetnumcols(cplexEnv(), _prob));
   1.128        CPXgetray(cplexEnv(), _prob, &_primal_ray.front());
   1.129 @@ -593,7 +593,7 @@
   1.130      return _primal_ray[i];
   1.131    }
   1.132  
   1.133 -  LpCplex::Value LpCplex::_getDualRay(int i) const {
   1.134 +  CplexLp::Value CplexLp::_getDualRay(int i) const {
   1.135      if (_dual_ray.empty()) {
   1.136  
   1.137      }
   1.138 @@ -686,7 +686,7 @@
   1.139    void statusSwitch(CPXENVptr,int&){}
   1.140  #endif
   1.141  
   1.142 -  LpCplex::ProblemType LpCplex::_getPrimalType() const {
   1.143 +  CplexLp::ProblemType CplexLp::_getPrimalType() const {
   1.144      // Unboundedness not treated well: the following is from cplex 9.0 doc
   1.145      // About Unboundedness
   1.146  
   1.147 @@ -768,7 +768,7 @@
   1.148    // CPX_STAT_OPTIMAL_RELAXED
   1.149    // CPX_STAT_UNBOUNDED
   1.150  
   1.151 -  LpCplex::ProblemType LpCplex::_getDualType() const {
   1.152 +  CplexLp::ProblemType CplexLp::_getDualType() const {
   1.153      int stat = CPXgetstat(cplexEnv(), _prob);
   1.154  #if CPX_VERSION >= 800
   1.155      switch (stat) {
   1.156 @@ -795,9 +795,9 @@
   1.157  #endif
   1.158    }
   1.159  
   1.160 -  // MipCplex members
   1.161 +  // CplexMip members
   1.162  
   1.163 -  MipCplex::MipCplex()
   1.164 +  CplexMip::CplexMip()
   1.165      : LpBase(), CplexBase(), MipSolver() {
   1.166  
   1.167  #if CPX_VERSION < 800
   1.168 @@ -807,7 +807,7 @@
   1.169  #endif
   1.170    }
   1.171  
   1.172 -  MipCplex::MipCplex(const CplexEnv& env)
   1.173 +  CplexMip::CplexMip(const CplexEnv& env)
   1.174      : LpBase(), CplexBase(env), MipSolver() {
   1.175  
   1.176  #if CPX_VERSION < 800
   1.177 @@ -818,17 +818,17 @@
   1.178  
   1.179    }
   1.180  
   1.181 -  MipCplex::MipCplex(const MipCplex& other)
   1.182 +  CplexMip::CplexMip(const CplexMip& other)
   1.183      : LpBase(), CplexBase(other), MipSolver() {}
   1.184  
   1.185 -  MipCplex::~MipCplex() {}
   1.186 +  CplexMip::~CplexMip() {}
   1.187  
   1.188 -  MipCplex* MipCplex::_newSolver() const { return new MipCplex; }
   1.189 -  MipCplex* MipCplex::_cloneSolver() const {return new MipCplex(*this); }
   1.190 +  CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
   1.191 +  CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
   1.192  
   1.193 -  const char* MipCplex::_solverName() const { return "MipCplex"; }
   1.194 +  const char* CplexMip::_solverName() const { return "CplexMip"; }
   1.195  
   1.196 -  void MipCplex::_setColType(int i, MipCplex::ColTypes col_type) {
   1.197 +  void CplexMip::_setColType(int i, CplexMip::ColTypes col_type) {
   1.198  
   1.199      // Note If a variable is to be changed to binary, a call to CPXchgbds
   1.200      // should also be made to change the bounds to 0 and 1.
   1.201 @@ -847,7 +847,7 @@
   1.202      }
   1.203    }
   1.204  
   1.205 -  MipCplex::ColTypes MipCplex::_getColType(int i) const {
   1.206 +  CplexMip::ColTypes CplexMip::_getColType(int i) const {
   1.207      char t;
   1.208      CPXgetctype (cplexEnv(), _prob, &t, i, i);
   1.209      switch (t) {
   1.210 @@ -862,7 +862,7 @@
   1.211  
   1.212    }
   1.213  
   1.214 -  MipCplex::SolveExitStatus MipCplex::_solve() {
   1.215 +  CplexMip::SolveExitStatus CplexMip::_solve() {
   1.216      int status;
   1.217      status = CPXmipopt (cplexEnv(), _prob);
   1.218      if (status==0)
   1.219 @@ -873,7 +873,7 @@
   1.220    }
   1.221  
   1.222  
   1.223 -  MipCplex::ProblemType MipCplex::_getType() const {
   1.224 +  CplexMip::ProblemType CplexMip::_getType() const {
   1.225  
   1.226      int stat = CPXgetstat(cplexEnv(), _prob);
   1.227  
   1.228 @@ -909,13 +909,13 @@
   1.229      // has a feasible solution.
   1.230    }
   1.231  
   1.232 -  MipCplex::Value MipCplex::_getSol(int i) const {
   1.233 +  CplexMip::Value CplexMip::_getSol(int i) const {
   1.234      Value x;
   1.235      CPXgetmipx(cplexEnv(), _prob, &x, i, i);
   1.236      return x;
   1.237    }
   1.238  
   1.239 -  MipCplex::Value MipCplex::_getSolValue() const {
   1.240 +  CplexMip::Value CplexMip::_getSolValue() const {
   1.241      Value objval;
   1.242      CPXgetmipobjval(cplexEnv(), _prob, &objval);
   1.243      return objval;