COIN-OR::LEMON - Graph Library

Changeset 482:ed54c0d13df0 in lemon for lemon/lp_soplex.h


Ignore:
Timestamp:
12/02/08 22:48:28 (15 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Children:
483:76ec7bd57026, 547:17cabb114d52
Phase:
public
Message:

Thorough redesign of the LP/MIP interface (#44)

  • Redesigned class structure
  • Redesigned iterators
  • Some functions in the basic interface redesigned
  • More complete setting functions
  • Ray retrieving functions
  • Lot of improvements
  • Cplex common env
  • CLP macro definition to config.h.in
  • Update lp.h to also use soplex and clp
  • Remove default_solver_name
  • New solverName() function in solvers
  • Handle exceptions for MipCplex? test
  • Rename tolerance parameter to epsilon
  • Rename MapIt? to CoeffIt?
  • Lot of documentation improvements
  • Various bugfixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lp_soplex.h

    r481 r482  
    4444  /// Berlin (ZIB). You can find detailed information about it at the
    4545  /// <tt>http://soplex.zib.de</tt> address.
    46   class LpSoplex :virtual public LpSolverBase {
    47   protected:
    48 
    49     _lp_bits::RelocateIdHandler relocateIdHandler;
     46  class LpSoplex : public LpSolver {
     47  private:
    5048
    5149    soplex::SoPlex* soplex;
    52     bool solved;
    5350
    54     std::vector<std::string> colNames;
    55     std::map<std::string, int> invColNames;
     51    std::vector<std::string> _col_names;
     52    std::map<std::string, int> _col_names_ref;
    5653
    57     std::vector<Value> primal_value;
    58     std::vector<Value> dual_value;
     54    std::vector<std::string> _row_names;
     55    std::map<std::string, int> _row_names_ref;
    5956
     57  private:
     58
     59    // these values cannot be retrieved element by element
     60    mutable std::vector<Value> _primal_values;
     61    mutable std::vector<Value> _dual_values;
     62
     63    mutable std::vector<Value> _primal_ray;
     64    mutable std::vector<Value> _dual_ray;
     65
     66    void _clear_temporals();
    6067
    6168  public:
    62 
    63     typedef LpSolverBase Parent;
    64 
    6569
    6670    /// \e
     
    7377  protected:
    7478
    75     virtual LpSolverBase* _newLp();
    76     virtual LpSolverBase* _copyLp();
     79    virtual LpSoplex* _newSolver() const;
     80    virtual LpSoplex* _cloneSolver() const;
     81
     82    virtual const char* _solverName() const;
    7783
    7884    virtual int _addCol();
    7985    virtual int _addRow();
     86
    8087    virtual void _eraseCol(int i);
    8188    virtual void _eraseRow(int i);
    82     virtual void _getColName(int col, std::string & name) const;
    83     virtual void _setColName(int col, const std::string & name);
     89
     90    virtual void _eraseColId(int i);
     91    virtual void _eraseRowId(int i);
     92
     93    virtual void _getColName(int col, std::string& name) const;
     94    virtual void _setColName(int col, const std::string& name);
    8495    virtual int _colByName(const std::string& name) const;
    85     virtual void _setRowCoeffs(int i, ConstRowIterator b, ConstRowIterator e);
    86     virtual void _getRowCoeffs(int i, RowIterator b) const;
    87     virtual void _setColCoeffs(int i, ConstColIterator b, ConstColIterator e);
    88     virtual void _getColCoeffs(int i, ColIterator b) const;
     96
     97    virtual void _getRowName(int row, std::string& name) const;
     98    virtual void _setRowName(int row, const std::string& name);
     99    virtual int _rowByName(const std::string& name) const;
     100
     101    virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
     102    virtual void _getRowCoeffs(int i, InsertIterator b) const;
     103
     104    virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
     105    virtual void _getColCoeffs(int i, InsertIterator b) const;
     106
    89107    virtual void _setCoeff(int row, int col, Value value);
    90108    virtual Value _getCoeff(int row, int col) const;
     109
    91110    virtual void _setColLowerBound(int i, Value value);
    92111    virtual Value _getColLowerBound(int i) const;
    93112    virtual void _setColUpperBound(int i, Value value);
    94113    virtual Value _getColUpperBound(int i) const;
    95     virtual void _setRowBounds(int i, Value lower, Value upper);
    96     virtual void _getRowBounds(int i, Value &lower, Value &upper) const;
     114
     115    virtual void _setRowLowerBound(int i, Value value);
     116    virtual Value _getRowLowerBound(int i) const;
     117    virtual void _setRowUpperBound(int i, Value value);
     118    virtual Value _getRowUpperBound(int i) const;
     119
     120    virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
     121    virtual void _getObjCoeffs(InsertIterator b) const;
     122
    97123    virtual void _setObjCoeff(int i, Value obj_coef);
    98124    virtual Value _getObjCoeff(int i) const;
    99     virtual void _clearObj();
     125
     126    virtual void _setSense(Sense sense);
     127    virtual Sense _getSense() const;
    100128
    101129    virtual SolveExitStatus _solve();
    102130    virtual Value _getPrimal(int i) const;
    103131    virtual Value _getDual(int i) const;
     132
    104133    virtual Value _getPrimalValue() const;
    105     virtual bool _isBasicCol(int i) const;
    106134
    107     virtual SolutionStatus _getPrimalStatus() const;
    108     virtual SolutionStatus _getDualStatus() const;
    109     virtual ProblemTypes _getProblemType() const;
     135    virtual Value _getPrimalRay(int i) const;
     136    virtual Value _getDualRay(int i) const;
    110137
     138    virtual VarStatus _getColStatus(int i) const;
     139    virtual VarStatus _getRowStatus(int i) const;
    111140
    112     virtual void _setMax();
    113     virtual void _setMin();
    114     virtual bool _isMax() const;
     141    virtual ProblemType _getPrimalType() const;
     142    virtual ProblemType _getDualType() const;
     143
     144    virtual void _clear();
    115145
    116146  };
     147
    117148} //END OF NAMESPACE LEMON
    118149
Note: See TracChangeset for help on using the changeset viewer.