deba@2313: /* -*- C++ -*- deba@2313: * deba@2313: * This file is a part of LEMON, a generic C++ optimization library deba@2313: * alpar@2553: * Copyright (C) 2003-2008 deba@2313: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport deba@2313: * (Egervary Research Group on Combinatorial Optimization, EGRES). deba@2313: * deba@2313: * Permission to use, modify and distribute this software is granted deba@2313: * provided that this copyright notice appears in all copies. For deba@2313: * precise terms see the accompanying LICENSE file. deba@2313: * deba@2313: * This software is provided "AS IS" with no warranty of any kind, deba@2313: * express or implied, and with no claim as to its suitability for any deba@2313: * purpose. deba@2313: * deba@2313: */ deba@2313: deba@2313: #ifndef LEMON_LP_SOPLEX_H deba@2313: #define LEMON_LP_SOPLEX_H deba@2313: deba@2313: ///\file deba@2313: ///\brief Header of the LEMON-SOPLEX lp solver interface. deba@2313: deba@2313: #include deba@2313: #include deba@2313: deba@2313: #include deba@2313: deba@2313: // Forward declaration deba@2313: namespace soplex { deba@2313: class SoPlex; deba@2313: } deba@2313: deba@2313: namespace lemon { deba@2313: deba@2370: /// \ingroup lp_group deba@2366: /// deba@2313: /// \brief Interface for the SOPLEX solver deba@2313: /// deba@2366: /// This class implements an interface for the SoPlex LP solver. deba@2366: /// The SoPlex library is an object oriented lp solver library deba@2366: /// developed at the Konrad-Zuse-Zentrum für Informationstechnik deba@2366: /// Berlin (ZIB). You can find detailed information about it at the deba@2366: /// http://soplex.zib.de address. deba@2313: class LpSoplex :virtual public LpSolverBase { deba@2313: protected: deba@2313: deba@2363: _lp_bits::RelocateIdHandler relocateIdHandler; deba@2363: deba@2313: soplex::SoPlex* soplex; deba@2363: bool solved; deba@2313: deba@2313: std::vector colNames; deba@2366: std::map invColNames; deba@2313: deba@2363: std::vector primal_value; deba@2363: std::vector dual_value; deba@2313: deba@2313: deba@2313: public: deba@2313: deba@2313: typedef LpSolverBase Parent; deba@2313: deba@2313: deba@2313: /// \e deba@2313: LpSoplex(); deba@2313: /// \e deba@2313: ~LpSoplex(); deba@2313: deba@2313: protected: deba@2313: deba@2313: virtual LpSolverBase &_newLp(); deba@2313: virtual LpSolverBase &_copyLp(); deba@2313: deba@2313: virtual int _addCol(); deba@2313: virtual int _addRow(); deba@2313: virtual void _eraseCol(int i); deba@2313: virtual void _eraseRow(int i); deba@2366: virtual void _getColName(int col, std::string & name) const; deba@2313: virtual void _setColName(int col, const std::string & name); deba@2366: virtual int _colByName(const std::string& name) const; deba@2364: virtual void _setRowCoeffs(int i, ConstRowIterator b, ConstRowIterator e); deba@2366: virtual void _getRowCoeffs(int i, RowIterator b) const; deba@2364: virtual void _setColCoeffs(int i, ConstColIterator b, ConstColIterator e); deba@2366: virtual void _getColCoeffs(int i, ColIterator b) const; deba@2313: virtual void _setCoeff(int row, int col, Value value); deba@2366: virtual Value _getCoeff(int row, int col) const; deba@2313: virtual void _setColLowerBound(int i, Value value); deba@2366: virtual Value _getColLowerBound(int i) const; deba@2313: virtual void _setColUpperBound(int i, Value value); deba@2366: virtual Value _getColUpperBound(int i) const; deba@2313: virtual void _setRowBounds(int i, Value lower, Value upper); deba@2366: virtual void _getRowBounds(int i, Value &lower, Value &upper) const; deba@2313: virtual void _setObjCoeff(int i, Value obj_coef); deba@2366: virtual Value _getObjCoeff(int i) const; deba@2313: virtual void _clearObj(); deba@2313: deba@2313: virtual SolveExitStatus _solve(); deba@2366: virtual Value _getPrimal(int i) const; deba@2366: virtual Value _getDual(int i) const; deba@2366: virtual Value _getPrimalValue() const; deba@2366: virtual bool _isBasicCol(int i) const; deba@2313: deba@2366: virtual SolutionStatus _getPrimalStatus() const; deba@2366: virtual SolutionStatus _getDualStatus() const; deba@2366: virtual ProblemTypes _getProblemType() const; deba@2313: deba@2313: deba@2313: virtual void _setMax(); deba@2313: virtual void _setMin(); deba@2366: virtual bool _isMax() const; deba@2313: deba@2313: }; deba@2313: } //END OF NAMESPACE LEMON deba@2313: deba@2313: #endif //LEMON_LP_SOPLEX_H deba@2313: