lemon/lp_base.h
changeset 2144 cd8897f67c26
parent 2085 1970a93dfaa8
child 2148 ab368e0ab662
equal deleted inserted replaced
29:43c8d7f8d173 30:872c1242ddee
   173     ///it is similar to Node/Edge)
   173     ///it is similar to Node/Edge)
   174     class Col {
   174     class Col {
   175     protected:
   175     protected:
   176       int id;
   176       int id;
   177       friend class LpSolverBase;
   177       friend class LpSolverBase;
       
   178       friend class MipSolverBase;
   178     public:
   179     public:
   179       typedef Value ExprValue;
   180       typedef Value ExprValue;
   180       typedef True LpSolverCol;
   181       typedef True LpSolverCol;
   181       Col() {}
   182       Col() {}
   182       Col(const Invalid&) : id(-1) {}
   183       Col(const Invalid&) : id(-1) {}
  1154     Value primalValue() { return _getPrimalValue()+obj_const_comp;}
  1155     Value primalValue() { return _getPrimalValue()+obj_const_comp;}
  1155     ///@}
  1156     ///@}
  1156     
  1157     
  1157   };  
  1158   };  
  1158 
  1159 
  1159   ///\e
  1160 
       
  1161   ///Common base class for ILP solvers
       
  1162   ///\todo Much more docs
       
  1163   ///\ingroup gen_opt_group
       
  1164   class MipSolverBase : virtual public LpSolverBase{
       
  1165   public:
       
  1166 
       
  1167     ///Set the type of the given Col to integer or remove that property.
       
  1168     ///
       
  1169     ///Set the type of the given Col to integer or remove that property.
       
  1170     void integer(Col c, bool enable) {
       
  1171       _integer(cols.floatingId(c.id),enable);
       
  1172     }
       
  1173 
       
  1174     ///Gives back the type of the column.
       
  1175     ///
       
  1176     ///Gives back the type of the column.
       
  1177     ///\return true if the column has integer type and false if not.
       
  1178     bool integer(Col c){
       
  1179       return _integer(cols.floatingId(c.id));
       
  1180     }
       
  1181 
       
  1182   protected:
       
  1183 
       
  1184     virtual bool _integer(int col) = 0;
       
  1185     virtual void _integer(int col, bool enable) = 0;
       
  1186   };
  1160   
  1187   
  1161   ///\relates LpSolverBase::Expr
  1188   ///\relates LpSolverBase::Expr
  1162   ///
  1189   ///
  1163   inline LpSolverBase::Expr operator+(const LpSolverBase::Expr &a,
  1190   inline LpSolverBase::Expr operator+(const LpSolverBase::Expr &a,
  1164 				      const LpSolverBase::Expr &b) 
  1191 				      const LpSolverBase::Expr &b)