COIN-OR::LEMON - Graph Library

Changeset 462:9b082b3fb33f in lemon-1.2


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

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

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • lemon/clp.cc

    r461 r462  
    2222namespace lemon {
    2323
    24   LpClp::LpClp() {
     24  ClpLp::ClpLp() {
    2525    _prob = new ClpSimplex();
    2626    _init_temporals();
     
    2828  }
    2929
    30   LpClp::LpClp(const LpClp& other) {
     30  ClpLp::ClpLp(const ClpLp& other) {
    3131    _prob = new ClpSimplex(*other._prob);
    3232    rows = other.rows;
     
    3636  }
    3737
    38   LpClp::~LpClp() {
     38  ClpLp::~ClpLp() {
    3939    delete _prob;
    4040    _clear_temporals();
    4141  }
    4242
    43   void LpClp::_init_temporals() {
     43  void ClpLp::_init_temporals() {
    4444    _primal_ray = 0;
    4545    _dual_ray = 0;
    4646  }
    4747
    48   void LpClp::_clear_temporals() {
     48  void ClpLp::_clear_temporals() {
    4949    if (_primal_ray) {
    5050      delete[] _primal_ray;
     
    5757  }
    5858
    59   LpClp* LpClp::_newSolver() const {
    60     LpClp* newlp = new LpClp;
     59  ClpLp* ClpLp::_newSolver() const {
     60    ClpLp* newlp = new ClpLp;
    6161    return newlp;
    6262  }
    6363
    64   LpClp* LpClp::_cloneSolver() const {
    65     LpClp* copylp = new LpClp(*this);
     64  ClpLp* ClpLp::_cloneSolver() const {
     65    ClpLp* copylp = new ClpLp(*this);
    6666    return copylp;
    6767  }
    6868
    69   const char* LpClp::_solverName() const { return "LpClp"; }
    70 
    71   int LpClp::_addCol() {
     69  const char* ClpLp::_solverName() const { return "ClpLp"; }
     70
     71  int ClpLp::_addCol() {
    7272    _prob->addColumn(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX, 0.0);
    7373    return _prob->numberColumns() - 1;
    7474  }
    7575
    76   int LpClp::_addRow() {
     76  int ClpLp::_addRow() {
    7777    _prob->addRow(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX);
    7878    return _prob->numberRows() - 1;
     
    8080
    8181
    82   void LpClp::_eraseCol(int c) {
     82  void ClpLp::_eraseCol(int c) {
    8383    _col_names_ref.erase(_prob->getColumnName(c));
    8484    _prob->deleteColumns(1, &c);
    8585  }
    8686
    87   void LpClp::_eraseRow(int r) {
     87  void ClpLp::_eraseRow(int r) {
    8888    _row_names_ref.erase(_prob->getRowName(r));
    8989    _prob->deleteRows(1, &r);
    9090  }
    9191
    92   void LpClp::_eraseColId(int i) {
     92  void ClpLp::_eraseColId(int i) {
    9393    cols.eraseIndex(i);
    9494    cols.shiftIndices(i);
    9595  }
    9696
    97   void LpClp::_eraseRowId(int i) {
     97  void ClpLp::_eraseRowId(int i) {
    9898    rows.eraseIndex(i);
    9999    rows.shiftIndices(i);
    100100  }
    101101
    102   void LpClp::_getColName(int c, std::string& name) const {
     102  void ClpLp::_getColName(int c, std::string& name) const {
    103103    name = _prob->getColumnName(c);
    104104  }
    105105
    106   void LpClp::_setColName(int c, const std::string& name) {
     106  void ClpLp::_setColName(int c, const std::string& name) {
    107107    _prob->setColumnName(c, const_cast<std::string&>(name));
    108108    _col_names_ref[name] = c;
    109109  }
    110110
    111   int LpClp::_colByName(const std::string& name) const {
     111  int ClpLp::_colByName(const std::string& name) const {
    112112    std::map<std::string, int>::const_iterator it = _col_names_ref.find(name);
    113113    return it != _col_names_ref.end() ? it->second : -1;
    114114  }
    115115
    116   void LpClp::_getRowName(int r, std::string& name) const {
     116  void ClpLp::_getRowName(int r, std::string& name) const {
    117117    name = _prob->getRowName(r);
    118118  }
    119119
    120   void LpClp::_setRowName(int r, const std::string& name) {
     120  void ClpLp::_setRowName(int r, const std::string& name) {
    121121    _prob->setRowName(r, const_cast<std::string&>(name));
    122122    _row_names_ref[name] = r;
    123123  }
    124124
    125   int LpClp::_rowByName(const std::string& name) const {
     125  int ClpLp::_rowByName(const std::string& name) const {
    126126    std::map<std::string, int>::const_iterator it = _row_names_ref.find(name);
    127127    return it != _row_names_ref.end() ? it->second : -1;
     
    129129
    130130
    131   void LpClp::_setRowCoeffs(int ix, ExprIterator b, ExprIterator e) {
     131  void ClpLp::_setRowCoeffs(int ix, ExprIterator b, ExprIterator e) {
    132132    std::map<int, Value> coeffs;
    133133
     
    157157  }
    158158
    159   void LpClp::_getRowCoeffs(int ix, InsertIterator b) const {
     159  void ClpLp::_getRowCoeffs(int ix, InsertIterator b) const {
    160160    int n = _prob->clpMatrix()->getNumCols();
    161161
     
    174174  }
    175175
    176   void LpClp::_setColCoeffs(int ix, ExprIterator b, ExprIterator e) {
     176  void ClpLp::_setColCoeffs(int ix, ExprIterator b, ExprIterator e) {
    177177    std::map<int, Value> coeffs;
    178178
     
    197197  }
    198198
    199   void LpClp::_getColCoeffs(int ix, InsertIterator b) const {
     199  void ClpLp::_getColCoeffs(int ix, InsertIterator b) const {
    200200    CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix];
    201201    CoinBigIndex end = begin + _prob->clpMatrix()->getVectorLengths()[ix];
     
    210210  }
    211211
    212   void LpClp::_setCoeff(int ix, int jx, Value value) {
     212  void ClpLp::_setCoeff(int ix, int jx, Value value) {
    213213    _prob->modifyCoefficient(ix, jx, value);
    214214  }
    215215
    216   LpClp::Value LpClp::_getCoeff(int ix, int jx) const {
     216  ClpLp::Value ClpLp::_getCoeff(int ix, int jx) const {
    217217    CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix];
    218218    CoinBigIndex end = begin + _prob->clpMatrix()->getVectorLengths()[ix];
     
    229229  }
    230230
    231   void LpClp::_setColLowerBound(int i, Value lo) {
     231  void ClpLp::_setColLowerBound(int i, Value lo) {
    232232    _prob->setColumnLower(i, lo == - INF ? - COIN_DBL_MAX : lo);
    233233  }
    234234
    235   LpClp::Value LpClp::_getColLowerBound(int i) const {
     235  ClpLp::Value ClpLp::_getColLowerBound(int i) const {
    236236    double val = _prob->getColLower()[i];
    237237    return val == - COIN_DBL_MAX ? - INF : val;
    238238  }
    239239
    240   void LpClp::_setColUpperBound(int i, Value up) {
     240  void ClpLp::_setColUpperBound(int i, Value up) {
    241241    _prob->setColumnUpper(i, up == INF ? COIN_DBL_MAX : up);
    242242  }
    243243
    244   LpClp::Value LpClp::_getColUpperBound(int i) const {
     244  ClpLp::Value ClpLp::_getColUpperBound(int i) const {
    245245    double val = _prob->getColUpper()[i];
    246246    return val == COIN_DBL_MAX ? INF : val;
    247247  }
    248248
    249   void LpClp::_setRowLowerBound(int i, Value lo) {
     249  void ClpLp::_setRowLowerBound(int i, Value lo) {
    250250    _prob->setRowLower(i, lo == - INF ? - COIN_DBL_MAX : lo);
    251251  }
    252252
    253   LpClp::Value LpClp::_getRowLowerBound(int i) const {
     253  ClpLp::Value ClpLp::_getRowLowerBound(int i) const {
    254254    double val = _prob->getRowLower()[i];
    255255    return val == - COIN_DBL_MAX ? - INF : val;
    256256  }
    257257
    258   void LpClp::_setRowUpperBound(int i, Value up) {
     258  void ClpLp::_setRowUpperBound(int i, Value up) {
    259259    _prob->setRowUpper(i, up == INF ? COIN_DBL_MAX : up);
    260260  }
    261261
    262   LpClp::Value LpClp::_getRowUpperBound(int i) const {
     262  ClpLp::Value ClpLp::_getRowUpperBound(int i) const {
    263263    double val = _prob->getRowUpper()[i];
    264264    return val == COIN_DBL_MAX ? INF : val;
    265265  }
    266266
    267   void LpClp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
     267  void ClpLp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
    268268    int num = _prob->clpMatrix()->getNumCols();
    269269    for (int i = 0; i < num; ++i) {
     
    275275  }
    276276
    277   void LpClp::_getObjCoeffs(InsertIterator b) const {
     277  void ClpLp::_getObjCoeffs(InsertIterator b) const {
    278278    int num = _prob->clpMatrix()->getNumCols();
    279279    for (int i = 0; i < num; ++i) {
     
    286286  }
    287287
    288   void LpClp::_setObjCoeff(int i, Value obj_coef) {
     288  void ClpLp::_setObjCoeff(int i, Value obj_coef) {
    289289    _prob->setObjectiveCoefficient(i, obj_coef);
    290290  }
    291291
    292   LpClp::Value LpClp::_getObjCoeff(int i) const {
     292  ClpLp::Value ClpLp::_getObjCoeff(int i) const {
    293293    return _prob->getObjCoefficients()[i];
    294294  }
    295295
    296   LpClp::SolveExitStatus LpClp::_solve() {
     296  ClpLp::SolveExitStatus ClpLp::_solve() {
    297297    return _prob->primal() >= 0 ? SOLVED : UNSOLVED;
    298298  }
    299299
    300   LpClp::SolveExitStatus LpClp::solvePrimal() {
     300  ClpLp::SolveExitStatus ClpLp::solvePrimal() {
    301301    return _prob->primal() >= 0 ? SOLVED : UNSOLVED;
    302302  }
    303303
    304   LpClp::SolveExitStatus LpClp::solveDual() {
     304  ClpLp::SolveExitStatus ClpLp::solveDual() {
    305305    return _prob->dual() >= 0 ? SOLVED : UNSOLVED;
    306306  }
    307307
    308   LpClp::SolveExitStatus LpClp::solveBarrier() {
     308  ClpLp::SolveExitStatus ClpLp::solveBarrier() {
    309309    return _prob->barrier() >= 0 ? SOLVED : UNSOLVED;
    310310  }
    311311
    312   LpClp::Value LpClp::_getPrimal(int i) const {
     312  ClpLp::Value ClpLp::_getPrimal(int i) const {
    313313    return _prob->primalColumnSolution()[i];
    314314  }
    315   LpClp::Value LpClp::_getPrimalValue() const {
     315  ClpLp::Value ClpLp::_getPrimalValue() const {
    316316    return _prob->objectiveValue();
    317317  }
    318318
    319   LpClp::Value LpClp::_getDual(int i) const {
     319  ClpLp::Value ClpLp::_getDual(int i) const {
    320320    return _prob->dualRowSolution()[i];
    321321  }
    322322
    323   LpClp::Value LpClp::_getPrimalRay(int i) const {
     323  ClpLp::Value ClpLp::_getPrimalRay(int i) const {
    324324    if (!_primal_ray) {
    325325      _primal_ray = _prob->unboundedRay();
     
    329329  }
    330330
    331   LpClp::Value LpClp::_getDualRay(int i) const {
     331  ClpLp::Value ClpLp::_getDualRay(int i) const {
    332332    if (!_dual_ray) {
    333333      _dual_ray = _prob->infeasibilityRay();
     
    337337  }
    338338
    339   LpClp::VarStatus LpClp::_getColStatus(int i) const {
     339  ClpLp::VarStatus ClpLp::_getColStatus(int i) const {
    340340    switch (_prob->getColumnStatus(i)) {
    341341    case ClpSimplex::basic:
     
    357357  }
    358358
    359   LpClp::VarStatus LpClp::_getRowStatus(int i) const {
     359  ClpLp::VarStatus ClpLp::_getRowStatus(int i) const {
    360360    switch (_prob->getColumnStatus(i)) {
    361361    case ClpSimplex::basic:
     
    378378
    379379
    380   LpClp::ProblemType LpClp::_getPrimalType() const {
     380  ClpLp::ProblemType ClpLp::_getPrimalType() const {
    381381    if (_prob->isProvenOptimal()) {
    382382      return OPTIMAL;
     
    390390  }
    391391
    392   LpClp::ProblemType LpClp::_getDualType() const {
     392  ClpLp::ProblemType ClpLp::_getDualType() const {
    393393    if (_prob->isProvenOptimal()) {
    394394      return OPTIMAL;
     
    402402  }
    403403
    404   void LpClp::_setSense(LpClp::Sense sense) {
     404  void ClpLp::_setSense(ClpLp::Sense sense) {
    405405    switch (sense) {
    406406    case MIN:
     
    413413  }
    414414
    415   LpClp::Sense LpClp::_getSense() const {
     415  ClpLp::Sense ClpLp::_getSense() const {
    416416    double dir = _prob->optimizationDirection();
    417417    if (dir > 0.0) {
     
    422422  }
    423423
    424   void LpClp::_clear() {
     424  void ClpLp::_clear() {
    425425    delete _prob;
    426426    _prob = new ClpSimplex();
     
    431431  }
    432432
    433   void LpClp::messageLevel(MessageLevel m) {
     433  void ClpLp::messageLevel(MessageLevel m) {
    434434    _prob->setLogLevel(static_cast<int>(m));
    435435  }
  • lemon/clp.h

    r461 r462  
    4040  /// the IBM. The CLP is part of the COIN-OR package and it can be
    4141  /// used with Common Public License.
    42   class LpClp : public LpSolver {
     42  class ClpLp : public LpSolver {
    4343  protected:
    4444
     
    5151
    5252    /// \e
    53     LpClp();
     53    ClpLp();
    5454    /// \e
    55     LpClp(const LpClp&);
     55    ClpLp(const ClpLp&);
    5656    /// \e
    57     ~LpClp();
     57    ~ClpLp();
    5858
    5959  protected:
     
    6767  protected:
    6868
    69     virtual LpClp* _newSolver() const;
    70     virtual LpClp* _cloneSolver() const;
     69    virtual ClpLp* _newSolver() const;
     70    virtual ClpLp* _cloneSolver() const;
    7171
    7272    virtual const char* _solverName() const;
  • 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);
  • lemon/cplex.h

    r461 r462  
    161161  /// This class implements an interface for the CPLEX LP solver.
    162162  ///\ingroup lp_group
    163   class LpCplex : public CplexBase, public LpSolver {
    164   public:
    165     /// \e
    166     LpCplex();
    167     /// \e
    168     LpCplex(const CplexEnv&);
    169     /// \e
    170     LpCplex(const LpCplex&);
    171     /// \e
    172     virtual ~LpCplex();
     163  class CplexLp : public CplexBase, public LpSolver {
     164  public:
     165    /// \e
     166    CplexLp();
     167    /// \e
     168    CplexLp(const CplexEnv&);
     169    /// \e
     170    CplexLp(const CplexLp&);
     171    /// \e
     172    virtual ~CplexLp();
    173173
    174174  private:
     
    187187  protected:
    188188
    189     virtual LpCplex* _cloneSolver() const;
    190     virtual LpCplex* _newSolver() const;
     189    virtual CplexLp* _cloneSolver() const;
     190    virtual CplexLp* _newSolver() const;
    191191
    192192    virtual const char* _solverName() const;
     
    223223  /// This class implements an interface for the CPLEX MIP solver.
    224224  ///\ingroup lp_group
    225   class MipCplex : public CplexBase, public MipSolver {
    226   public:
    227     /// \e
    228     MipCplex();
    229     /// \e
    230     MipCplex(const CplexEnv&);
    231     /// \e
    232     MipCplex(const MipCplex&);
    233     /// \e
    234     virtual ~MipCplex();
    235 
    236   protected:
    237 
    238     virtual MipCplex* _cloneSolver() const;
    239     virtual MipCplex* _newSolver() const;
     225  class CplexMip : public CplexBase, public MipSolver {
     226  public:
     227    /// \e
     228    CplexMip();
     229    /// \e
     230    CplexMip(const CplexEnv&);
     231    /// \e
     232    CplexMip(const CplexMip&);
     233    /// \e
     234    virtual ~CplexMip();
     235
     236  protected:
     237
     238    virtual CplexMip* _cloneSolver() const;
     239    virtual CplexMip* _newSolver() const;
    240240
    241241    virtual const char* _solverName() const;
  • lemon/glpk.cc

    r461 r462  
    523523  }
    524524
    525   // LpGlpk members
    526 
    527   LpGlpk::LpGlpk()
     525  // GlpkLp members
     526
     527  GlpkLp::GlpkLp()
    528528    : LpBase(), GlpkBase(), LpSolver() {
    529529    messageLevel(MESSAGE_NO_OUTPUT);
    530530  }
    531531
    532   LpGlpk::LpGlpk(const LpGlpk& other)
     532  GlpkLp::GlpkLp(const GlpkLp& other)
    533533    : LpBase(other), GlpkBase(other), LpSolver(other) {
    534534    messageLevel(MESSAGE_NO_OUTPUT);
    535535  }
    536536
    537   LpGlpk* LpGlpk::_newSolver() const { return new LpGlpk; }
    538   LpGlpk* LpGlpk::_cloneSolver() const { return new LpGlpk(*this); }
    539 
    540   const char* LpGlpk::_solverName() const { return "LpGlpk"; }
    541 
    542   void LpGlpk::_clear_temporals() {
     537  GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
     538  GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
     539
     540  const char* GlpkLp::_solverName() const { return "GlpkLp"; }
     541
     542  void GlpkLp::_clear_temporals() {
    543543    _primal_ray.clear();
    544544    _dual_ray.clear();
    545545  }
    546546
    547   LpGlpk::SolveExitStatus LpGlpk::_solve() {
     547  GlpkLp::SolveExitStatus GlpkLp::_solve() {
    548548    return solvePrimal();
    549549  }
    550550
    551   LpGlpk::SolveExitStatus LpGlpk::solvePrimal() {
     551  GlpkLp::SolveExitStatus GlpkLp::solvePrimal() {
    552552    _clear_temporals();
    553553
     
    574574  }
    575575
    576   LpGlpk::SolveExitStatus LpGlpk::solveDual() {
     576  GlpkLp::SolveExitStatus GlpkLp::solveDual() {
    577577    _clear_temporals();
    578578
     
    600600  }
    601601
    602   LpGlpk::Value LpGlpk::_getPrimal(int i) const {
     602  GlpkLp::Value GlpkLp::_getPrimal(int i) const {
    603603    return glp_get_col_prim(lp, i);
    604604  }
    605605
    606   LpGlpk::Value LpGlpk::_getDual(int i) const {
     606  GlpkLp::Value GlpkLp::_getDual(int i) const {
    607607    return glp_get_row_dual(lp, i);
    608608  }
    609609
    610   LpGlpk::Value LpGlpk::_getPrimalValue() const {
     610  GlpkLp::Value GlpkLp::_getPrimalValue() const {
    611611    return glp_get_obj_val(lp);
    612612  }
    613613
    614   LpGlpk::VarStatus LpGlpk::_getColStatus(int i) const {
     614  GlpkLp::VarStatus GlpkLp::_getColStatus(int i) const {
    615615    switch (glp_get_col_stat(lp, i)) {
    616616    case GLP_BS:
     
    626626    default:
    627627      LEMON_ASSERT(false, "Wrong column status");
    628       return LpGlpk::VarStatus();
    629     }
    630   }
    631 
    632   LpGlpk::VarStatus LpGlpk::_getRowStatus(int i) const {
     628      return GlpkLp::VarStatus();
     629    }
     630  }
     631
     632  GlpkLp::VarStatus GlpkLp::_getRowStatus(int i) const {
    633633    switch (glp_get_row_stat(lp, i)) {
    634634    case GLP_BS:
     
    644644    default:
    645645      LEMON_ASSERT(false, "Wrong row status");
    646       return LpGlpk::VarStatus();
    647     }
    648   }
    649 
    650   LpGlpk::Value LpGlpk::_getPrimalRay(int i) const {
     646      return GlpkLp::VarStatus();
     647    }
     648  }
     649
     650  GlpkLp::Value GlpkLp::_getPrimalRay(int i) const {
    651651    if (_primal_ray.empty()) {
    652652      int row_num = glp_get_num_rows(lp);
     
    700700  }
    701701
    702   LpGlpk::Value LpGlpk::_getDualRay(int i) const {
     702  GlpkLp::Value GlpkLp::_getDualRay(int i) const {
    703703    if (_dual_ray.empty()) {
    704704      int row_num = glp_get_num_rows(lp);
     
    772772  }
    773773
    774   LpGlpk::ProblemType LpGlpk::_getPrimalType() const {
     774  GlpkLp::ProblemType GlpkLp::_getPrimalType() const {
    775775    if (glp_get_status(lp) == GLP_OPT)
    776776      return OPTIMAL;
     
    789789    default:
    790790      LEMON_ASSERT(false, "Wrong primal type");
    791       return  LpGlpk::ProblemType();
    792     }
    793   }
    794 
    795   LpGlpk::ProblemType LpGlpk::_getDualType() const {
     791      return  GlpkLp::ProblemType();
     792    }
     793  }
     794
     795  GlpkLp::ProblemType GlpkLp::_getDualType() const {
    796796    if (glp_get_status(lp) == GLP_OPT)
    797797      return OPTIMAL;
     
    810810    default:
    811811      LEMON_ASSERT(false, "Wrong primal type");
    812       return  LpGlpk::ProblemType();
    813     }
    814   }
    815 
    816   void LpGlpk::presolver(bool b) {
     812      return  GlpkLp::ProblemType();
     813    }
     814  }
     815
     816  void GlpkLp::presolver(bool b) {
    817817    lpx_set_int_parm(lp, LPX_K_PRESOL, b ? 1 : 0);
    818818  }
    819819
    820   void LpGlpk::messageLevel(MessageLevel m) {
     820  void GlpkLp::messageLevel(MessageLevel m) {
    821821    _message_level = m;
    822822  }
    823823
    824   // MipGlpk members
    825 
    826   MipGlpk::MipGlpk()
     824  // GlpkMip members
     825
     826  GlpkMip::GlpkMip()
    827827    : LpBase(), GlpkBase(), MipSolver() {
    828828    messageLevel(MESSAGE_NO_OUTPUT);
    829829  }
    830830
    831   MipGlpk::MipGlpk(const MipGlpk& other)
     831  GlpkMip::GlpkMip(const GlpkMip& other)
    832832    : LpBase(), GlpkBase(other), MipSolver() {
    833833    messageLevel(MESSAGE_NO_OUTPUT);
    834834  }
    835835
    836   void MipGlpk::_setColType(int i, MipGlpk::ColTypes col_type) {
     836  void GlpkMip::_setColType(int i, GlpkMip::ColTypes col_type) {
    837837    switch (col_type) {
    838838    case INTEGER:
     
    845845  }
    846846
    847   MipGlpk::ColTypes MipGlpk::_getColType(int i) const {
     847  GlpkMip::ColTypes GlpkMip::_getColType(int i) const {
    848848    switch (glp_get_col_kind(lp, i)) {
    849849    case GLP_IV:
     
    856856  }
    857857
    858   MipGlpk::SolveExitStatus MipGlpk::_solve() {
     858  GlpkMip::SolveExitStatus GlpkMip::_solve() {
    859859    glp_smcp smcp;
    860860    glp_init_smcp(&smcp);
     
    902902
    903903
    904   MipGlpk::ProblemType MipGlpk::_getType() const {
     904  GlpkMip::ProblemType GlpkMip::_getType() const {
    905905    switch (glp_get_status(lp)) {
    906906    case GLP_OPT:
     
    916916      default:
    917917        LEMON_ASSERT(false, "Wrong problem type.");
    918         return MipGlpk::ProblemType();
     918        return GlpkMip::ProblemType();
    919919      }
    920920    case GLP_NOFEAS:
     
    929929    default:
    930930      LEMON_ASSERT(false, "Wrong problem type.");
    931       return MipGlpk::ProblemType();
    932     }
    933   }
    934 
    935   MipGlpk::Value MipGlpk::_getSol(int i) const {
     931      return GlpkMip::ProblemType();
     932    }
     933  }
     934
     935  GlpkMip::Value GlpkMip::_getSol(int i) const {
    936936    return glp_mip_col_val(lp, i);
    937937  }
    938938
    939   MipGlpk::Value MipGlpk::_getSolValue() const {
     939  GlpkMip::Value GlpkMip::_getSolValue() const {
    940940    return glp_mip_obj_val(lp);
    941941  }
    942942
    943   MipGlpk* MipGlpk::_newSolver() const { return new MipGlpk; }
    944   MipGlpk* MipGlpk::_cloneSolver() const {return new MipGlpk(*this); }
    945 
    946   const char* MipGlpk::_solverName() const { return "MipGlpk"; }
    947 
    948   void MipGlpk::messageLevel(MessageLevel m) {
     943  GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
     944  GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
     945
     946  const char* GlpkMip::_solverName() const { return "GlpkMip"; }
     947
     948  void GlpkMip::messageLevel(MessageLevel m) {
    949949    _message_level = m;
    950950  }
  • lemon/glpk.h

    r461 r462  
    120120  /// This class implements an interface for the GLPK LP solver.
    121121  ///\ingroup lp_group
    122   class LpGlpk : public GlpkBase, public LpSolver {
    123   public:
    124 
    125     ///\e
    126     LpGlpk();
    127     ///\e
    128     LpGlpk(const LpGlpk&);
     122  class GlpkLp : public GlpkBase, public LpSolver {
     123  public:
     124
     125    ///\e
     126    GlpkLp();
     127    ///\e
     128    GlpkLp(const GlpkLp&);
    129129
    130130  private:
     
    137137  protected:
    138138
    139     virtual LpGlpk* _cloneSolver() const;
    140     virtual LpGlpk* _newSolver() const;
     139    virtual GlpkLp* _cloneSolver() const;
     140    virtual GlpkLp* _newSolver() const;
    141141
    142142    virtual const char* _solverName() const;
     
    204204  /// This class implements an interface for the GLPK MIP solver.
    205205  ///\ingroup lp_group
    206   class MipGlpk : public GlpkBase, public MipSolver {
    207   public:
    208 
    209     ///\e
    210     MipGlpk();
    211     ///\e
    212     MipGlpk(const MipGlpk&);
    213 
    214   protected:
    215 
    216     virtual MipGlpk* _cloneSolver() const;
    217     virtual MipGlpk* _newSolver() const;
     206  class GlpkMip : public GlpkBase, public MipSolver {
     207  public:
     208
     209    ///\e
     210    GlpkMip();
     211    ///\e
     212    GlpkMip(const GlpkMip&);
     213
     214  protected:
     215
     216    virtual GlpkMip* _cloneSolver() const;
     217    virtual GlpkMip* _newSolver() const;
    218218
    219219    virtual const char* _solverName() const;
  • lemon/lp.h

    r461 r462  
    5252  ///\ingroup lp_group
    5353  ///
    54   ///Currently, it is either \c LpGlpk, \c LpCplex, \c LpSoplex or \c LpClp
    55   typedef LpGlpk Lp;
     54  ///Currently, it is either \c GlpkLp, \c CplexLp, \c SoplexLp or \c ClpLp
     55  typedef GlpkLp Lp;
    5656
    5757  ///The default MIP solver identifier
     
    6767  ///\ingroup lp_group
    6868  ///
    69   ///Currently, it is either \c MipGlpk or \c MipCplex
    70   typedef MipGlpk Mip;
     69  ///Currently, it is either \c GlpkMip or \c CplexMip
     70  typedef GlpkMip Mip;
    7171#else
    7272#ifdef HAVE_GLPK
    7373# define LEMON_DEFAULT_LP GLPK
    74   typedef LpGlpk Lp;
     74  typedef GlpkLp Lp;
    7575# define LEMON_DEFAULT_MIP GLPK
    76   typedef MipGlpk Mip;
     76  typedef GlpkMip Mip;
    7777#elif HAVE_CPLEX
    7878# define LEMON_DEFAULT_LP CPLEX
    79   typedef LpCplex Lp;
     79  typedef CplexLp Lp;
    8080# define LEMON_DEFAULT_MIP CPLEX
    81   typedef MipCplex Mip;
     81  typedef CplexMip Mip;
    8282#elif HAVE_SOPLEX
    8383# define DEFAULT_LP SOPLEX
    84   typedef LpSoplex Lp;
     84  typedef SoplexLp Lp;
    8585#elif HAVE_CLP
    8686# define DEFAULT_LP CLP
    87   typedef LpClp Lp; 
     87  typedef ClpLp Lp; 
    8888#endif
    8989#endif
  • lemon/soplex.cc

    r461 r462  
    2727namespace lemon {
    2828
    29   LpSoplex::LpSoplex() {
     29  SoplexLp::SoplexLp() {
    3030    soplex = new soplex::SoPlex;
    3131  }
    3232
    33   LpSoplex::~LpSoplex() {
     33  SoplexLp::~SoplexLp() {
    3434    delete soplex;
    3535  }
    3636
    37   LpSoplex::LpSoplex(const LpSoplex& lp) {
     37  SoplexLp::SoplexLp(const SoplexLp& lp) {
    3838    rows = lp.rows;
    3939    cols = lp.cols;
     
    5050  }
    5151
    52   void LpSoplex::_clear_temporals() {
     52  void SoplexLp::_clear_temporals() {
    5353    _primal_values.clear();
    5454    _dual_values.clear();
    5555  }
    5656
    57   LpSoplex* LpSoplex::_newSolver() const {
    58     LpSoplex* newlp = new LpSoplex();
     57  SoplexLp* SoplexLp::_newSolver() const {
     58    SoplexLp* newlp = new SoplexLp();
    5959    return newlp;
    6060  }
    6161
    62   LpSoplex* LpSoplex::_cloneSolver() const {
    63     LpSoplex* newlp = new LpSoplex(*this);
     62  SoplexLp* SoplexLp::_cloneSolver() const {
     63    SoplexLp* newlp = new SoplexLp(*this);
    6464    return newlp;
    6565  }
    6666
    67   const char* LpSoplex::_solverName() const { return "LpSoplex"; }
    68 
    69   int LpSoplex::_addCol() {
     67  const char* SoplexLp::_solverName() const { return "SoplexLp"; }
     68
     69  int SoplexLp::_addCol() {
    7070    soplex::LPCol c;
    7171    c.setLower(-soplex::infinity);
     
    7878  }
    7979
    80   int LpSoplex::_addRow() {
     80  int SoplexLp::_addRow() {
    8181    soplex::LPRow r;
    8282    r.setLhs(-soplex::infinity);
     
    9090
    9191
    92   void LpSoplex::_eraseCol(int i) {
     92  void SoplexLp::_eraseCol(int i) {
    9393    soplex->removeCol(i);
    9494    _col_names_ref.erase(_col_names[i]);
     
    9898  }
    9999
    100   void LpSoplex::_eraseRow(int i) {
     100  void SoplexLp::_eraseRow(int i) {
    101101    soplex->removeRow(i);
    102102    _row_names_ref.erase(_row_names[i]);
     
    106106  }
    107107
    108   void LpSoplex::_eraseColId(int i) {
     108  void SoplexLp::_eraseColId(int i) {
    109109    cols.eraseIndex(i);
    110110    cols.relocateIndex(i, cols.maxIndex());
    111111  }
    112   void LpSoplex::_eraseRowId(int i) {
     112  void SoplexLp::_eraseRowId(int i) {
    113113    rows.eraseIndex(i);
    114114    rows.relocateIndex(i, rows.maxIndex());
    115115  }
    116116
    117   void LpSoplex::_getColName(int c, std::string &name) const {
     117  void SoplexLp::_getColName(int c, std::string &name) const {
    118118    name = _col_names[c];
    119119  }
    120120
    121   void LpSoplex::_setColName(int c, const std::string &name) {
     121  void SoplexLp::_setColName(int c, const std::string &name) {
    122122    _col_names_ref.erase(_col_names[c]);
    123123    _col_names[c] = name;
     
    127127  }
    128128
    129   int LpSoplex::_colByName(const std::string& name) const {
     129  int SoplexLp::_colByName(const std::string& name) const {
    130130    std::map<std::string, int>::const_iterator it =
    131131      _col_names_ref.find(name);
     
    137137  }
    138138
    139   void LpSoplex::_getRowName(int r, std::string &name) const {
     139  void SoplexLp::_getRowName(int r, std::string &name) const {
    140140    name = _row_names[r];
    141141  }
    142142
    143   void LpSoplex::_setRowName(int r, const std::string &name) {
     143  void SoplexLp::_setRowName(int r, const std::string &name) {
    144144    _row_names_ref.erase(_row_names[r]);
    145145    _row_names[r] = name;
     
    149149  }
    150150
    151   int LpSoplex::_rowByName(const std::string& name) const {
     151  int SoplexLp::_rowByName(const std::string& name) const {
    152152    std::map<std::string, int>::const_iterator it =
    153153      _row_names_ref.find(name);
     
    160160
    161161
    162   void LpSoplex::_setRowCoeffs(int i, ExprIterator b, ExprIterator e) {
     162  void SoplexLp::_setRowCoeffs(int i, ExprIterator b, ExprIterator e) {
    163163    for (int j = 0; j < soplex->nCols(); ++j) {
    164164      soplex->changeElement(i, j, 0.0);
     
    169169  }
    170170
    171   void LpSoplex::_getRowCoeffs(int i, InsertIterator b) const {
     171  void SoplexLp::_getRowCoeffs(int i, InsertIterator b) const {
    172172    const soplex::SVector& vec = soplex->rowVector(i);
    173173    for (int k = 0; k < vec.size(); ++k) {
     
    177177  }
    178178
    179   void LpSoplex::_setColCoeffs(int j, ExprIterator b, ExprIterator e) {
     179  void SoplexLp::_setColCoeffs(int j, ExprIterator b, ExprIterator e) {
    180180    for (int i = 0; i < soplex->nRows(); ++i) {
    181181      soplex->changeElement(i, j, 0.0);
     
    186186  }
    187187
    188   void LpSoplex::_getColCoeffs(int i, InsertIterator b) const {
     188  void SoplexLp::_getColCoeffs(int i, InsertIterator b) const {
    189189    const soplex::SVector& vec = soplex->colVector(i);
    190190    for (int k = 0; k < vec.size(); ++k) {
     
    194194  }
    195195
    196   void LpSoplex::_setCoeff(int i, int j, Value value) {
     196  void SoplexLp::_setCoeff(int i, int j, Value value) {
    197197    soplex->changeElement(i, j, value);
    198198  }
    199199
    200   LpSoplex::Value LpSoplex::_getCoeff(int i, int j) const {
     200  SoplexLp::Value SoplexLp::_getCoeff(int i, int j) const {
    201201    return soplex->rowVector(i)[j];
    202202  }
    203203
    204   void LpSoplex::_setColLowerBound(int i, Value value) {
     204  void SoplexLp::_setColLowerBound(int i, Value value) {
    205205    LEMON_ASSERT(value != INF, "Invalid bound");
    206206    soplex->changeLower(i, value != -INF ? value : -soplex::infinity);
    207207  }
    208208
    209   LpSoplex::Value LpSoplex::_getColLowerBound(int i) const {
     209  SoplexLp::Value SoplexLp::_getColLowerBound(int i) const {
    210210    double value = soplex->lower(i);
    211211    return value != -soplex::infinity ? value : -INF;
    212212  }
    213213
    214   void LpSoplex::_setColUpperBound(int i, Value value) {
     214  void SoplexLp::_setColUpperBound(int i, Value value) {
    215215    LEMON_ASSERT(value != -INF, "Invalid bound");
    216216    soplex->changeUpper(i, value != INF ? value : soplex::infinity);
    217217  }
    218218
    219   LpSoplex::Value LpSoplex::_getColUpperBound(int i) const {
     219  SoplexLp::Value SoplexLp::_getColUpperBound(int i) const {
    220220    double value = soplex->upper(i);
    221221    return value != soplex::infinity ? value : INF;
    222222  }
    223223
    224   void LpSoplex::_setRowLowerBound(int i, Value lb) {
     224  void SoplexLp::_setRowLowerBound(int i, Value lb) {
    225225    LEMON_ASSERT(lb != INF, "Invalid bound");
    226226    soplex->changeRange(i, lb != -INF ? lb : -soplex::infinity, soplex->rhs(i));
    227227  }
    228228
    229   LpSoplex::Value LpSoplex::_getRowLowerBound(int i) const {
     229  SoplexLp::Value SoplexLp::_getRowLowerBound(int i) const {
    230230    double res = soplex->lhs(i);
    231231    return res == -soplex::infinity ? -INF : res;
    232232  }
    233233
    234   void LpSoplex::_setRowUpperBound(int i, Value ub) {
     234  void SoplexLp::_setRowUpperBound(int i, Value ub) {
    235235    LEMON_ASSERT(ub != -INF, "Invalid bound");
    236236    soplex->changeRange(i, soplex->lhs(i), ub != INF ? ub : soplex::infinity);
    237237  }
    238238
    239   LpSoplex::Value LpSoplex::_getRowUpperBound(int i) const {
     239  SoplexLp::Value SoplexLp::_getRowUpperBound(int i) const {
    240240    double res = soplex->rhs(i);
    241241    return res == soplex::infinity ? INF : res;
    242242  }
    243243
    244   void LpSoplex::_setObjCoeffs(ExprIterator b, ExprIterator e) {
     244  void SoplexLp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
    245245    for (int j = 0; j < soplex->nCols(); ++j) {
    246246      soplex->changeObj(j, 0.0);
     
    251251  }
    252252
    253   void LpSoplex::_getObjCoeffs(InsertIterator b) const {
     253  void SoplexLp::_getObjCoeffs(InsertIterator b) const {
    254254    for (int j = 0; j < soplex->nCols(); ++j) {
    255255      Value coef = soplex->obj(j);
     
    261261  }
    262262
    263   void LpSoplex::_setObjCoeff(int i, Value obj_coef) {
     263  void SoplexLp::_setObjCoeff(int i, Value obj_coef) {
    264264    soplex->changeObj(i, obj_coef);
    265265  }
    266266
    267   LpSoplex::Value LpSoplex::_getObjCoeff(int i) const {
     267  SoplexLp::Value SoplexLp::_getObjCoeff(int i) const {
    268268    return soplex->obj(i);
    269269  }
    270270
    271   LpSoplex::SolveExitStatus LpSoplex::_solve() {
     271  SoplexLp::SolveExitStatus SoplexLp::_solve() {
    272272
    273273    _clear_temporals();
     
    285285  }
    286286
    287   LpSoplex::Value LpSoplex::_getPrimal(int i) const {
     287  SoplexLp::Value SoplexLp::_getPrimal(int i) const {
    288288    if (_primal_values.empty()) {
    289289      _primal_values.resize(soplex->nCols());
     
    294294  }
    295295
    296   LpSoplex::Value LpSoplex::_getDual(int i) const {
     296  SoplexLp::Value SoplexLp::_getDual(int i) const {
    297297    if (_dual_values.empty()) {
    298298      _dual_values.resize(soplex->nRows());
     
    303303  }
    304304
    305   LpSoplex::Value LpSoplex::_getPrimalValue() const {
     305  SoplexLp::Value SoplexLp::_getPrimalValue() const {
    306306    return soplex->objValue();
    307307  }
    308308
    309   LpSoplex::VarStatus LpSoplex::_getColStatus(int i) const {
     309  SoplexLp::VarStatus SoplexLp::_getColStatus(int i) const {
    310310    switch (soplex->getBasisColStatus(i)) {
    311311    case soplex::SPxSolver::BASIC:
     
    325325  }
    326326
    327   LpSoplex::VarStatus LpSoplex::_getRowStatus(int i) const {
     327  SoplexLp::VarStatus SoplexLp::_getRowStatus(int i) const {
    328328    switch (soplex->getBasisRowStatus(i)) {
    329329    case soplex::SPxSolver::BASIC:
     
    343343  }
    344344
    345   LpSoplex::Value LpSoplex::_getPrimalRay(int i) const {
     345  SoplexLp::Value SoplexLp::_getPrimalRay(int i) const {
    346346    if (_primal_ray.empty()) {
    347347      _primal_ray.resize(soplex->nCols());
     
    352352  }
    353353
    354   LpSoplex::Value LpSoplex::_getDualRay(int i) const {
     354  SoplexLp::Value SoplexLp::_getDualRay(int i) const {
    355355    if (_dual_ray.empty()) {
    356356      _dual_ray.resize(soplex->nRows());
     
    361361  }
    362362
    363   LpSoplex::ProblemType LpSoplex::_getPrimalType() const {
     363  SoplexLp::ProblemType SoplexLp::_getPrimalType() const {
    364364    switch (soplex->status()) {
    365365    case soplex::SPxSolver::OPTIMAL:
     
    374374  }
    375375
    376   LpSoplex::ProblemType LpSoplex::_getDualType() const {
     376  SoplexLp::ProblemType SoplexLp::_getDualType() const {
    377377    switch (soplex->status()) {
    378378    case soplex::SPxSolver::OPTIMAL:
     
    387387  }
    388388
    389   void LpSoplex::_setSense(Sense sense) {
     389  void SoplexLp::_setSense(Sense sense) {
    390390    switch (sense) {
    391391    case MIN:
     
    397397  }
    398398
    399   LpSoplex::Sense LpSoplex::_getSense() const {
     399  SoplexLp::Sense SoplexLp::_getSense() const {
    400400    switch (soplex->spxSense()) {
    401401    case soplex::SPxSolver::MAXIMIZE:
     
    405405    default:
    406406      LEMON_ASSERT(false, "Wrong sense.");
    407       return LpSoplex::Sense();
    408     }
    409   }
    410 
    411   void LpSoplex::_clear() {
     407      return SoplexLp::Sense();
     408    }
     409  }
     410
     411  void SoplexLp::_clear() {
    412412    soplex->clear();
    413413    _col_names.clear();
  • lemon/soplex.h

    r461 r462  
    4444  /// Berlin (ZIB). You can find detailed information about it at the
    4545  /// <tt>http://soplex.zib.de</tt> address.
    46   class LpSoplex : public LpSolver {
     46  class SoplexLp : public LpSolver {
    4747  private:
    4848
     
    6969
    7070    /// \e
    71     LpSoplex();
     71    SoplexLp();
    7272    /// \e
    73     LpSoplex(const LpSoplex&);
     73    SoplexLp(const SoplexLp&);
    7474    /// \e
    75     ~LpSoplex();
     75    ~SoplexLp();
    7676
    7777  protected:
    7878
    79     virtual LpSoplex* _newSolver() const;
    80     virtual LpSoplex* _cloneSolver() const;
     79    virtual SoplexLp* _newSolver() const;
     80    virtual SoplexLp* _cloneSolver() const;
    8181
    8282    virtual const char* _solverName() const;
  • test/lp_test.cc

    r461 r462  
    363363#ifdef HAVE_GLPK
    364364  {
    365     LpGlpk lp_glpk1,lp_glpk2;
     365    GlpkLp lp_glpk1,lp_glpk2;
    366366    lpTest(lp_glpk1);
    367367    aTest(lp_glpk2);
     
    371371#ifdef HAVE_CPLEX
    372372  try {
    373     LpCplex lp_cplex1,lp_cplex2;
     373    CplexLp lp_cplex1,lp_cplex2;
    374374    lpTest(lp_cplex1);
    375375    aTest(lp_cplex2);
     
    386386#ifdef HAVE_SOPLEX
    387387  {
    388     LpSoplex lp_soplex1,lp_soplex2;
     388    SoplexLp lp_soplex1,lp_soplex2;
    389389    lpTest(lp_soplex1);
    390390    aTest(lp_soplex2);
     
    394394#ifdef HAVE_CLP
    395395  {
    396     LpClp lp_clp1,lp_clp2;
     396    ClpLp lp_clp1,lp_clp2;
    397397    lpTest(lp_clp1);
    398398    aTest(lp_clp2);
  • test/mip_test.cc

    r461 r462  
    113113#ifdef HAVE_GLPK
    114114  {
    115     MipGlpk mip1;
     115    GlpkMip mip1;
    116116    aTest(mip1);
    117117  }
     
    120120#ifdef HAVE_CPLEX
    121121  try {
    122     MipCplex mip2;
     122    CplexMip mip2;
    123123    aTest(mip2);
    124124  } catch (CplexEnv::LicenseError& error) {
Note: See TracChangeset for help on using the changeset viewer.