COIN-OR::LEMON - Graph Library

Changeset 2328:b4931ae52069 in lemon-0.x for lemon/lp_base.h


Ignore:
Timestamp:
12/07/06 17:10:54 (17 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3104
Message:

Query functions have been implemented for GLPK (CPLEX breaks at the moment, I guess): These functions include:
retrieving one element of the coeff. matrix
retrieving one element of the obj function
lower bd for a variable
upper bound for a variable
lower and upper bounds for a row (these can not be handled separately at the moment)
direction of the optimization (is_max() function)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_base.h

    r2324 r2328  
    707707
    708708    virtual void _setColLowerBound(int i, Value value) = 0;
     709    virtual Value _getColLowerBound(int i) = 0;
    709710    virtual void _setColUpperBound(int i, Value value) = 0;
     711    virtual Value _getColUpperBound(int i) = 0;
    710712//     virtual void _setRowLowerBound(int i, Value value) = 0;
    711713//     virtual void _setRowUpperBound(int i, Value value) = 0;
    712714    virtual void _setRowBounds(int i, Value lower, Value upper) = 0;
     715    virtual void _getRowBounds(int i, Value &lower, Value &upper)=0;
     716
    713717    virtual void _setObjCoeff(int i, Value obj_coef) = 0;
    714718    virtual Value _getObjCoeff(int i) = 0;
     
    10251029      _setColLowerBound(_lpId(c),value);
    10261030    }
     1031
     1032    /// Get the lower bound of a column (i.e a variable)
     1033
     1034    /// This function returns the lower bound for column (variable) \t c
     1035    /// (this might be -\ref INF as well). 
     1036    ///\return The lower bound for coloumn \t c
     1037    Value colLowerBound(Col c) {
     1038      return _getColLowerBound(_lpId(c));
     1039    }
    10271040   
    10281041    ///\brief Set the lower bound of  several columns
     
    10721085    };
    10731086
    1074     ///\brief Set the lower bound of  several columns
     1087    /// Get the upper bound of a column (i.e a variable)
     1088
     1089    /// This function returns the upper bound for column (variable) \t c
     1090    /// (this might be \ref INF as well). 
     1091    ///\return The upper bound for coloumn \t c
     1092    Value colUpperBound(Col c) {
     1093      return _getColUpperBound(_lpId(c));
     1094    }
     1095
     1096    ///\brief Set the upper bound of  several columns
    10751097    ///(i.e a variables) at once
    10761098    ///
     
    11771199    /// Set the lower and the upper bounds of a row (i.e a constraint)
    11781200
    1179     /// The lower and the upper bounds of
     1201    /// The lower and the upper bound of
    11801202    /// a constraint (row) have to be given by an
    11811203    /// extended number of type Value, i.e. a finite number of type
    1182     /// Value, -\ref INF or \ref INF.
     1204    /// Value, -\ref INF or \ref INF. There is no separate function for the
     1205    /// lower and the upper bound because that would have been hard to implement
     1206    /// for CPLEX.
    11831207    void rowBounds(Row c, Value lower, Value upper) {
    11841208      _setRowBounds(_lpId(c),lower, upper);
    1185       // _setRowUpperBound(_lpId(c),upper);
    1186     }
    1187    
     1209    }
     1210   
     1211    /// Get the lower and the upper bounds of a row (i.e a constraint)
     1212
     1213    /// The lower and the upper bound of
     1214    /// a constraint (row) are 
     1215    /// extended numbers of type Value, i.e.  finite numbers of type
     1216    /// Value, -\ref INF or \ref INF.
     1217    /// \todo There is no separate function for the
     1218    /// lower and the upper bound because we had problems with the
     1219    /// implementation of the setting functions for CPLEX: 
     1220    /// check out whether this can be done for these functions.
     1221    void getRowBounds(Row c, Value &lower, Value &upper) {
     1222      _getRowBounds(_lpId(c),lower, upper);
     1223    }
     1224
    11881225    ///Set an element of the objective function
    11891226    void objCoeff(Col c, Value v) {_setObjCoeff(_lpId(c),v); };
Note: See TracChangeset for help on using the changeset viewer.