diff -r 305ce06287c9 -r 0219ee65ffcc lemon/lp_base.h --- a/lemon/lp_base.h Thu Jul 07 09:04:39 2005 +0000 +++ b/lemon/lp_base.h Thu Jul 07 15:00:04 2005 +0000 @@ -138,19 +138,19 @@ INFINITE = 4 }; - ///\e The type of the investigated LP problem - enum ProblemTypes { - ///Primal-dual feasible - PRIMAL_DUAL_FEASIBLE = 0, - ///Primal feasible dual infeasible - PRIMAL_FEASIBLE_DUAL_INFEASIBLE = 1, - ///Primal infeasible dual feasible - PRIMAL_INFEASIBLE_DUAL_FEASIBLE = 2, - ///Primal-dual infeasible - PRIMAL_DUAL_INFEASIBLE = 3, - ///Could not determine so far - UNKNOWN = 4 - }; + ///\e The type of the investigated LP problem + enum ProblemTypes { + ///Primal-dual feasible + PRIMAL_DUAL_FEASIBLE = 0, + ///Primal feasible dual infeasible + PRIMAL_FEASIBLE_DUAL_INFEASIBLE = 1, + ///Primal infeasible dual feasible + PRIMAL_INFEASIBLE_DUAL_FEASIBLE = 2, + ///Primal-dual infeasible + PRIMAL_DUAL_INFEASIBLE = 3, + ///Could not determine so far + UNKNOWN = 4 + }; ///The floating point type used by the solver typedef double Value; @@ -552,6 +552,8 @@ virtual int _addCol() = 0; virtual int _addRow() = 0; + virtual void _eraseCol(int col) = 0; + virtual void _eraseRow(int row) = 0; virtual void _setRowCoeffs(int i, int length, int const * indices, @@ -680,7 +682,7 @@ ///\param c is the column to be modified ///\param e is a dual linear expression (see \ref DualExpr) - ///\bug This is a temportary function. The interface will change to + ///\bug This is a temporary function. The interface will change to ///a better one. void setCol(Col c,const DualExpr &e) { std::vector indices; @@ -717,8 +719,8 @@ ///\return The created row Row addRow() { Row r; r.id=rows.insert(_addRow()); return r;} - ///\brief Adds several new row - ///(i.e a variables) at once + ///\brief Add several new rows + ///(i.e a constraints) at once /// ///This magic function takes a container as its argument ///and fills its elements @@ -843,6 +845,22 @@ setRow(r,c); return r; } + ///Erase a coloumn (i.e a variable) from the LP + + ///\param c is the coloumn to be deleted + ///\todo Please check this + void eraseCol(Col c) { + _eraseCol(cols.floatingId(c.id)); + cols.erase(c.id); + } + ///Erase a row (i.e a constraint) from the LP + + ///\param r is the row to be deleted + ///\todo Please check this + void eraseRow(Row r) { + _eraseRow(rows.floatingId(r.id)); + rows.erase(r.id); + } ///Set an element of the coefficient matrix of the LP