alpar@1254: /* -*- C++ -*- alpar@1313: * src/lemon/lp_skeleton.h alpar@1254: * - Part of LEMON, a generic C++ optimization library alpar@1254: * alpar@1254: * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1254: * (Egervary Combinatorial Optimization Research Group, EGRES). alpar@1254: * alpar@1254: * Permission to use, modify and distribute this software is granted alpar@1254: * provided that this copyright notice appears in all copies. For alpar@1254: * precise terms see the accompanying LICENSE file. alpar@1254: * alpar@1254: * This software is provided "AS IS" with no warranty of any kind, alpar@1254: * express or implied, and with no claim as to its suitability for any alpar@1254: * purpose. alpar@1254: * alpar@1254: */ alpar@1254: alpar@1313: #ifndef LEMON_LP_SKELETON alpar@1313: #define LEMON_LP_SKELETON alpar@1254: ladanyi@1356: #include alpar@1254: alpar@1254: ///\file alpar@1254: ///\brief A skeleton file to implement LP solver interfaces alpar@1254: namespace lemon { alpar@1254: alpar@1254: ///A skeleton class to implement LP solver interfaces alpar@1313: class LpSkeleton :public LpSolverBase { alpar@1273: int col_num,row_num; alpar@1273: alpar@1254: protected: alpar@1294: /// \e alpar@1254: virtual int _addCol(); alpar@1294: /// \e alpar@1254: virtual int _addRow(); alpar@1294: /// \e alpar@1294: alpar@1294: /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) alpar@1294: /// alpar@1254: virtual void _setRowCoeffs(int i, alpar@1254: int length, alpar@1254: int const * indices, alpar@1254: Value const * values ); alpar@1294: /// \e alpar@1294: alpar@1294: /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) alpar@1294: /// alpar@1254: virtual void _setColCoeffs(int i, alpar@1254: int length, alpar@1254: int const * indices, alpar@1294: Value const * values ); alpar@1294: alpar@1294: /// \e alpar@1294: alpar@1294: /// The lower bound of a variable (column) have to be given by an alpar@1294: /// extended number of type Value, i.e. a finite number of type alpar@1294: /// Value or -\ref INF. alpar@1254: virtual void _setColLowerBound(int i, Value value); alpar@1294: /// \e alpar@1294: alpar@1294: /// The upper bound of a variable (column) have to be given by an alpar@1294: /// extended number of type Value, i.e. a finite number of type alpar@1294: /// Value or \ref INF. alpar@1254: virtual void _setColUpperBound(int i, Value value); alpar@1294: /// \e alpar@1294: alpar@1294: /// The lower bound of a linear expression (row) have to be given by an alpar@1294: /// extended number of type Value, i.e. a finite number of type alpar@1294: /// Value or -\ref INF. alpar@1254: virtual void _setRowLowerBound(int i, Value value); alpar@1294: /// \e alpar@1294: alpar@1294: /// The upper bound of a linear expression (row) have to be given by an alpar@1294: /// extended number of type Value, i.e. a finite number of type alpar@1294: /// Value or \ref INF. alpar@1254: virtual void _setRowUpperBound(int i, Value value); alpar@1294: alpar@1294: /// \e alpar@1254: virtual void _setObjCoeff(int i, Value obj_coef); alpar@1294: alpar@1294: ///\e alpar@1294: alpar@1294: ///\bug Wrong interface alpar@1294: /// alpar@1303: virtual SolveExitStatus _solve(); alpar@1294: alpar@1294: ///\e alpar@1294: alpar@1294: ///\bug Wrong interface alpar@1294: /// alpar@1293: virtual Value _getPrimal(int i); alpar@1294: ///\e alpar@1294: alpar@1294: ///\bug Wrong interface alpar@1294: /// alpar@1312: virtual Value _getPrimalValue(); alpar@1312: ///\e alpar@1312: alpar@1312: ///\bug Wrong interface alpar@1312: /// alpar@1312: virtual SolutionStatus _getPrimalStatus(); alpar@1312: alpar@1312: ///\e alpar@1312: virtual void _setMax(); alpar@1312: ///\e alpar@1312: virtual void _setMin(); alpar@1312: alpar@1294: alpar@1273: public: alpar@1313: LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {} alpar@1254: }; alpar@1254: alpar@1254: } //namespace lemon alpar@1254: alpar@1313: #endif // LEMON_LP_SKELETON