athos@1261: /* -*- C++ -*- athos@1261: * src/lemon/lp_glpk.h - Part of LEMON, a generic C++ optimization library athos@1261: * athos@1261: * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport athos@1261: * (Egervary Combinatorial Optimization Research Group, EGRES). athos@1261: * athos@1261: * Permission to use, modify and distribute this software is granted athos@1261: * provided that this copyright notice appears in all copies. For athos@1261: * precise terms see the accompanying LICENSE file. athos@1261: * athos@1261: * This software is provided "AS IS" with no warranty of any kind, athos@1261: * express or implied, and with no claim as to its suitability for any athos@1261: * purpose. athos@1261: * athos@1261: */ athos@1261: athos@1261: #ifndef LEMON_LP_GLPK_H athos@1261: #define LEMON_LP_GLPK_H athos@1261: athos@1261: ///\file athos@1261: ///\brief Header of the LEMON-GLPK lp solver interface. athos@1261: athos@1261: #include "lp_base.h" athos@1261: extern "C" { athos@1261: #include "glpk.h" athos@1261: } athos@1261: athos@1261: namespace lemon { athos@1261: athos@1261: athos@1261: /// \brief Wrapper for GLPK solver athos@1261: /// athos@1261: /// This class implements a lemon wrapper for GLPK. athos@1261: class LpGlpk : public LpSolverBase { athos@1261: athos@1261: public: athos@1261: athos@1261: typedef LpSolverBase Parent; athos@1261: athos@1261: /// \e athos@1261: LPX* lp; athos@1261: athos@1261: /// \e athos@1261: LpGlpk() : Parent(), athos@1261: lp(lpx_create_prob()) { athos@1261: lpx_set_int_parm(lp, LPX_K_DUAL, 1); athos@1261: } athos@1261: /// \e athos@1261: ~LpGlpk() { athos@1261: lpx_delete_prob(lp); athos@1261: } athos@1261: athos@1261: protected: athos@1261: virtual int _addCol(); athos@1261: virtual int _addRow(); athos@1261: virtual void _setRowCoeffs(int i, athos@1261: int length, alpar@1263: const int * indices, alpar@1263: const Value * values ); athos@1261: virtual void _setColCoeffs(int i, athos@1261: int length, alpar@1263: const int * indices, alpar@1263: const Value * values); athos@1261: virtual void _setColLowerBound(int i, Value value); athos@1261: virtual void _setColUpperBound(int i, Value value); athos@1261: virtual void _setRowLowerBound(int i, Value value); athos@1261: virtual void _setRowUpperBound(int i, Value value); athos@1261: virtual void _setObjCoeff(int i, Value obj_coef); alpar@1263: ///\e alpar@1263: alpar@1263: ///\bug Unimplemented alpar@1263: /// alpar@1303: virtual SolveExitStatus _solve(); alpar@1263: ///\e alpar@1263: alpar@1263: ///\bug Unimplemented alpar@1263: /// alpar@1293: virtual Value _getPrimal(int i); alpar@1294: ///\e alpar@1294: alpar@1294: ///\bug Unimplemented alpar@1294: /// alpar@1312: virtual Value _getPrimalValue(); alpar@1312: ///\e alpar@1312: alpar@1312: ///\bug Unimplemented alpar@1312: /// alpar@1312: virtual SolutionStatus _getPrimalStatus(); athos@1261: alpar@1312: ///\e alpar@1312: alpar@1312: ///\bug Unimplemented alpar@1312: /// alpar@1312: virtual void _setMax(); alpar@1312: ///\e alpar@1312: alpar@1312: ///\bug Unimplemented alpar@1312: /// alpar@1312: virtual void _setMin(); alpar@1312: athos@1261: }; athos@1261: } //END OF NAMESPACE LEMON athos@1261: athos@1261: #endif //LEMON_LP_GLPK_H athos@1261: