alpar@1381: /* -*- C++ -*- alpar@1381: * alpar@1956: * This file is a part of LEMON, a generic C++ optimization library alpar@1956: * alpar@1956: * Copyright (C) 2003-2006 alpar@1956: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1381: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@1381: * alpar@1381: * Permission to use, modify and distribute this software is granted alpar@1381: * provided that this copyright notice appears in all copies. For alpar@1381: * precise terms see the accompanying LICENSE file. alpar@1381: * alpar@1381: * This software is provided "AS IS" with no warranty of any kind, alpar@1381: * express or implied, and with no claim as to its suitability for any alpar@1381: * purpose. alpar@1381: * alpar@1381: */ alpar@1381: alpar@1381: #ifndef LEMON_LP_CPLEX_H alpar@1381: #define LEMON_LP_CPLEX_H alpar@1381: alpar@1381: ///\file alpar@1381: ///\brief Header of the LEMON-CPLEX lp solver interface. alpar@1381: alpar@1381: #include alpar@1398: alpar@1381: extern "C" { alpar@1381: #include alpar@1381: } alpar@1381: alpar@1381: namespace lemon { alpar@1381: alpar@1381: alpar@1398: /// \brief Interface for the CPLEX solver alpar@1381: /// alpar@1398: /// This class implements an interface for the CPLEX LP solver. athos@2218: class LpCplex :virtual public LpSolverBase { alpar@1381: alpar@1381: public: alpar@1381: alpar@1381: typedef LpSolverBase Parent; alpar@1381: alpar@1381: /// \e alpar@1381: int status; alpar@1381: CPXENVptr env; alpar@1381: CPXLPptr lp; alpar@1381: alpar@1381: alpar@1381: /// \e alpar@1381: LpCplex(); alpar@1381: /// \e alpar@1381: ~LpCplex(); alpar@1381: alpar@1381: protected: alpar@1381: virtual LpSolverBase &_newLp(); alpar@1381: virtual LpSolverBase &_copyLp(); alpar@1381: athos@2361: alpar@1381: virtual int _addCol(); alpar@1381: virtual int _addRow(); athos@1432: virtual void _eraseCol(int i); athos@1432: virtual void _eraseRow(int i); deba@2366: virtual void _getColName(int col, std::string & name) const; alpar@1895: 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; athos@1431: virtual void _setCoeff(int row, int col, Value value); deba@2366: virtual Value _getCoeff(int row, int col) const; athos@2361: alpar@1381: virtual void _setColLowerBound(int i, Value value); deba@2366: virtual Value _getColLowerBound(int i) const; alpar@1381: virtual void _setColUpperBound(int i, Value value); deba@2366: virtual Value _getColUpperBound(int i) const; athos@2361: athos@1405: // virtual void _setRowLowerBound(int i, Value value); athos@1405: // virtual void _setRowUpperBound(int i, Value value); alpar@1381: virtual void _setRowBounds(int i, Value lower, Value upper); deba@2366: virtual void _getRowBounds(int i, Value &lb, Value &ub) const; alpar@1381: virtual void _setObjCoeff(int i, Value obj_coef); deba@2366: virtual Value _getObjCoeff(int i) const; alpar@1381: virtual void _clearObj(); athos@2361: alpar@1381: alpar@1381: 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; alpar@1381: deba@2366: virtual SolutionStatus _getPrimalStatus() const; deba@2366: virtual SolutionStatus _getDualStatus() const; deba@2366: virtual ProblemTypes _getProblemType() const; alpar@1381: alpar@1381: alpar@1381: virtual void _setMax(); alpar@1381: virtual void _setMin(); alpar@1381: deba@2366: virtual bool _isMax() const; athos@2361: alpar@1381: }; alpar@1381: } //END OF NAMESPACE LEMON alpar@1381: alpar@1381: #endif //LEMON_LP_CPLEX_H alpar@1381: