lp_cplex.h

Go to the documentation of this file.
00001 /* -*- C++ -*-
00002  *
00003  * This file is a part of LEMON, a generic C++ optimization library
00004  *
00005  * Copyright (C) 2003-2006
00006  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
00007  * (Egervary Research Group on Combinatorial Optimization, EGRES).
00008  *
00009  * Permission to use, modify and distribute this software is granted
00010  * provided that this copyright notice appears in all copies. For
00011  * precise terms see the accompanying LICENSE file.
00012  *
00013  * This software is provided "AS IS" with no warranty of any kind,
00014  * express or implied, and with no claim as to its suitability for any
00015  * purpose.
00016  *
00017  */
00018 
00019 #ifndef LEMON_LP_CPLEX_H
00020 #define LEMON_LP_CPLEX_H
00021 
00024 
00025 #include <lemon/lp_base.h>
00026 
00027 extern "C" {
00028 #include <ilcplex/cplex.h>
00029 }
00030 
00031 namespace lemon {
00032 
00033 
00037   class LpCplex : public LpSolverBase {
00038 
00039   public:
00040 
00041     typedef LpSolverBase Parent;
00042     
00044     int status;
00045     CPXENVptr env;
00046     CPXLPptr lp;
00047 
00048 
00050     LpCplex();
00052     ~LpCplex();
00053 
00054   protected:
00055     virtual LpSolverBase &_newLp();
00056     virtual LpSolverBase &_copyLp();
00057 
00058     virtual int _addCol();
00059     virtual int _addRow();
00060     virtual void _eraseCol(int i);
00061     virtual void _eraseRow(int i);
00062     virtual void _getColName(int col,       std::string & name);
00063     virtual void _setColName(int col, const std::string & name);
00064     virtual void _setRowCoeffs(int i, 
00065                                int length,
00066                                const int   * indices, 
00067                                const Value   * values );
00068     virtual void _setColCoeffs(int i, 
00069                                int length,
00070                                const int   * indices, 
00071                                const Value   * values);
00072     virtual void _setCoeff(int row, int col, Value value);
00073     virtual void _setColLowerBound(int i, Value value);
00074     virtual void _setColUpperBound(int i, Value value);
00075 //     virtual void _setRowLowerBound(int i, Value value);
00076 //     virtual void _setRowUpperBound(int i, Value value);
00077     virtual void _setRowBounds(int i, Value lower, Value upper);
00078     virtual void _setObjCoeff(int i, Value obj_coef);
00079     virtual void _clearObj();
00081     
00082     virtual SolveExitStatus _solve();
00083     virtual Value _getPrimal(int i);
00084     virtual Value _getDual(int i);
00085     virtual Value _getPrimalValue();
00086     virtual bool _isBasicCol(int i);
00087     
00088     virtual SolutionStatus _getPrimalStatus();
00089     virtual SolutionStatus _getDualStatus();
00090     virtual ProblemTypes _getProblemType();
00091 
00092     
00093     virtual void _setMax();
00094     virtual void _setMin();
00095 
00096   };
00097 } //END OF NAMESPACE LEMON
00098 
00099 #endif //LEMON_LP_CPLEX_H
00100 

Generated on Fri Feb 3 18:38:42 2006 for LEMON by  doxygen 1.4.6