lemon/lp_base.h
changeset 2328 b4931ae52069
parent 2324 18fc834761d9
child 2345 bfcaad2b84e8
     1.1 --- a/lemon/lp_base.h	Mon Dec 04 18:09:09 2006 +0000
     1.2 +++ b/lemon/lp_base.h	Thu Dec 07 16:10:54 2006 +0000
     1.3 @@ -706,10 +706,14 @@
     1.4      virtual Value _getCoeff(int row, int col) = 0;
     1.5  
     1.6      virtual void _setColLowerBound(int i, Value value) = 0;
     1.7 +    virtual Value _getColLowerBound(int i) = 0;
     1.8      virtual void _setColUpperBound(int i, Value value) = 0;
     1.9 +    virtual Value _getColUpperBound(int i) = 0;
    1.10  //     virtual void _setRowLowerBound(int i, Value value) = 0;
    1.11  //     virtual void _setRowUpperBound(int i, Value value) = 0;
    1.12      virtual void _setRowBounds(int i, Value lower, Value upper) = 0;
    1.13 +    virtual void _getRowBounds(int i, Value &lower, Value &upper)=0;
    1.14 +
    1.15      virtual void _setObjCoeff(int i, Value obj_coef) = 0;
    1.16      virtual Value _getObjCoeff(int i) = 0;
    1.17      virtual void _clearObj()=0;
    1.18 @@ -1024,6 +1028,15 @@
    1.19      void colLowerBound(Col c, Value value) {
    1.20        _setColLowerBound(_lpId(c),value);
    1.21      }
    1.22 +
    1.23 +    /// Get the lower bound of a column (i.e a variable)
    1.24 +
    1.25 +    /// This function returns the lower bound for column (variable) \t c
    1.26 +    /// (this might be -\ref INF as well).  
    1.27 +    ///\return The lower bound for coloumn \t c
    1.28 +    Value colLowerBound(Col c) {
    1.29 +      return _getColLowerBound(_lpId(c));
    1.30 +    }
    1.31      
    1.32      ///\brief Set the lower bound of  several columns
    1.33      ///(i.e a variables) at once
    1.34 @@ -1071,7 +1084,16 @@
    1.35        _setColUpperBound(_lpId(c),value);
    1.36      };
    1.37  
    1.38 -    ///\brief Set the lower bound of  several columns
    1.39 +    /// Get the upper bound of a column (i.e a variable)
    1.40 +
    1.41 +    /// This function returns the upper bound for column (variable) \t c
    1.42 +    /// (this might be \ref INF as well).  
    1.43 +    ///\return The upper bound for coloumn \t c
    1.44 +    Value colUpperBound(Col c) {
    1.45 +      return _getColUpperBound(_lpId(c));
    1.46 +    }
    1.47 +
    1.48 +    ///\brief Set the upper bound of  several columns
    1.49      ///(i.e a variables) at once
    1.50      ///
    1.51      ///This magic function takes a container as its argument
    1.52 @@ -1176,15 +1198,30 @@
    1.53  
    1.54      /// Set the lower and the upper bounds of a row (i.e a constraint)
    1.55  
    1.56 -    /// The lower and the upper bounds of
    1.57 +    /// The lower and the upper bound of
    1.58      /// a constraint (row) have to be given by an 
    1.59      /// extended number of type Value, i.e. a finite number of type 
    1.60 -    /// Value, -\ref INF or \ref INF.
    1.61 +    /// Value, -\ref INF or \ref INF. There is no separate function for the 
    1.62 +    /// lower and the upper bound because that would have been hard to implement 
    1.63 +    /// for CPLEX.
    1.64      void rowBounds(Row c, Value lower, Value upper) {
    1.65        _setRowBounds(_lpId(c),lower, upper);
    1.66 -      // _setRowUpperBound(_lpId(c),upper);
    1.67      }
    1.68      
    1.69 +    /// Get the lower and the upper bounds of a row (i.e a constraint)
    1.70 +
    1.71 +    /// The lower and the upper bound of
    1.72 +    /// a constraint (row) are  
    1.73 +    /// extended numbers of type Value, i.e.  finite numbers of type 
    1.74 +    /// Value, -\ref INF or \ref INF. 
    1.75 +    /// \todo There is no separate function for the 
    1.76 +    /// lower and the upper bound because we had problems with the 
    1.77 +    /// implementation of the setting functions for CPLEX:  
    1.78 +    /// check out whether this can be done for these functions.
    1.79 +    void getRowBounds(Row c, Value &lower, Value &upper) {
    1.80 +      _getRowBounds(_lpId(c),lower, upper);
    1.81 +    }
    1.82 +
    1.83      ///Set an element of the objective function
    1.84      void objCoeff(Col c, Value v) {_setObjCoeff(_lpId(c),v); };
    1.85