# HG changeset patch # User marci # Date 1107271607 0 # Node ID b258584569f2017c6b5d9c03def0f02c1347723b # Parent 88ade201ffc6a8bbcaffc6241442b7df829fe99d try of grouping for documentation diff -r 88ade201ffc6 -r b258584569f2 src/work/marci/lp/lp_solver_base.h --- a/src/work/marci/lp/lp_solver_base.h Tue Feb 01 12:53:30 2005 +0000 +++ b/src/work/marci/lp/lp_solver_base.h Tue Feb 01 15:26:47 2005 +0000 @@ -177,10 +177,18 @@ The aim of this class is to give a general surface to different solvers, i.e. it makes possible to write algorithms using LP's, in which the solver can be changed to an other one easily. + \nosubgrouping */ template class LPSolverBase { + + /*! @name Unchategorized functions and types (public members) + */ + //@{ public: + + //UNCATEGORIZED + /// \e typedef _Value Value; /// \e @@ -205,18 +213,78 @@ VALID_CLASS(0), INVALID_CLASS(1) { } /// \e virtual ~LPSolverBase() { } + //@} - //MATRIX INDEPEDENT MANIPULATING FUNCTIONS + /*! @name Medium level interface (public members) + These functions appear in the low level and also in the high level + interfaces thus these each of these functions have to be implemented + only once in the different interfaces. + This means that these functions have to be reimplemented for all of the + different lp solvers. These are basic functions, and have the same + parameter lists in the low and high level interfaces. + */ + //@{ + public: - public: + //UNCATEGORIZED FUNCTIONS + /// \e virtual void setMinimize() = 0; /// \e virtual void setMaximize() = 0; - //LOW LEVEL INTERFACE, MATRIX MANIPULATING FUNCTIONS + //SOLVER FUNCTIONS + /// \e + virtual void solveSimplex() = 0; + /// \e + virtual void solvePrimalSimplex() = 0; + /// \e + virtual void solveDualSimplex() = 0; + /// \e + + //SOLUTION RETRIEVING + + /// \e + virtual _Value getObjVal() = 0; + + //OTHER FUNCTIONS + + /// \e + virtual int rowNum() const = 0; + /// \e + virtual int colNum() const = 0; + /// \e + virtual int warmUp() = 0; + /// \e + virtual void printWarmUpStatus(int i) = 0; + /// \e + virtual int getPrimalStatus() = 0; + /// \e + virtual void printPrimalStatus(int i) = 0; + /// \e + virtual int getDualStatus() = 0; + /// \e + virtual void printDualStatus(int i) = 0; + /// Returns the status of the slack variable assigned to row \c row_it. + virtual int getRowStat(const RowIt& row_it) = 0; + /// \e + virtual void printRowStatus(int i) = 0; + /// Returns the status of the variable assigned to column \c col_it. + virtual int getColStat(const ColIt& col_it) = 0; + /// \e + virtual void printColStatus(int i) = 0; + + //@} + + /*! @name Low level interface (protected members) + Problem manipulating functions in the low level interface + */ + //@{ protected: + + //MATRIX MANIPULATING FUNCTIONS + /// \e virtual int _addCol() = 0; /// \e @@ -279,16 +347,21 @@ virtual void _setObjCoef(int i, _Value obj_coef) = 0; /// \e virtual _Value _getObjCoef(int i) = 0; + + //SOLUTION RETRIEVING - //LOW LEVEL, SOLUTION RETRIEVING FUNCTIONS - - protected: /// \e virtual _Value _getPrimal(int i) = 0; + //@} + + /*! @name High level interface (public members) + Problem manipulating functions in the high level interface + */ + //@{ + public: - //HIGH LEVEL INTERFACE, MATRIX MANIPULATING FUNTIONS + //MATRIX MANIPULATING FUNCTIONS - public: /// \e ColIt addCol() { int i=_addCol(); @@ -402,12 +475,29 @@ return _getObjCoef(col_iter_map[col_it]); } - //MOST HIGH LEVEL, USER FRIEND FUNCTIONS + //SOLUTION RETRIEVING FUNCTIONS + + /// \e + _Value getPrimal(const ColIt& col_it) { + return _getPrimal(col_iter_map[col_it]); + } + + //@} + + /*! @name User friend interface + Problem manipulating functions in the user friend interface + */ + //@{ + + //EXPRESSION TYPES /// \e typedef Expr Expression; /// \e typedef Expr DualExpression; + + //MATRIX MANIPULATING FUNCTIONS + /// \e void setRowCoeffs(RowIt row_it, const Expression& expr) { std::vector > row_coeffs; @@ -435,54 +525,7 @@ setObjCoef((*i).first, (*i).second); } } - - //SOLVER FUNCTIONS - - /// \e - virtual void solveSimplex() = 0; - /// \e - virtual void solvePrimalSimplex() = 0; - /// \e - virtual void solveDualSimplex() = 0; - /// \e - - //HIGH LEVEL, SOLUTION RETRIEVING FUNCTIONS - - public: - - /// \e - _Value getPrimal(const ColIt& col_it) { - return _getPrimal(col_iter_map[col_it]); - } - /// \e - virtual _Value getObjVal() = 0; - - //OTHER FUNCTIONS - - /// \e - virtual int rowNum() const = 0; - /// \e - virtual int colNum() const = 0; - /// \e - virtual int warmUp() = 0; - /// \e - virtual void printWarmUpStatus(int i) = 0; - /// \e - virtual int getPrimalStatus() = 0; - /// \e - virtual void printPrimalStatus(int i) = 0; - /// \e - virtual int getDualStatus() = 0; - /// \e - virtual void printDualStatus(int i) = 0; - /// Returns the status of the slack variable assigned to row \c row_it. - virtual int getRowStat(const RowIt& row_it) = 0; - /// \e - virtual void printRowStatus(int i) = 0; - /// Returns the status of the variable assigned to column \c col_it. - virtual int getColStat(const ColIt& col_it) = 0; - /// \e - virtual void printColStatus(int i) = 0; + //@} }; template