/* -*- C++ -*- * * This file is a part of LEMON, a generic C++ optimization library * * Copyright (C) 2003-2006 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ #ifndef LEMON_LP_CPLEX_H #define LEMON_LP_CPLEX_H ///\file ///\brief Header of the LEMON-CPLEX lp solver interface. #include extern "C" { #include } namespace lemon { /// \brief Interface for the CPLEX solver /// /// This class implements an interface for the CPLEX LP solver. class LpCplex : public LpSolverBase { public: typedef LpSolverBase Parent; /// \e int status; CPXENVptr env; CPXLPptr lp; /// \e LpCplex(); /// \e ~LpCplex(); protected: virtual LpSolverBase &_newLp(); virtual LpSolverBase &_copyLp(); virtual int _addCol(); virtual int _addRow(); virtual void _eraseCol(int i); virtual void _eraseRow(int i); virtual void _getColName(int col, std::string & name); virtual void _setColName(int col, const std::string & name); virtual void _setRowCoeffs(int i, int length, const int * indices, const Value * values ); virtual void _setColCoeffs(int i, int length, const int * indices, const Value * values); virtual void _setCoeff(int row, int col, Value value); virtual void _setColLowerBound(int i, Value value); virtual void _setColUpperBound(int i, Value value); // virtual void _setRowLowerBound(int i, Value value); // virtual void _setRowUpperBound(int i, Value value); virtual void _setRowBounds(int i, Value lower, Value upper); virtual void _setObjCoeff(int i, Value obj_coef); virtual void _clearObj(); ///\e virtual SolveExitStatus _solve(); virtual Value _getPrimal(int i); virtual Value _getDual(int i); virtual Value _getPrimalValue(); virtual bool _isBasicCol(int i); virtual SolutionStatus _getPrimalStatus(); virtual SolutionStatus _getDualStatus(); virtual ProblemTypes _getProblemType(); virtual void _setMax(); virtual void _setMin(); }; } //END OF NAMESPACE LEMON #endif //LEMON_LP_CPLEX_H