diff -r d8475431bbbb -r 8e85e6bbefdf lemon/lp_skeleton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lemon/lp_skeleton.h Mon May 23 04:48:14 2005 +0000 @@ -0,0 +1,133 @@ +/* -*- C++ -*- + * lemon/lp_skeleton.h - Part of LEMON, a generic C++ optimization library + * + * Copyright (C) 2005 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_SKELETON +#define LEMON_LP_SKELETON + +#include + +///\file +///\brief A skeleton file to implement LP solver interfaces +namespace lemon { + + ///A skeleton class to implement LP solver interfaces + class LpSkeleton :public LpSolverBase { + int col_num,row_num; + + protected: + ///\e + virtual LpSolverBase &_newLp(); + ///\e + virtual LpSolverBase &_copyLp(); + /// \e + virtual int _addCol(); + /// \e + virtual int _addRow(); + /// \e + virtual void _eraseCol(int i); + /// \e + virtual void _eraseRow(int i); + /// \e + + /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) + /// + virtual void _setRowCoeffs(int i, + int length, + int const * indices, + Value const * values ); + /// \e + + /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) + /// + virtual void _setColCoeffs(int i, + int length, + int const * indices, + Value const * values ); + + /// Set one element of the coefficient matrix + virtual void _setCoeff(int row, int col, Value value); + + /// The lower bound of a variable (column) have to be given by an + /// extended number of type Value, i.e. a finite number of type + /// Value or -\ref INF. + virtual void _setColLowerBound(int i, Value value); + /// \e + + /// The upper bound of a variable (column) have to be given by an + /// extended number of type Value, i.e. a finite number of type + /// Value or \ref INF. + virtual void _setColUpperBound(int i, Value value); + /// \e + +// /// The lower bound of a linear expression (row) have to be given by an +// /// extended number of type Value, i.e. a finite number of type +// /// Value or -\ref INF. +// virtual void _setRowLowerBound(int i, Value value); +// /// \e + +// /// The upper bound of a linear expression (row) have to be given by an +// /// extended number of type Value, i.e. a finite number of type +// /// Value or \ref INF. +// virtual void _setRowUpperBound(int i, Value value); + + /// The lower and upper bound of a linear expression (row) have to be + /// given by an + /// extended number of type Value, i.e. a finite number of type + /// Value or +/-\ref INF. + virtual void _setRowBounds(int i, Value lb, Value ub); + /// \e + + + /// \e + virtual void _clearObj(); + /// \e + virtual void _setObjCoeff(int i, Value obj_coef); + + ///\e + + ///\bug Wrong interface + /// + virtual SolveExitStatus _solve(); + + ///\e + + ///\bug Wrong interface + /// + virtual Value _getPrimal(int i); + ///\e + + ///\bug Wrong interface + /// + virtual Value _getPrimalValue(); + ///\e + + ///\bug Wrong interface + /// + virtual SolutionStatus _getPrimalStatus(); + + ///\e + virtual void _setMax(); + ///\e + virtual void _setMin(); + + + public: + LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {} + }; + +} //namespace lemon + +#endif // LEMON_LP_SKELETON