lemon/glpk.cc
changeset 1204 736a341e604b
parent 1092 dceba191c00d
equal deleted inserted replaced
15:6cef70591aa7 16:0f0e30a0e39f
    36 
    36 
    37   GlpkBase::GlpkBase(const GlpkBase &other) : LpBase() {
    37   GlpkBase::GlpkBase(const GlpkBase &other) : LpBase() {
    38     lp = glp_create_prob();
    38     lp = glp_create_prob();
    39     glp_copy_prob(lp, other.lp, GLP_ON);
    39     glp_copy_prob(lp, other.lp, GLP_ON);
    40     glp_create_index(lp);
    40     glp_create_index(lp);
    41     rows = other.rows;
    41     _rows = other._rows;
    42     cols = other.cols;
    42     _cols = other._cols;
    43     messageLevel(MESSAGE_NOTHING);
    43     messageLevel(MESSAGE_NOTHING);
    44   }
    44   }
    45 
    45 
    46   GlpkBase::~GlpkBase() {
    46   GlpkBase::~GlpkBase() {
    47     glp_delete_prob(lp);
    47     glp_delete_prob(lp);
   106     ra[1] = i;
   106     ra[1] = i;
   107     glp_del_rows(lp, 1, ra);
   107     glp_del_rows(lp, 1, ra);
   108   }
   108   }
   109 
   109 
   110   void GlpkBase::_eraseColId(int i) {
   110   void GlpkBase::_eraseColId(int i) {
   111     cols.eraseIndex(i);
   111     _cols.eraseIndex(i);
   112     cols.shiftIndices(i);
   112     _cols.shiftIndices(i);
   113   }
   113   }
   114 
   114 
   115   void GlpkBase::_eraseRowId(int i) {
   115   void GlpkBase::_eraseRowId(int i) {
   116     rows.eraseIndex(i);
   116     _rows.eraseIndex(i);
   117     rows.shiftIndices(i);
   117     _rows.shiftIndices(i);
   118   }
   118   }
   119 
   119 
   120   void GlpkBase::_getColName(int c, std::string& name) const {
   120   void GlpkBase::_getColName(int c, std::string& name) const {
   121     const char *str = glp_get_col_name(lp, c);
   121     const char *str = glp_get_col_name(lp, c);
   122     if (str) name = str;
   122     if (str) name = str;