New functions in lp_glpk.cc. Sample file: lp_sample.cc.
2 * src/lemon/lp_cplex.cc
3 * - Part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
6 * (Egervary Combinatorial Optimization Research Group, EGRES).
8 * Permission to use, modify and distribute this software is granted
9 * provided that this copyright notice appears in all copies. For
10 * precise terms see the accompanying LICENSE file.
12 * This software is provided "AS IS" with no warranty of any kind,
13 * express or implied, and with no claim as to its suitability for any
21 ///\brief Implementation of the LEMON-CPLEX lp solver interface.
24 int LpCplex::_addCol()
26 int i = CPXgetnumcols (env, lp);
28 lb[0]=-INF;//-CPX_INFBOUND;
29 ub[0]=INF;//CPX_INFBOUND;
30 status = CPXnewcols (env, lp, 1, NULL, lb, ub, NULL, NULL);
34 int LpCplex::_addRow()
36 int i = CPXgetnumrows (env, lp);
37 status = CPXnewrows (env, lp, 1, NULL, NULL, NULL, NULL, NULL);
41 ///\warning Data at index 0 is ignored iin the arrays.
42 void LpCplex::_setRowCoeffs(int i,
45 Value const * values )
47 int rowlist[length+1];
48 for (int k=1;k<=length;++k){
51 status = CPXchgcoeflist(env, lp,
58 void LpCplex::_setColCoeffs(int i,
63 int collist[length+1];
64 for (int k=1;k<=length;++k){
67 status = CPXchgcoeflist(env, lp,
74 void LpCplex::_setColLowerBound(int i, Value value)
78 void LpCplex::_setColUpperBound(int i, Value value)
82 void LpCplex::_setRowLowerBound(int i, Value value)
86 void LpCplex::_setRowUpperBound(int i, Value value)
90 void LpCplex::_setObjCoeff(int i, Value obj_coef)
94 LpCplex::SolutionStatus LpCplex::_solve()
99 LpCplex::Value LpCplex::_getSolution(int i)