lemon/lp_base.h
changeset 2144 cd8897f67c26
parent 2085 1970a93dfaa8
child 2148 ab368e0ab662
     1.1 --- a/lemon/lp_base.h	Mon Jul 17 07:30:56 2006 +0000
     1.2 +++ b/lemon/lp_base.h	Mon Jul 17 09:00:21 2006 +0000
     1.3 @@ -175,6 +175,7 @@
     1.4      protected:
     1.5        int id;
     1.6        friend class LpSolverBase;
     1.7 +      friend class MipSolverBase;
     1.8      public:
     1.9        typedef Value ExprValue;
    1.10        typedef True LpSolverCol;
    1.11 @@ -1156,7 +1157,33 @@
    1.12      
    1.13    };  
    1.14  
    1.15 -  ///\e
    1.16 +
    1.17 +  ///Common base class for ILP solvers
    1.18 +  ///\todo Much more docs
    1.19 +  ///\ingroup gen_opt_group
    1.20 +  class MipSolverBase : virtual public LpSolverBase{
    1.21 +  public:
    1.22 +
    1.23 +    ///Set the type of the given Col to integer or remove that property.
    1.24 +    ///
    1.25 +    ///Set the type of the given Col to integer or remove that property.
    1.26 +    void integer(Col c, bool enable) {
    1.27 +      _integer(cols.floatingId(c.id),enable);
    1.28 +    }
    1.29 +
    1.30 +    ///Gives back the type of the column.
    1.31 +    ///
    1.32 +    ///Gives back the type of the column.
    1.33 +    ///\return true if the column has integer type and false if not.
    1.34 +    bool integer(Col c){
    1.35 +      return _integer(cols.floatingId(c.id));
    1.36 +    }
    1.37 +
    1.38 +  protected:
    1.39 +
    1.40 +    virtual bool _integer(int col) = 0;
    1.41 +    virtual void _integer(int col, bool enable) = 0;
    1.42 +  };
    1.43    
    1.44    ///\relates LpSolverBase::Expr
    1.45    ///