lemon/lp_base.h
changeset 1542 0219ee65ffcc
parent 1536 308150155bb5
child 1610 893dacc1866c
     1.1 --- a/lemon/lp_base.h	Thu Jul 07 09:04:39 2005 +0000
     1.2 +++ b/lemon/lp_base.h	Thu Jul 07 15:00:04 2005 +0000
     1.3 @@ -138,19 +138,19 @@
     1.4        INFINITE = 4
     1.5      };
     1.6  
     1.7 -      ///\e The type of the investigated LP problem
     1.8 -      enum ProblemTypes {
     1.9 -	  ///Primal-dual feasible
    1.10 -	  PRIMAL_DUAL_FEASIBLE = 0,
    1.11 -	  ///Primal feasible dual infeasible
    1.12 -	  PRIMAL_FEASIBLE_DUAL_INFEASIBLE = 1,
    1.13 -	  ///Primal infeasible dual feasible
    1.14 -	  PRIMAL_INFEASIBLE_DUAL_FEASIBLE = 2,
    1.15 -	  ///Primal-dual infeasible
    1.16 -	  PRIMAL_DUAL_INFEASIBLE = 3,
    1.17 -	  ///Could not determine so far
    1.18 -	  UNKNOWN = 4
    1.19 -      };
    1.20 +    ///\e The type of the investigated LP problem
    1.21 +    enum ProblemTypes {
    1.22 +      ///Primal-dual feasible
    1.23 +      PRIMAL_DUAL_FEASIBLE = 0,
    1.24 +      ///Primal feasible dual infeasible
    1.25 +      PRIMAL_FEASIBLE_DUAL_INFEASIBLE = 1,
    1.26 +      ///Primal infeasible dual feasible
    1.27 +      PRIMAL_INFEASIBLE_DUAL_FEASIBLE = 2,
    1.28 +      ///Primal-dual infeasible
    1.29 +      PRIMAL_DUAL_INFEASIBLE = 3,
    1.30 +      ///Could not determine so far
    1.31 +      UNKNOWN = 4
    1.32 +    };
    1.33  
    1.34      ///The floating point type used by the solver
    1.35      typedef double Value;
    1.36 @@ -552,6 +552,8 @@
    1.37  
    1.38      virtual int _addCol() = 0;
    1.39      virtual int _addRow() = 0;
    1.40 +    virtual void _eraseCol(int col) = 0;
    1.41 +    virtual void _eraseRow(int row) = 0;
    1.42      virtual void _setRowCoeffs(int i, 
    1.43  			       int length,
    1.44                                 int  const * indices, 
    1.45 @@ -680,7 +682,7 @@
    1.46  
    1.47      ///\param c is the column to be modified
    1.48      ///\param e is a dual linear expression (see \ref DualExpr)
    1.49 -    ///\bug This is a temportary function. The interface will change to
    1.50 +    ///\bug This is a temporary function. The interface will change to
    1.51      ///a better one.
    1.52      void setCol(Col c,const DualExpr &e) {
    1.53        std::vector<int> indices;
    1.54 @@ -717,8 +719,8 @@
    1.55      ///\return The created row
    1.56      Row addRow() { Row r; r.id=rows.insert(_addRow()); return r;}
    1.57  
    1.58 -    ///\brief Adds several new row
    1.59 -    ///(i.e a variables) at once
    1.60 +    ///\brief Add several new rows
    1.61 +    ///(i.e a constraints) at once
    1.62      ///
    1.63      ///This magic function takes a container as its argument
    1.64      ///and fills its elements
    1.65 @@ -843,6 +845,22 @@
    1.66        setRow(r,c);
    1.67        return r;
    1.68      }
    1.69 +    ///Erase a coloumn (i.e a variable) from the LP
    1.70 +
    1.71 +    ///\param c is the coloumn to be deleted
    1.72 +    ///\todo Please check this
    1.73 +    void eraseCol(Col c) {
    1.74 +      _eraseCol(cols.floatingId(c.id));
    1.75 +      cols.erase(c.id);
    1.76 +    }
    1.77 +    ///Erase a  row (i.e a constraint) from the LP
    1.78 +
    1.79 +    ///\param r is the row to be deleted
    1.80 +    ///\todo Please check this
    1.81 +    void eraseRow(Row r) {
    1.82 +      _eraseRow(rows.floatingId(r.id));
    1.83 +      rows.erase(r.id);
    1.84 +    }
    1.85  
    1.86      ///Set an element of the coefficient matrix of the LP
    1.87