COIN-OR::LEMON - Graph Library

Changeset 2366:bfbdded3763a in lemon-0.x for lemon/lp_cplex.cc


Ignore:
Timestamp:
02/16/07 20:11:31 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3181
Message:

Using const in lp interface
colByName functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_cplex.cc

    r2364 r2366  
    8585  }
    8686 
    87   void LpCplex::_getColName(int col, std::string &name)
     87  void LpCplex::_getColName(int col, std::string &name) const
    8888  {
    8989    ///\bug Untested
     
    108108    CPXchgcolname(env, lp, 1, &col, names);   
    109109  }
     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  }
    110120 
    111121  ///\warning Data at index 0 is ignored in the arrays.
     
    126136  }
    127137
    128   void LpSoplex::_getRowCoeffs(int i, RowIterator b) {
     138  void LpSoplex::_getRowCoeffs(int i, RowIterator b) const {
    129139    /// \todo implement
    130140  }
     
    146156  }
    147157
    148   void LpSoplex::_getColCoeffs(int i, ColIterator b) {
     158  void LpSoplex::_getColCoeffs(int i, ColIterator b) const {
    149159    /// \todo implement
    150160  }
     
    155165  }
    156166
    157   LpCplex::Value LpCplex::_getCoeff(int row, int col)
     167  LpCplex::Value LpCplex::_getCoeff(int row, int col) const
    158168  {
    159169    LpCplex::Value value;
     
    174184  }
    175185
    176   LpCplex::Value LpCplex::_getColLowerBound(int i)
     186  LpCplex::Value LpCplex::_getColLowerBound(int i) const
    177187  {
    178188    LpCplex::Value x;
     
    192202  }
    193203
    194   LpCplex::Value LpCplex::_getColUpperBound(int i)
     204  LpCplex::Value LpCplex::_getColUpperBound(int i) const
    195205  {
    196206    LpCplex::Value x;
     
    271281//   }
    272282 
    273   void LpCplex::_getRowBounds(int i, Value &lb, Value &ub)
     283  void LpCplex::_getRowBounds(int i, Value &lb, Value &ub) const
    274284  {
    275285    char sense;
     
    303313  }
    304314
    305   LpCplex::Value LpCplex::_getObjCoeff(int i)
     315  LpCplex::Value LpCplex::_getObjCoeff(int i) const
    306316  {
    307317    Value x;
     
    368378  }
    369379
    370   LpCplex::Value LpCplex::_getPrimal(int i)
     380  LpCplex::Value LpCplex::_getPrimal(int i) const
    371381  {
    372382    Value x;
     
    375385  }
    376386
    377   LpCplex::Value LpCplex::_getDual(int i)
     387  LpCplex::Value LpCplex::_getDual(int i) const
    378388  {
    379389    Value y;
     
    382392  }
    383393 
    384   LpCplex::Value LpCplex::_getPrimalValue()
     394  LpCplex::Value LpCplex::_getPrimalValue() const
    385395  {
    386396    Value objval;
     
    391401    return objval;
    392402  }
    393   bool LpCplex::_isBasicCol(int i) {
     403  bool LpCplex::_isBasicCol(int i) const
     404  {
    394405    int cstat[CPXgetnumcols(env, lp)];
    395406    CPXgetbase(env, lp, cstat, NULL);
     
    459470// Description: Method for linear optimization.
    460471// 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 cplex
    462472  void statusSwitch(CPXENVptr env,int& stat){
    463473#if CPX_VERSION < 900
     
    476486  }
    477487
    478   LpCplex::SolutionStatus LpCplex::_getPrimalStatus()
     488  LpCplex::SolutionStatus LpCplex::_getPrimalStatus() const
    479489  {
    480490    //Unboundedness not treated well: the following is from cplex 9.0 doc
     
    559569// CPX_STAT_UNBOUNDED
    560570
    561   LpCplex::SolutionStatus LpCplex::_getDualStatus()
     571  LpCplex::SolutionStatus LpCplex::_getDualStatus() const
    562572  {
    563573    int stat = CPXgetstat(env, lp);
     
    588598  }
    589599
    590   LpCplex::ProblemTypes LpCplex::_getProblemType()
     600  LpCplex::ProblemTypes LpCplex::_getProblemType() const
    591601  {
    592602    int stat = CPXgetstat(env, lp);
     
    628638   }
    629639
    630   bool LpCplex::_isMax()
     640  bool LpCplex::_isMax() const
    631641  {
    632642    if (CPXgetobjsen(env, lp)==CPX_MAX)
Note: See TracChangeset for help on using the changeset viewer.