lemon/lp_soplex.cc
changeset 2387 317b9a88c350
parent 2368 6b2e8b734ae7
child 2391 14a343be7a5a
equal deleted inserted replaced
4:c14afe6ce6c8 5:e5a46cd49e8a
    42     return *newlp;
    42     return *newlp;
    43   }
    43   }
    44 
    44 
    45   LpSolverBase &LpSoplex::_copyLp() {
    45   LpSolverBase &LpSoplex::_copyLp() {
    46     LpSoplex* newlp = new LpSoplex();
    46     LpSoplex* newlp = new LpSoplex();
    47     ((soplex::SPxLP&)*(newlp->soplex)) = *soplex;
    47     (*static_cast<soplex::SPxLP*>(newlp->soplex)) = *soplex;
    48     return *newlp;
    48     return *newlp;
    49   }
    49   }
    50 
    50 
    51   int LpSoplex::_addCol() {
    51   int LpSoplex::_addCol() {
    52     soplex::LPCol col;
    52     soplex::LPCol c;
    53     col.setLower(-soplex::infinity);
    53     c.setLower(-soplex::infinity);
    54     col.setUpper(soplex::infinity);
    54     c.setUpper(soplex::infinity);
    55     soplex->addCol(col);
    55     soplex->addCol(c);
    56 
    56 
    57     colNames.push_back(std::string());
    57     colNames.push_back(std::string());
    58     primal_value.push_back(0.0);
    58     primal_value.push_back(0.0);
    59     solved = false;
    59     solved = false;
    60 
    60 
    61     return soplex->nCols() - 1;
    61     return soplex->nCols() - 1;
    62   }
    62   }
    63 
    63 
    64   int LpSoplex::_addRow() {
    64   int LpSoplex::_addRow() {
    65     soplex::LPRow row;
    65     soplex::LPRow r;
    66     row.setLhs(-soplex::infinity);
    66     r.setLhs(-soplex::infinity);
    67     row.setRhs(soplex::infinity);
    67     r.setRhs(soplex::infinity);
    68     soplex->addRow(row);
    68     soplex->addRow(r);
    69 
    69 
    70     dual_value.push_back(0.0);
    70     dual_value.push_back(0.0);
    71     solved = false;
    71     solved = false;
    72 
    72 
    73     return soplex->nRows() - 1;
    73     return soplex->nRows() - 1;
    90     dual_value[i] = dual_value.back();
    90     dual_value[i] = dual_value.back();
    91     dual_value.pop_back();
    91     dual_value.pop_back();
    92     solved = false;
    92     solved = false;
    93   }
    93   }
    94   
    94   
    95   void LpSoplex::_getColName(int col, std::string &name) const {
    95   void LpSoplex::_getColName(int c, std::string &name) const {
    96     name = colNames[col]; 
    96     name = colNames[c]; 
    97   }
    97   }
    98   
    98   
    99   void LpSoplex::_setColName(int col, const std::string &name) {
    99   void LpSoplex::_setColName(int c, const std::string &name) {
   100     invColNames.erase(colNames[col]);
   100     invColNames.erase(colNames[c]);
   101     colNames[col] = name; 
   101     colNames[c] = name; 
   102     if (!name.empty()) {
   102     if (!name.empty()) {
   103       invColNames.insert(std::make_pair(name, col));
   103       invColNames.insert(std::make_pair(name, c));
   104     }
   104     }
   105   }
   105   }
   106 
   106 
   107   int LpSoplex::_colByName(const std::string& name) const {
   107   int LpSoplex::_colByName(const std::string& name) const {
   108     std::map<std::string, int>::const_iterator it =
   108     std::map<std::string, int>::const_iterator it =