Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

lp_glpk.h

Go to the documentation of this file.
00001 /* -*- C++ -*-
00002  * lemon/lp_glpk.h - Part of LEMON, a generic C++ optimization library
00003  *
00004  * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
00005  * (Egervary Research Group on Combinatorial Optimization, EGRES).
00006  *
00007  * Permission to use, modify and distribute this software is granted
00008  * provided that this copyright notice appears in all copies. For
00009  * precise terms see the accompanying LICENSE file.
00010  *
00011  * This software is provided "AS IS" with no warranty of any kind,
00012  * express or implied, and with no claim as to its suitability for any
00013  * purpose.
00014  *
00015  */
00016 
00017 #ifndef LEMON_LP_GLPK_H
00018 #define LEMON_LP_GLPK_H
00019 
00023 
00024 #include <lemon/lp_base.h>
00025 extern "C" {
00026 #include <glpk.h>
00027 }
00028 
00029 namespace lemon {
00030 
00031 
00036   class LpGlpk : public LpSolverBase {
00037   protected:
00038     LPX* lp;
00039     
00040   public:
00041     
00042     typedef LpSolverBase Parent;
00043     
00044     LpGlpk();
00045     ~LpGlpk();
00046     
00047   protected:
00048     virtual LpSolverBase &_newLp();
00049     virtual LpSolverBase &_copyLp();
00050 
00051     virtual int _addCol();
00052     virtual int _addRow();
00053     virtual void _eraseCol(int i);
00054     virtual void _eraseRow(int i);
00055 
00056     virtual void _setRowCoeffs(int i, 
00057                                int length,
00058                                const int   * indices, 
00059                                const Value   * values );
00060     virtual void _setColCoeffs(int i, 
00061                                int length,
00062                                const int   * indices, 
00063                                const Value   * values);
00064     virtual void _setCoeff(int row, int col, Value value);
00065     virtual void _setColLowerBound(int i, Value value);
00066     virtual void _setColUpperBound(int i, Value value);
00067 //     virtual void _setRowLowerBound(int i, Value value);
00068 //     virtual void _setRowUpperBound(int i, Value value);
00069     virtual void _setRowBounds(int i, Value lower, Value upper);
00070     virtual void _setObjCoeff(int i, Value obj_coef);
00071     virtual void _clearObj();
00072 //     virtual void _setObj(int length,
00073 //                          int  const * indices, 
00074 //                          Value  const * values ) = 0;
00075 
00077     
00080     virtual SolveExitStatus _solve();
00081     virtual Value _getPrimal(int i);
00082     virtual Value _getPrimalValue();
00084     
00087     virtual SolutionStatus _getPrimalStatus();
00088     virtual SolutionStatus _getDualStatus();
00089     virtual ProblemTypes _getProblemType();
00090 
00091     virtual void _setMax();
00092     virtual void _setMin();
00093 
00094   public:
00096 
00105     void messageLevel(int m);
00107 
00111     void presolver(bool b);
00112     
00113   };
00114 } //END OF NAMESPACE LEMON
00115 
00116 #endif //LEMON_LP_GLPK_H
00117 

Generated on Sat Aug 27 14:14:53 2005 for LEMON by  doxygen 1.4.4