lemon/lp_soplex.h
changeset 459 ed54c0d13df0
parent 458 7afc121e0689
     1.1 --- a/lemon/lp_soplex.h	Tue Dec 02 21:40:33 2008 +0100
     1.2 +++ b/lemon/lp_soplex.h	Tue Dec 02 22:48:28 2008 +0100
     1.3 @@ -43,26 +43,30 @@
     1.4    /// developed at the Konrad-Zuse-Zentrum für Informationstechnik
     1.5    /// Berlin (ZIB). You can find detailed information about it at the
     1.6    /// <tt>http://soplex.zib.de</tt> address.
     1.7 -  class LpSoplex :virtual public LpSolverBase {
     1.8 -  protected:
     1.9 -
    1.10 -    _lp_bits::RelocateIdHandler relocateIdHandler;
    1.11 +  class LpSoplex : public LpSolver {
    1.12 +  private:
    1.13  
    1.14      soplex::SoPlex* soplex;
    1.15 -    bool solved;
    1.16  
    1.17 -    std::vector<std::string> colNames;
    1.18 -    std::map<std::string, int> invColNames;
    1.19 +    std::vector<std::string> _col_names;
    1.20 +    std::map<std::string, int> _col_names_ref;
    1.21  
    1.22 -    std::vector<Value> primal_value;
    1.23 -    std::vector<Value> dual_value;
    1.24 +    std::vector<std::string> _row_names;
    1.25 +    std::map<std::string, int> _row_names_ref;
    1.26  
    1.27 +  private:
    1.28 +
    1.29 +    // these values cannot be retrieved element by element
    1.30 +    mutable std::vector<Value> _primal_values;
    1.31 +    mutable std::vector<Value> _dual_values;
    1.32 +
    1.33 +    mutable std::vector<Value> _primal_ray;
    1.34 +    mutable std::vector<Value> _dual_ray;
    1.35 +
    1.36 +    void _clear_temporals();
    1.37  
    1.38    public:
    1.39  
    1.40 -    typedef LpSolverBase Parent;
    1.41 -
    1.42 -
    1.43      /// \e
    1.44      LpSoplex();
    1.45      /// \e
    1.46 @@ -72,48 +76,75 @@
    1.47  
    1.48    protected:
    1.49  
    1.50 -    virtual LpSolverBase* _newLp();
    1.51 -    virtual LpSolverBase* _copyLp();
    1.52 +    virtual LpSoplex* _newSolver() const;
    1.53 +    virtual LpSoplex* _cloneSolver() const;
    1.54 +
    1.55 +    virtual const char* _solverName() const;
    1.56  
    1.57      virtual int _addCol();
    1.58      virtual int _addRow();
    1.59 +
    1.60      virtual void _eraseCol(int i);
    1.61      virtual void _eraseRow(int i);
    1.62 -    virtual void _getColName(int col, std::string & name) const;
    1.63 -    virtual void _setColName(int col, const std::string & name);
    1.64 +
    1.65 +    virtual void _eraseColId(int i);
    1.66 +    virtual void _eraseRowId(int i);
    1.67 +
    1.68 +    virtual void _getColName(int col, std::string& name) const;
    1.69 +    virtual void _setColName(int col, const std::string& name);
    1.70      virtual int _colByName(const std::string& name) const;
    1.71 -    virtual void _setRowCoeffs(int i, ConstRowIterator b, ConstRowIterator e);
    1.72 -    virtual void _getRowCoeffs(int i, RowIterator b) const;
    1.73 -    virtual void _setColCoeffs(int i, ConstColIterator b, ConstColIterator e);
    1.74 -    virtual void _getColCoeffs(int i, ColIterator b) const;
    1.75 +
    1.76 +    virtual void _getRowName(int row, std::string& name) const;
    1.77 +    virtual void _setRowName(int row, const std::string& name);
    1.78 +    virtual int _rowByName(const std::string& name) const;
    1.79 +
    1.80 +    virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
    1.81 +    virtual void _getRowCoeffs(int i, InsertIterator b) const;
    1.82 +
    1.83 +    virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
    1.84 +    virtual void _getColCoeffs(int i, InsertIterator b) const;
    1.85 +
    1.86      virtual void _setCoeff(int row, int col, Value value);
    1.87      virtual Value _getCoeff(int row, int col) const;
    1.88 +
    1.89      virtual void _setColLowerBound(int i, Value value);
    1.90      virtual Value _getColLowerBound(int i) const;
    1.91      virtual void _setColUpperBound(int i, Value value);
    1.92      virtual Value _getColUpperBound(int i) const;
    1.93 -    virtual void _setRowBounds(int i, Value lower, Value upper);
    1.94 -    virtual void _getRowBounds(int i, Value &lower, Value &upper) const;
    1.95 +
    1.96 +    virtual void _setRowLowerBound(int i, Value value);
    1.97 +    virtual Value _getRowLowerBound(int i) const;
    1.98 +    virtual void _setRowUpperBound(int i, Value value);
    1.99 +    virtual Value _getRowUpperBound(int i) const;
   1.100 +
   1.101 +    virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
   1.102 +    virtual void _getObjCoeffs(InsertIterator b) const;
   1.103 +
   1.104      virtual void _setObjCoeff(int i, Value obj_coef);
   1.105      virtual Value _getObjCoeff(int i) const;
   1.106 -    virtual void _clearObj();
   1.107 +
   1.108 +    virtual void _setSense(Sense sense);
   1.109 +    virtual Sense _getSense() const;
   1.110  
   1.111      virtual SolveExitStatus _solve();
   1.112      virtual Value _getPrimal(int i) const;
   1.113      virtual Value _getDual(int i) const;
   1.114 +
   1.115      virtual Value _getPrimalValue() const;
   1.116 -    virtual bool _isBasicCol(int i) const;
   1.117  
   1.118 -    virtual SolutionStatus _getPrimalStatus() const;
   1.119 -    virtual SolutionStatus _getDualStatus() const;
   1.120 -    virtual ProblemTypes _getProblemType() const;
   1.121 +    virtual Value _getPrimalRay(int i) const;
   1.122 +    virtual Value _getDualRay(int i) const;
   1.123  
   1.124 +    virtual VarStatus _getColStatus(int i) const;
   1.125 +    virtual VarStatus _getRowStatus(int i) const;
   1.126  
   1.127 -    virtual void _setMax();
   1.128 -    virtual void _setMin();
   1.129 -    virtual bool _isMax() const;
   1.130 +    virtual ProblemType _getPrimalType() const;
   1.131 +    virtual ProblemType _getDualType() const;
   1.132 +
   1.133 +    virtual void _clear();
   1.134  
   1.135    };
   1.136 +
   1.137  } //END OF NAMESPACE LEMON
   1.138  
   1.139  #endif //LEMON_LP_SOPLEX_H