2 * src/lemon/lp_cplex.h - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
17 #ifndef LEMON_LP_CPLEX_H
18 #define LEMON_LP_CPLEX_H
21 ///\brief Header of the LEMON-CPLEX lp solver interface.
23 #include <lemon/lp_base.h>
25 #include <ilcplex/cplex.h>
31 /// \brief Wrapper for GLPK solver
33 /// This class implements a lemon wrapper for GLPK.
34 class LpCplex : public LpSolverBase {
38 typedef LpSolverBase Parent;
47 LpCplex() : Parent() {
50 env = CPXopenCPLEXdevelop(&status);
53 // fprintf(stderr,"A CPLEX környezet megnyitása sikertelen.\n");
54 // CPXgeterrorstring(Env, Status, ErrorMsg);
55 // fprintf(stderr,"%s",ErrorMsg);
59 // *** A problema létrehozása ***
60 lp = CPXcreateprob(env, &status, "LP problem");
62 // if (Problem == NULL)
64 // fprintf(stderr,"Az LP létrehozása sikertelen");
71 status = CPXfreeprob(env,&lp);
74 // fprintf(stderr,"A CPLEX feladat törlése sikertelen.\n");
75 // CPXgeterrorstring(Env, Status, ErrorMsg);
76 // fprintf(stderr,"%s",ErrorMsg);
80 status = CPXcloseCPLEX(&env);
83 // fprintf(stderr,"A CPLEX környezet bezárása sikertelen.\n");
84 // CPXgeterrorstring(Env, Status, ErrorMsg);
85 // fprintf(stderr,"%s",ErrorMsg);
92 virtual int _addCol();
93 virtual int _addRow();
94 virtual void _setRowCoeffs(int i,
97 const Value * values );
98 virtual void _setColCoeffs(int i,
101 const Value * values);
102 virtual void _setColLowerBound(int i, Value value);
103 virtual void _setColUpperBound(int i, Value value);
104 virtual void _setRowLowerBound(int i, Value value);
105 virtual void _setRowUpperBound(int i, Value value);
106 virtual void _setObjCoeff(int i, Value obj_coef);
109 ///\bug Unimplemented
111 virtual SolveExitStatus _solve();
114 ///\bug Unimplemented
116 virtual Value _getPrimal(int i);
119 ///\bug Unimplemented
121 virtual Value _getPrimalValue();
124 ///\bug Unimplemented
126 virtual SolutionStatus _getPrimalStatus();
130 ///\bug Unimplemented
132 virtual void _setMax();
135 ///\bug Unimplemented
137 virtual void _setMin();
140 } //END OF NAMESPACE LEMON
142 #endif //LEMON_LP_CPLEX_H